Ticket #11521: example.cpp

File example.cpp, 957 bytes (added by anonymous, 7 years ago)
Line 
1void GzipDecompression::Decompress(const unsigned char * src, int length)
2{
3 if(src)
4 {
5 // Create an input-stream source for the data buffer so we can used the boost filtering buffer
6 std::ifstream inputstream;
7 typedef boost::iostreams::basic_array_source<char> Device;
8 boost::iostreams::stream_buffer<Device> buffer((char *)src, length);
9
10 // Inflate using the GZIP filter
11 filtering_streambuf<input> in;
12 in.push(gzip_decompressor());
13 in.push(buffer);
14
15 // Get the result into a vector
16 boost::interprocess::basic_vectorstream<std::vector<char>> vectorStream;
17 copy(in, vectorStream);
18 std::vector<char> output(vectorStream.vector());
19 }
20}
21
22error C2243: 'type cast' : conversion from 'boost::interprocess::basic_vectorstream<CharVector> *' to 'volatile const std::basic_streambuf<_Elem,_Traits> *' exists, but is inaccessible c:\boost\boost_1_55_0\boost\iostreams