#include #include #include #include #include #include using namespace std; using namespace boost::iostreams; int main(int argc, char** argv) { if (argc != 2) { cerr << "specify a file to decompress.\n"; exit(1); } ifstream f(argv[1]); if (!f) { cerr << "failed to open " << argv[1] << "\n"; exit(1); } filtering_stream s; gzip_decompressor gz; s.push(gz); s.push(f); string line; unsigned count = 0; while (getline(s, line) && ++count) cout << line << "\n"; cout << "read " << count << " lines\n"; return 0; }