MCPcopy Create free account
hub / github.com/acl-dev/acl / test_zlib_pipe

Function test_zlib_pipe

lib_acl_cpp/samples/zlib/zlib.cpp:111–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111static void test_zlib_pipe(void)
112{
113 acl::ifstream in;
114
115 if (in.open_read("./in.txt") == false)
116 {
117 logger_error("open in.txt error");
118 return;
119 }
120
121 acl::pipe_manager manager;
122 acl::charset_conv gbToUtf;
123 acl::zlib_stream zip;
124 acl::zlib_stream unzip;
125 acl::charset_conv utfToGb;
126 acl::ofstream out;
127 acl::pipe_string ps;
128
129 zip.pipe_zip_begin();
130 unzip.pipe_unzip_begin();
131 if (1)
132 {
133 gbToUtf.update_begin("gb2312", "utf-8");
134 utfToGb.update_begin("utf-8", "gb2312");
135 }
136 else
137 {
138 gbToUtf.update_begin("gb2312", "big5");
139 utfToGb.update_begin("big5", "gb2312");
140 }
141
142 if (out.open_write("./out.txt") == false)
143 {
144 logger_error("open out.txt file error");
145 return;
146 }
147
148 if (0)
149 {
150 // ����ʽ���ӣ���ִ�е�˳�������ӵ�˳���෴
151
152 manager.push_front(&ps);
153 manager.push_front(&out);
154 manager.push_front(&utfToGb);
155 manager.push_front(&unzip);
156 manager.push_front(&zip);
157 manager.push_front(&gbToUtf);
158 }
159 else
160 {
161 // ����ʽ���ӣ���ִ�е�˳�������ӵ�˳����ͬ
162
163 manager.push_back(&gbToUtf);
164 manager.push_back(&zip);
165 manager.push_back(&unzip);
166 manager.push_back(&utfToGb);
167 manager.push_back(&ps);
168 manager.push_back(&out);

Callers 1

mainFunction · 0.85

Calls 11

pipe_zip_beginMethod · 0.80
pipe_unzip_beginMethod · 0.80
push_frontMethod · 0.80
open_readMethod · 0.45
update_beginMethod · 0.45
open_writeMethod · 0.45
push_backMethod · 0.45
readMethod · 0.45
updateMethod · 0.45
update_endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…