Questions tagged [boost-iostreams]

Boost.Iostreams is a C++ framework for defining streams, stream buffers and I/O filters.

Boost.Iostreams has three aims:

  • To make it easy to create standard C++ streams and stream buffers for accessing new Sources and Sinks.
  • To provide a framework for defining Filters and attaching them to standard streams and stream buffers.
  • To provide a collection of ready-to-use Filters, Sources and Sinks.

For example, Boost.Iostreams can be used to create streams to access TCP connections or as a framework for cryptography and data compression. The library includes components for accessing memory-mapped files, for file access using operating system file descriptors, for code conversion, for text filtering with regular expressions, for line-ending conversion and for compression and decompression in the zlib, gzip and bzip2 formats.

160 questions
1
vote
0 answers

Boost::iostreams linker error, can not find zlib

I am trying to build my C++ project with Boost::iostreams and I get the following linker error: undefined reference to `boost::iostreams::zlib::deflated' I checked that my cmake was able to find the boost libraries: -- Boost version: 1.65.0 --…
motam79
  • 3,542
  • 5
  • 34
  • 60
1
vote
2 answers

C++ Boost-iostream: mysterious error when including filtering_streambuf.hpp

I have been using the boost iostream library (version 1.65) mostly using following header: , with no problems. After I added another library called cpprest to my…
motam79
  • 3,542
  • 5
  • 34
  • 60
1
vote
1 answer

boost zlib filter doesn't works in windows

I have written a code to read a .z compressed file directly. It works fine in linux and mac os. But it doesn't work as expected in windows. #include #include #include #include…
srbcheema1
  • 544
  • 4
  • 16
1
vote
2 answers

boost::iostreams sink device: Why does this trivial test code crash?

I'm trying to get familiar with using boost::iostreams. Looking at the iostreams tutorial, it seems this test code ought to be a trivial implementation of a sink device and the stream template: #include #include #include…
E. Hildum
  • 11
  • 1
1
vote
1 answer

convert boost::iostream::stream to std::istream

I would like to expose streams in my code as their standard equivalents to eliminate user dependency on boost::iostreams. Would like to do this efficiently of course without creating a copy if necessary. I thought about just setting the…
Francisco Aguilera
  • 3,099
  • 6
  • 31
  • 57
1
vote
1 answer

undefined reference to boost::iostreams::mapped_file_source::init() using CMake

Linking error on minimal example with Boost Iostreams. Looks like I have not linked with libboost_iostream, however CMake reports that library is found and other applications with Boost compile and link without any problems. Using Cmake for…
user707779
1
vote
1 answer

decompress multiple files in to one single file using boost

I have set of compressed files. I have to decompress all the files and create one big file. below code is working fine, but I don't want to use std::stringstream because the files are big and I don't want to create intermediate copies of the file…
Dinesh Reddy
  • 775
  • 1
  • 11
  • 25
1
vote
2 answers

Create class using internal vector member as the container for stream access to class instances

Appreciation in advance for the time of anyone who is willing to look at this. I'd like to make a simple class that allows all stream interfaces, but only reads/writes to a simple std::vector stored in the class. It seems to me after trying to…
rveale
  • 66
  • 1
  • 10
1
vote
2 answers

exceptions from boost::iostreams::copy()

In the below code, I have a corrupt "hello.bz2" which has stray characters beyond the EOF. Is there a way to make the boost::iostreams::copy() call to throw ? #include #include #include…
ϹοδεMεδιϲ
  • 2,790
  • 3
  • 33
  • 54
1
vote
1 answer

boost::iostream bzip2_decompressor not decompressing file compressed by bzip2_compressor

boost::iostream bzip2_decompressor not decompressing file compressed by bzip2_compressor
Hiesenberg
  • 415
  • 1
  • 8
  • 12
1
vote
1 answer

How do I handle opening and closing a boost iostreams Device?

I have defined a boost Device called ZipFileDevice, that takes in an archive path, and a path to a file within that archive. The Device defines read, write, seek, a costructor that takes the two paths, and a destructor. I am opening the zip file in…
1
vote
1 answer

How to disable boost::iostreams buffer when reading through a filter chain

I have some code that looks approximately like this: boost::iostreams::filtering_istreambuf in; in.push(Lz4DecompressionFilter()); in.push(AesDecryptionFilter()); in.push(file_source("somefile")); I already have meta-data that stores the length of…
user1202136
  • 11,171
  • 4
  • 41
  • 62
1
vote
1 answer

How does the read function in boost::iostreams::source actually work?

I'm studying boost::iostreams, and i am trying to write my own source device. I wrote two versions of boost::source. In the first version, I simply copy the time string to s, and it worked. But in the second version, I copy a specific string, it…
prehawk
  • 195
  • 12
1
vote
3 answers

Compressing/decompressing gzip into memory with boost

I'll be brief: I have this piece of code: QByteArray MyNBT::decompressData(QByteArray data) { filtering_streambuf in; std::string _data = data.data(); in.push( gzip_decompressor() ); in.push(…
azteca1998
  • 152
  • 3
  • 10
1
vote
0 answers

Can I "push" a boost::iterator onto a boost iostream

I managed to get working: 1) a base 64 encoder/decoder using boost::archive::iterators derived from Base64 encode using boost throw exception 2) a compressor using boost::iostreams as shown here: boost zlib problem So code the looks like…
RED SOFT ADAIR
  • 12,032
  • 10
  • 54
  • 92