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
1 answer

compress multiple files into single file in c++

I searched through the web to find out if there is any effective way to compress multiple files into one single file using either standard library or boost library. the goal is only compression of files, since decompression could be done manually.…
H'H
  • 1,638
  • 1
  • 15
  • 39
1
vote
1 answer

Need help on asynchrous non-blocking file loading with boost::asio and boost::iostreams ( or something different? )

I'm coding in c++, and I'm trying to load an image file asynchronously. After some research, I found some mentions about using boost::asio and boost::iostreams to do it. However, the documentation and example for boost::asio is mostly socket…
Aaron Qian
  • 4,477
  • 2
  • 24
  • 27
1
vote
0 answers

Write compressed data on the fly using boost::iostreams

My naive solution would be as follows: Create a zipping file buffer and add this buffer to a ostream. But in the example code 'output.z' has always a size of 0 byte. #include "boost/iostreams/filtering_streambuf.hpp" #include…
Gert
  • 145
  • 7
1
vote
2 answers

boost xml_iarchive crashes when destructors are called

Im having a bit of trouble trying to figure out why this piece of code would crash when the start the function returns 0; I suspect that when it returns from the start function it calls the destructors for xml_iarchive and it is failing inside…
1
vote
1 answer

Crash when using boost::iostreams

I'm trying to use boost::iostreams(1.53.0) to uncompress a HTTP request body and later process it. But I get a crash when I run the following code. try { using namespace boost::iostreams; ifstream file(argv[1], std::ios_base::in |…
afp
  • 103
  • 7
1
vote
2 answers

compile error on boost::iostreams::copy

I'm trying to learn boost::iostreams by some examples. Here is one of them which can't be accepted by gcc: #include #include #include #include…
user957121
  • 2,946
  • 4
  • 24
  • 36
1
vote
1 answer

in boost iostream filtering_ostream, what is the difference between sync(), strict_sync() and flush()?

considering a simple counting filter: class CountableOstreamFilter : public boost::iostreams::multichar_output_filter { public: CountableOstreamFilter(): m_written(0) { } template std::streamsize write(Sink& dest,…
Aviad Rozenhek
  • 2,259
  • 3
  • 21
  • 42
1
vote
1 answer

Boost.Iostreams vs. iostream/streambuf overloading for bitstream I/O

For my current task I need a possibility to read/write (mostly file based) bitstreams. Though this is a more or less trivial task if coded in standard C/C++ I'd like to rewrite to code using a more generic approach by overloading and using the…
fhw72
  • 1,066
  • 1
  • 11
  • 19
0
votes
1 answer

boost iostreams: output_filter works only once

I am trying to use an boost::iostreams output filter to add a string to the beginning and the end of whatever I stream out. My code below works, but only the first time; the second time, the output seems to get lost somewhere, the write method…
ssc
  • 9,528
  • 10
  • 64
  • 94
0
votes
1 answer

Compiling Boost.Iostream on Linux with custom compiled zlib causes multiple jam errors

So I try to create a script for automated compilation of Boost with Iostream with Zlib support on linux. Currently I have…
myWallJSON
  • 9,110
  • 22
  • 78
  • 149
0
votes
1 answer

How to get around building Boost.Iostreams separatly with zip (gz) support on Windows?

I want to compile such simple code: #include #include #include #include #include #include #include int…
Rella
  • 65,003
  • 109
  • 363
  • 636
0
votes
1 answer

Stream design in c sharp

What would be the best way to design a packing / converting stream proxy in C#? Suppose, I have some input stream and I wish to make something similiar to boost::iostreams does. So, for example, I can zlib packing proxy to the stream, so that when I…
Yippie-Ki-Yay
  • 22,026
  • 26
  • 90
  • 148
0
votes
2 answers

File i/o garbled

The data between these two functions is becoming garbled. Inspecting the variables on each side show that the data is definitely different. The message size signal does work. It's the second read/write function that has the problem. Here is my…
Bluebaron
  • 2,289
  • 2
  • 27
  • 37
0
votes
0 answers

Boost_iostreams usage issue (Not writing to the file)

Usecase: I am trying to write a logging function which writes to a .gz (compressed) file or a non-compressed file based on user input. My code: typedef boost::iostreams::filtering_streambuf
0
votes
1 answer

Boost iostreams input_seekable source

I'm trying to implement a input_seekable source with boost iostreams. The source uses fixed data from a char array. The reading works so far but I'm having a problem with the seek function. The documentation…
Gustavo
  • 919
  • 11
  • 34