|
pdfmm 0.9.20
|
#include <PdfOutputStream.h>
Public Member Functions | |
| PdfMemoryOutputStream (size_t initialSize=INITIAL_SIZE) | |
| PdfMemoryOutputStream (char *buffer, size_t len) | |
| void | Close () override |
| size_t | GetLength () const |
| std::unique_ptr< char[]> | TakeBuffer (size_t &length) |
Public Member Functions inherited from mm::PdfOutputStream | |
| void | Write (const char *buffer, size_t len) |
| void | Write (const std::string_view &view) |
| virtual void | Close ()=0 |
An output stream that writes data to a memory buffer If the buffer is to small, it will be enlarged automatically.
| PdfMemoryOutputStream::PdfMemoryOutputStream | ( | size_t | initialSize = INITIAL_SIZE | ) |
Construct a new PdfMemoryOutputStream
| lInitial | initial size of the buffer |
| PdfMemoryOutputStream::PdfMemoryOutputStream | ( | char * | buffer, |
| size_t | len | ||
| ) |
Construct a new PdfMemoryOutputStream that writes to an existing buffer
| buffer | handle to the buffer |
| len | length of the buffer |
|
overridevirtual |
Close the PdfOutputStream. This method may throw exceptions and has to be called before the destructor to end writing.
No more data may be written to the output device after calling close.
Implements mm::PdfOutputStream.
|
inline |
| unique_ptr< char[]> PdfMemoryOutputStream::TakeBuffer | ( | size_t & | length | ) |
The internal buffer is now owned by the caller and will not be deleted by PdfMemoryOutputStream. Further calls to Write() are not allowed.
The caller has to free() the returned malloc()'ed buffer!