]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/sstream.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxStringInputStream
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
9 @class wxStringInputStream
11 This class implements an input stream which reads data from a string.
17 class wxStringInputStream
: public wxInputStream
21 Creates a new read-only stream using the specified string.
23 Note that the string is copied by the stream so if the original string is
24 modified after using this constructor, changes to it are not reflected
25 when reading from stream.
27 wxStringInputStream(const wxString
& s
);
33 @class wxStringOutputStream
35 This class implements an output stream which writes data either to a
36 user-provided or internally allocated string.
38 Note that currently this stream does not support seeking but can tell
44 class wxStringOutputStream
: public wxOutputStream
48 Construct a new stream object writing the data to a string.
50 If the provided pointer is non-@NULL, data will be written to it.
51 Otherwise, an internal string is used for the data written to this
52 stream, use GetString() to get access to it.
54 If @a str is used, data written to the stream is appended to the current
55 contents of it, i.e. the string is not cleared here. However if it is not
56 empty, the positions returned by wxOutputStream::TellO will be offset by
57 the initial string length, i.e. initial stream position will be the
58 initial length of the string and not 0.
60 Notice that the life time of @a conv must be greater than the life time
61 of this object itself as it stores a reference to it. Also notice that
62 with default value of this argument the data written to the stream must
63 be valid UTF-8, pass @c wxConvISO8859_1 to deal with arbitrary 8 bit data.
65 wxStringOutputStream(wxString
* pString
= 0, wxMBConv
& conv
= wxConvUTF8
);
68 Returns the string containing all the data written to the stream so far.
70 const wxString
& GetString() const;