欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

iostream filter chain

程序员文章站 2022-04-11 15:48:44
...
FILE* pf = popen("/bin/tar xf - ", "w");
 if (pf != NULL) {
            ifstream file(src_file, ios_base::in | ios_base::binary);
            io::filtering_streambuf<input> in;
            in.push(io::gzip_decompressor());
            in.push(file);
            io::file_descriptor_sink out(fileno(pf));
            io::copy(in, out);
            pclose(pf);
}
 

A piece of code demo the input iostream filter chain.

相关标签: iOS