Ticket #4554: test.cpp

File test.cpp, 462 bytes (added by ulidtko@…, 12 years ago)

classical zcat example

Line 
1#include <string>
2#include <iostream>
3#include <boost/iostreams/filtering_stream.hpp>
4#include <boost/iostreams/filter/gzip.hpp>
5
6using namespace boost::iostreams;
7using namespace boost::iostreams::gzip;
8
9int main() {
10 filtering_istream stream_in;
11 stream_in.push(gzip_decompressor());
12 stream_in.push(std::cin);
13
14 std::istream& std_stream = stream_in;
15
16 while(!std_stream.eof()) {
17 std::string s;
18 getline(std_stream, s);
19 std::cout << s << std::endl;
20 }
21}