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-10-11 09:10:48 -04:00
|
|
|
@todo describe me.
|
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-10-11 09:10:48 -04:00
|
|
|
|
|
|
|
@warning
|
|
|
|
If the buffer is created, it will be destroyed at the destruction of the stream.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 09:46:42 -04:00
|
|
|
wxMemoryOutputStream(void* data = NULL, size_t length = 0);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxMemoryOutputStream();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-11 09:10:48 -04:00
|
|
|
Allows you to transfer data from the internal buffer of wxMemoryOutputStream
|
|
|
|
to an external buffer. @a len specifies the size of the buffer.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
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-10-11 09:10:48 -04:00
|
|
|
@todo describe me.
|
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:
|
|
|
|
/**
|
2008-10-11 09:10:48 -04:00
|
|
|
Initializes a new read-only memory stream which will use the specified
|
|
|
|
buffer data of length len. The stream does not take ownership of the buffer,
|
|
|
|
i.e. the buffer will not be deleted in its destructor.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
wxMemoryInputStream(const char* data, size_t len);
|
2008-10-11 09:10:48 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates a new read-only memory stream, initializing it with the data from
|
|
|
|
the given output stream @a stream.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxMemoryInputStream(const wxMemoryOutputStream& stream);
|
2008-10-11 09:10:48 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates a new read-only memory stream, initializing it with the
|
|
|
|
data from the given input stream @a stream.
|
|
|
|
|
|
|
|
The @a len argument specifies the amount of data to read from the
|
|
|
|
@a stream. Setting it to @e wxInvalidOffset means that the @a stream
|
|
|
|
is to be read entirely (i.e. till the EOF is reached).
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxMemoryInputStream(wxInputStream& stream,
|
|
|
|
wxFileOffset len = wxInvalidOffset);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxMemoryInputStream();
|
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* GetInputStreamBuffer() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|