Version: 2.9.4
Public Member Functions
wxBufferedOutputStream Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/stream.h>

Inheritance diagram for wxBufferedOutputStream:

Detailed Description

This stream acts as a cache.

It caches the bytes to be written to the specified output stream (See wxFilterOutputStream). The data is only written when the cache is full, when the buffered stream is destroyed or when calling SeekO().

This class may not be used without some other stream to write the data to (such as a file stream or a memory stream).

Library:  wxBase
Category:  Streams
参照:
wxStreamBuffer, wxOutputStream

Public Member Functions

 wxBufferedOutputStream (wxOutputStream &stream, wxStreamBuffer *buffer=NULL)
 Constructor using the provided buffer or default.
 wxBufferedOutputStream (wxOutputStream &stream, size_t bufsize)
 Constructor allowing to specify the size of the buffer.
virtual ~wxBufferedOutputStream ()
 Destructor.
virtual wxFileOffset SeekO (wxFileOffset pos, wxSeekMode mode=wxFromStart)
 Calls Sync() and changes the stream position.
virtual void Sync ()
 Flushes the buffer and calls Sync() on the parent stream.

List of all members.


Constructor & Destructor Documentation

wxBufferedOutputStream::wxBufferedOutputStream ( wxOutputStream stream,
wxStreamBuffer buffer = NULL 
)

Constructor using the provided buffer or default.

Parameters:
streamThe associated low-level stream.
bufferThe buffer to use if non-NULL. Notice that the ownership of this buffer is taken by the stream, i.e. it will delete it. If this parameter is NULL a default 1KB buffer is used.
wxBufferedOutputStream::wxBufferedOutputStream ( wxOutputStream stream,
size_t  bufsize 
)

Constructor allowing to specify the size of the buffer.

This is just a more convenient alternative to creating a wxStreamBuffer of the given size and using the other overloaded constructor of this class.

Parameters:
streamThe associated low-level stream.
bufsizeThe size of the buffer, in bytes.
Since:
2.9.0
virtual wxBufferedOutputStream::~wxBufferedOutputStream ( ) [virtual]

Destructor.

Calls Sync() and destroys the internal buffer.


Member Function Documentation

virtual wxFileOffset wxBufferedOutputStream::SeekO ( wxFileOffset  pos,
wxSeekMode  mode = wxFromStart 
) [virtual]

Calls Sync() and changes the stream position.

Reimplemented from wxOutputStream.

virtual void wxBufferedOutputStream::Sync ( ) [virtual]

Flushes the buffer and calls Sync() on the parent stream.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines