#include #include #include #include #include #include #include #include #include #include //#define WORKS #define DO_NOT WORK /* Helper class for writing gzipped files */ class gzip_sink { public: typedef char char_type; typedef boost::iostreams::sink_tag category; boost::iostreams::filtering_ostream sink_; /* Sink used to push filters */ std::ofstream &outifstr_; /* Write stream to be pushed into sink */ /* Constructor */ gzip_sink(std::ofstream &wrt) : outifstr_(wrt) { #ifdef DO_NOT_WORK /* Push gzip compressor */ sink_.push(boost::iostreams::gzip_compressor()); /* Push file writer */ sink_.push(outifstr_); #endif } gzip_sink(const gzip_sink &rhs) : outifstr_(rhs.outifstr_) { #ifdef DO_NOT_WORK /* Push gzip compressor */ sink_.push(boost::iostreams::gzip_compressor()); /* Push file writer */ sink_.push(outifstr_); #endif } /* Write function */ std::streamsize write( const char * s, std::streamsize n ) { #ifdef WORKS /* Push gzip compressor */ sink_.push(boost::iostreams::gzip_compressor()); /* Push file writer */ sink_.push(outifstr_); #endif /* Push write stream */ sink_.write(s,n); #ifdef WORKS sink_.pop(); sink_.pop(); #endif return n; } }; /* Typedef */ typedef boost::iostreams::code_converter convert_to_narrow_sink; int main(int argc, char *argv[]) { std::wcout <<"sizeof : "<