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

How to prevent iostreams::mapped_file_sink from creating executable txt files

EDIT: code sample is broken, it is missing .is_open(), please DON'T use it. I have a rather strange question. I use boost iostreams and they work awesome, but the problem is that files that program creates are executable txt files(I'm on ubuntu,msg…
NoSenseEtAl
  • 28,205
  • 28
  • 128
  • 277
2
votes
0 answers

Implementing a FUSE Filesystem: iostream, FILE* or plain file descriptors?

I implemented a small read-only FUSE filesystem in C++ that reads the data from a certain multi-file archive. I used iostreams (actually boost::filesystem::ifstream) in order to read the files. Now I wonder if that was a wise decision. First the…
panzi
  • 7,517
  • 5
  • 42
  • 54
2
votes
1 answer

Using boost filtering_streambuf on large data

I'm trying to compress some data using boost gzip compression via filtering_streambuf. The compressed version is then written to disc. The problem is the data is over 10GB in size and I believe stringstream is running out of space. Assuming I can…
2
votes
1 answer

C++ getline() with boost::iostreams::filtering_istream works strange

Please, help me to understand the reasons for the difference in the behavior of the following program. The program creates a test text file and a chain of boost filters (filtering_istream) from one source and one filter. Then it tries to read some…
snake_style
  • 1,139
  • 7
  • 16
2
votes
2 answers

boost iostream problem

I'm trying to decompress a gzip'd string inside boost using the following code std::string DecompressString(const std::string &compressedString) { std::stringstream src(compressedString); if (src.good()) { …
Megatron
  • 2,871
  • 4
  • 40
  • 58
2
votes
1 answer

boost zlib problem

I'm having a problem with the zlib libraries in boost under VS 2010. I built the libraries and the appropriate dlls/libs were generated in the boost/stage/lib folder. I added the .dlls into my programs debug folder and linked in the matching.lib.…
Megatron
  • 2,871
  • 4
  • 40
  • 58
2
votes
0 answers

Boost Iostreams vs Boost Interprocess for mapping a file

I see there are two ways to memory-map a file in Boost: boost::iostreams::mapped_file_source boost::interprocess::mapped_region I understand the latter is intended towards sharing a memory-mapped file across multiple processes. Does this mean…
user997112
  • 29,025
  • 43
  • 182
  • 361
2
votes
1 answer

Boost::iostreams::filtering_istreams waiting for E.O.F

I am to use filtering_istream as a wrapper around std::cin. but it is not working as I expected. It is waiting for the E.O.F please help me to understand the behaviour. #include #include // compile…
srbcheema1
  • 544
  • 4
  • 16
2
votes
0 answers

Read simple/bz2-compressed-file(line by line) by detecting it is compressed or not (size of file is large)

I wrote a code to read simple-text/bz2-compressed-file. I used magic-characters of bz2 file to detect the file is compressed or not NOTE "user may or may not provide file with proper extension" my code #include #include…
mr_beginner
  • 145
  • 1
  • 9
2
votes
1 answer

How to decompress the data in boost::asio::streambuf using boost::iostreams:filtering_istream?

I'm trying to decompress zlib compressed data that are received from boost asio socket. (version 1.64.0) I use boost::asio::streambuf as the receive buffer and boost::iostreams::filtering_istream to decompress. If I send a compressed data all at…
Takatoshi Kondo
  • 3,111
  • 17
  • 36
2
votes
1 answer

Working with streams with Boost

I have some *.bz2 file, that contains *.csv text file. I need to process it - to unpack it and to change encoding of it. Now I have code, that unpacks this file and changes *.csv file encoding by reading original file to another one. But I "got…
Arthur
  • 3,253
  • 7
  • 43
  • 75
2
votes
1 answer

Unexpected behavior with boost::streams::output filter

I'm trying to implement an output filter for logging and have modified some example code with unexpected results. The code is #include // toupper #include //…
HankB
  • 332
  • 4
  • 17
2
votes
2 answers

QT Linker errors with boost iostreams

I am trying to compile a Qt 5.5 application using msvc2010. However whenever I try to build it I get several linker errors all relating to boost::iostreams. packagehandler.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall…
Birdfriender
  • 343
  • 1
  • 7
  • 24
2
votes
1 answer

using an boost::iostreams::array_sink with a boost::array

The example (reproduced below from here) shows that, using a stream of array_sink, I can get output stream functionality on a char array. #include #include #include using…
stack user
  • 835
  • 1
  • 9
  • 28
2
votes
1 answer

How can you disable the buffer in a boost::iostreams sink?

I've written a 'sink' using boost::iostreams, so that I can essentially have my own code run when someone tries to write to an iostream object. Unfortunately there is a buffer somewhere in the system, so that my Sink's write() function only gets…
Malvineous
  • 25,144
  • 16
  • 116
  • 151