![]() |
Mangrove
The C++ Object Document Mapper for MongoDB
|
A streambuffer that accepts one or more BSON documents as bytes of BSON data. More...
#include <bson_streambuf.hpp>
Public Member Functions | |
bson_output_streambuf (document_callback cb) | |
Constructs a new BSON Output Streambuffer that passes documents to the given callback function. More... | |
int | overflow (int ch) override |
This function is called when writing to the stream and the buffer is full. More... | |
virtual int | underflow () override |
This function always returns EOF, since one should not write from an output stream. More... | |
A streambuffer that accepts one or more BSON documents as bytes of BSON data.
When a document is complete, it is passed into the user-provided callback. NOTE: This does not perform any validation on the BSON files, and simply uses their first four bytes to judge the document length.
boson::bson_output_streambuf::bson_output_streambuf | ( | document_callback | cb | ) |
Constructs a new BSON Output Streambuffer that passes documents to the given callback function.
cb | A function that takes a document::value and returns void. |
|
override |
This function is called when writing to the stream and the buffer is full.
Since we don't define a buffer, this is called with every character.
ch | The byte of BSON to insert. |
|
overridevirtual |
This function always returns EOF, since one should not write from an output stream.