]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/sstream.h
Moved list of subclasses away from 'classes overview' corrected some wxGrid overview...
[wxWidgets.git] / interface / wx / sstream.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: sstream.h
e54c96f1 3// Purpose: interface of wxStringInputStream
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxStringInputStream
7c913512 11
23324ae1
FM
12 This class implements an input stream which reads data from a string. It
13 supports seeking.
7c913512 14
23324ae1
FM
15 @library{wxbase}
16 @category{streams}
17*/
18class wxStringInputStream : public wxInputStream
19{
20public:
21 /**
22 Creates a new read-only stream using the specified string. Note that the string
23 is copied by the stream so if the original string is modified after using this
24 constructor, changes to it are not reflected when reading from stream.
25 */
26 wxStringInputStream(const wxString& s);
27};
28
29
e54c96f1 30
23324ae1
FM
31/**
32 @class wxStringOutputStream
7c913512 33
23324ae1
FM
34 This class implements an output stream which writes data either to a
35 user-provided or internally allocated string. Note that currently this stream
36 does not support seeking but can tell its current position.
7c913512 37
23324ae1
FM
38 @library{wxbase}
39 @category{streams}
40*/
41class wxStringOutputStream : public wxOutputStream
42{
43public:
44 /**
63482fd5
VZ
45 Construct a new stream object writing the data to a string.
46
23324ae1 47 If the provided pointer is non-@NULL, data will be written to it.
63482fd5
VZ
48 Otherwise, an internal string is used for the data written to this
49 stream, use GetString() to get access to it.
50
4cc4bfaf 51 If @a str is used, data written to the stream is appended to the current
23324ae1
FM
52 contents of it, i.e. the string is not cleared here. However if it is not
53 empty, the positions returned by wxOutputStream::TellO will be
54 offset by the initial string length, i.e. initial stream position will be the
55 initial length of the string and not 0.
63482fd5
VZ
56
57 Notice that the life time of @a conv must be greater than the life time
58 of this object itself as it stores a reference to it. Also notice that
59 with default value of this argument the data written to the stream must
60 be valid UTF-8, pass @c wxConvISO8859_1 to deal with arbitrary 8 bit
61 data.
23324ae1 62 */
63482fd5 63 wxStringOutputStream(wxString str = NULL, wxMBConv& conv = wxConvUTF8);
23324ae1
FM
64
65 /**
66 Returns the string containing all the data written to the stream so far.
67 */
63482fd5 68 const wxString& GetString() const;
23324ae1 69};
e54c96f1 70