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