Version: 3.2.5
wxStdOutputStreamBuffer Class Reference

#include <wx/stdstream.h>

+ Inheritance diagram for wxStdOutputStreamBuffer:

Detailed Description

wxStdOutputStreamBuffer is a std::streambuf derived stream buffer which writes to a wxOutputStream.

Example:

wxFFileOutputStream file("cout.txt.gz");
wxZlibOutputStream gzipOutput(file, -1, wxZLIB_GZIP);
wxStdOutputStreamBuffer gzipStreamBuffer(gzipOutput);
// redirect std::cout to cout.txt.gz using GZIP compression
std::streambuf* streamBufferOld = std::cout.rdbuf(&gzipStreamBuffer);
// write to std::cout
std::cout << "Hello world!" << std::endl;
// restore std::cout
std::cout.rdbuf(streamBufferOld);
This class represents data written to a file.
Definition: wfstream.h:118
wxStdOutputStreamBuffer is a std::streambuf derived stream buffer which writes to a wxOutputStream.
Definition: stdstream.h:136
This stream compresses all data written to it.
Definition: zstream.h:44
wxTextOutputStream & endl(wxTextOutputStream &stream)
Writes '\n' to stream.
@ wxZLIB_GZIP
gzip header and checksum, requires zlib 1.2.1+
Definition: zstream.h:21

Library:  wxBase
Category:  Streams
See also
wxOutputStream, wxStdOutputStream

Public Member Functions

 wxStdOutputStreamBuffer (wxOutputStream &stream)
 Creates a std::steambuf derived stream buffer which writes to a wxOutputStream. More...
 
virtual ~wxStdOutputStreamBuffer ()
 Destructor. More...
 

Constructor & Destructor Documentation

◆ wxStdOutputStreamBuffer()

wxStdOutputStreamBuffer::wxStdOutputStreamBuffer ( wxOutputStream stream)

Creates a std::steambuf derived stream buffer which writes to a wxOutputStream.

Parameters
streamStream to write to.

◆ ~wxStdOutputStreamBuffer()

virtual wxStdOutputStreamBuffer::~wxStdOutputStreamBuffer ( )
virtual

Destructor.