2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: mstream.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxMemoryOutputStream
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxMemoryOutputStream
|
2008-03-08 09:43:31 -05:00
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxbase}
|
|
|
|
@category{streams}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxStreamBuffer
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxMemoryOutputStream : public wxOutputStream
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
If @a data is @NULL, then it will initialize a new empty buffer which will
|
2008-03-08 08:52:38 -05:00
|
|
|
grow if required.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
wxMemoryOutputStream(char* data = NULL, size_t length = 0);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
|
|
|
~wxMemoryOutputStream();
|
|
|
|
|
|
|
|
/**
|
|
|
|
CopyTo allowed you to transfer data from the internal buffer of
|
2008-03-09 08:33:59 -04:00
|
|
|
wxMemoryOutputStream to an external buffer. @a len specifies the size of
|
2008-03-08 08:52:38 -05:00
|
|
|
the buffer.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
size_t CopyTo(char* buffer, size_t len) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the pointer to the stream object used as an internal buffer
|
|
|
|
for that stream.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxStreamBuffer* GetOutputStreamBuffer() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxMemoryInputStream
|
2008-03-08 09:43:31 -05:00
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxbase}
|
|
|
|
@category{streams}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxStreamBuffer, wxMemoryOutputStream
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxMemoryInputStream : public wxInputStream
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Creates a new read-only memory stream, initializing it with the
|
|
|
|
data from the given input stream @e stream.
|
2008-03-09 08:33:59 -04:00
|
|
|
The @a len argument specifies the amount of data to read from
|
2008-03-08 08:52:38 -05:00
|
|
|
the @e stream. Setting it to @e wxInvalidOffset means that
|
2008-03-09 08:33:59 -04:00
|
|
|
the @a stream is to be read entirely (i.e. till the EOF is reached).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
wxMemoryInputStream(const char* data, size_t len);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxMemoryInputStream(const wxMemoryOutputStream& stream);
|
|
|
|
wxMemoryInputStream(wxInputStream& stream,
|
|
|
|
wxFileOffset len = wxInvalidOffset);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
|
|
|
~wxMemoryInputStream();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the pointer to the stream object used as an internal buffer
|
|
|
|
for that stream.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxStreamBuffer* GetInputStreamBuffer() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|