
On 7/4/07, eg <egoots@gmail.com> wrote:
Meryl Silverburgh wrote:
Hi,
Can you please tell me how can I use boost iostream with zlib to inflate an byte stream? Where can I find an example?
The library docs have some examples in them. See: http://boost.org/libs/iostreams/doc/index.html
Navigate to the Quick Reference and click on the "basic_zlib_decompressor" filter link. At the bottom of the page you will see an example.
I am having problems in compiling the example in the boost iostreams exmaple: code: #include <fstream> #include <iostream> #include <boost/iostreams/filtering_streambuf.hpp> #include <boost/iostreams/copy.hpp> #include <boost/iostreams/filter/zlib.hpp> int main() { using namespace std; ifstream file("hello.z", ios_base::in | ios_base::binary); filtering_streambuf<input> in; in.push(zlib_decompressor()); in.push(file); boost::iostreams::copy(in, cout); } error: g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/boostTest.d" -MT"src/boostTest.d" -o"src/boostTest.o" "../src/boostTest.cpp" ../src/boostTest.cpp:18:2: warning: no newline at end of file ../src/boostTest.cpp: In function 'int main()': ../src/boostTest.cpp:13: error: 'filtering_streambuf' was not declared in this scope ../src/boostTest.cpp:13: error: 'input' was not declared in this scope ../src/boostTest.cpp:13: error: 'in' was not declared in this scope ../src/boostTest.cpp:14: error: 'zlib_decompressor' was not declared in this scope make: *** [src/boostTest.o] Error 1
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users