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

Boost.IOStreams: How to correctly redirect file streams with 'rdbuf'?

I cannot possibly find explanation for the following behavior: #include #include #include #include TEST_CASE(rdbuf) { { …
Alexander Shukaev
  • 16,674
  • 8
  • 70
  • 85
0
votes
0 answers

Boost.IOStreams: 'file_descriptor_sink' accepts empty string as pathname; should I guard against that?

I develop a library that internally uses Boost.IOStreams. Recently, I hit an interesting corner case with file_descriptor_sink. It looks like doing file_descriptor_sink s(""); or file_descriptor_sink s; s.open(""); is perfectly valid and…
Alexander Shukaev
  • 16,674
  • 8
  • 70
  • 85
0
votes
1 answer

Change boost_zlib DLL name when compiling iostreams library in Boost?

I'm compiling the iostreams library in Boost in Windows. It appears that it creates a boost_zlib*.dll file automatically. I want to create two versions of the iostreams .lib and .dll files with separate names for both 32 and 64 bits to put into the…
Ionian316
  • 2,303
  • 2
  • 28
  • 36
0
votes
1 answer

How to declare an "implicit conversion" in a variadic template?

My aim is to send a data to several streams. It is possible by using boost::tee. But I want to write a wrapper with variadic template for using several streams. The problem is that I need an implicit convertation from descendant struct to ancestor…
ged
  • 687
  • 7
  • 19
0
votes
1 answer

how to open a boost iostream memory map for both read and write

I am newbie to boost::iostream memory mapped file and I am having some difficulties in understanding the classes. I would like my function to create a new memory map file for writing and reading. I was successful for the writing part but I don't…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
1 answer

C++11 boost::iostreams::filtering_stream deletion

I have some data that I want to format and output, either in raw text file or .gz compressed text file. Thus, I wanted to do something like this : shared_ptr file = make_shared(filename.c_str()); shared_ptr stream; if…
bomzh
  • 101
  • 2
0
votes
1 answer

boost iostreaming filter gets empty values

I tried to build a stream buffer for reading and writing char* using boost::iostreams: class MemBuf : public std::streambuf { public: MemBuf(char* s, std::size_t n) { setg(s, s, (char*)s+ n); } }; reading works fine: char…
Steve
  • 1,072
  • 11
  • 28
0
votes
1 answer

Using boost::stream for more complex/structuered types then chars?

is it possible to use boost::iostreams for more complex / structured types? What I want to do is to stream images but they should have some annotations like width, height, color depth,... My first idea is to use a struct instead of an char or an…
Steve
  • 1,072
  • 11
  • 28
0
votes
2 answers

boost::iostreams reading from source device

I've been trying to get my head around the iostreams library by boost. But i cant really fully grasp the concepts. Say i have the following class: Pseudocode: The below code is only to illustrate the problem. Edit: removed the read code because it…
0
votes
1 answer

boost::iostreams::mapped_file file path issue

I ran into an issue using the mapped_file iostreams library of boost. boost documentation : mapped_file After reading through all the documentation and examples I could read, I still can't get the following piece of code to work . I assume that…
Lex
  • 413
  • 1
  • 7
  • 19
1 2 3
10
11