]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/txtstrm.tex
If somebody ever decides to actually check in fsfile.tex and
[wxWidgets.git] / docs / latex / wx / txtstrm.tex
1 % ----------------------------------------------------------------------------
2 % wxTextInputStream
3 % ----------------------------------------------------------------------------
4 \section{\class{wxTextInputStream}}\label{wxtextinputstream}
5
6 This class provides functions that read text datas using an input stream.
7 So, you can read \it{text} floats, integers.
8
9 Operator >> is overloaded and you can use this class a C++ std-iostream.
10
11 For example:
12 \begin{verbatim}
13 wxTextInputStream text( input );
14 wxUint8 i1;
15 float f2;
16 wxString line;
17
18 text >> i1; // read a 8 bit integer.
19 text >> i1 >> f2; // read a 8 bit integer followed by float.
20 text >> line; // read a text line
21 \end{verbatim}
22
23 \wxheading{Include files}
24
25 <wx/txtstrm.h>
26
27 \latexignore{\rtfignore{\wxheading{Members}}}
28
29 \membersection{wxTextInputStream::wxTextInputStream}\label{wxtextinputstreamconstr}
30
31 \func{}{wxTextInputStream}{\param{wxInputStream\&}{ stream}}
32
33 Constructs a text stream object from an input stream. Only read methods will
34 be available.
35
36 \wxheading{Parameters}
37
38 \docparam{stream}{The input stream.}
39
40 \membersection{wxTextInputStream::\destruct{wxTextInputStream}}
41
42 \func{}{\destruct{wxTextInputStream}}{\void}
43
44 Destroys the wxTextInputStream object.
45
46 \membersection{wxTextInputStream::Read8}
47
48 \func{unsigned char}{Read8}{\void}
49
50 Reads a single byte from the stream.
51
52 \membersection{wxTextInputStream::Read16}
53
54 \func{unsigned short}{Read16}{\void}
55
56 Reads a 16 bit integer from the stream.
57
58 \membersection{wxTextInputStream::Read32}
59
60 \func{unsigned long}{Read32}{\void}
61
62 Reads a 32 bit integer from the stream.
63
64 \membersection{wxTextInputStream::ReadDouble}
65
66 \func{double}{ReadDouble}{\void}
67
68 Reads a double (IEEE encoded) from the stream.
69
70 \membersection{wxTextInputStream::ReadString}
71
72 \func{wxString}{wxTextInputStream::ReadString}{\void}
73
74 Reads a line from the stream. A line is a string which ends with
75 $\backslack$n or $\backslash$r$\backslash$n or $\backslash$r.
76
77 % ----------------------------------------------------------------------------
78 % wxTextOutputStream
79 % ----------------------------------------------------------------------------
80
81 \section{\class{wxTextOutputStream}}\label{wxtextoutputstream}
82
83 This class provides functions that write text datas using an output stream.
84 So, you can write \it{text} floats, integers.
85
86 For example:
87 \begin{verbatim}
88 wxTextOutputStream text( output );
89
90 output << "This is a text line\n";
91 output << 1234;
92 output << 1.23456;
93 \end{verbatim}
94
95 \latexignore{\rtfignore{\wxheading{Members}}}
96
97 \membersection{wxTextOutputStream::wxTextOutputStream}\label{wxdataoutputstreamconstr}
98
99 \func{}{wxTextOutputStream}{\param{wxOutputStream\&}{ stream}}
100
101 Constructs a text stream object from an output stream. Only write methods will
102 be available.
103
104 \wxheading{Parameters}
105
106 \docparam{stream}{The output stream.}
107
108 \membersection{wxTextOutputStream::\destruct{wxTextOutputStream}}
109
110 \func{}{\destruct{wxTextOutputStream}}{\void}
111
112 Destroys the wxTextOutputStream object.
113
114 \membersection{wxTextOutputStream::Write8}
115
116 \func{void}{wxTextOutputStream::Write8}{{\param unsigned char }{i8}}
117
118 Writes the single byte {\it i8} to the stream.
119
120 \membersection{wxTextOutputStream::Write16}
121
122 \func{void}{wxTextOutputStream::Write16}{{\param unsigned short }{i16}}
123
124 Writes the 16 bit integer {\it i16} to the stream.
125
126 \membersection{wxTextOutputStream::Write32}
127
128 \func{void}{wxTextOutputStream::Write32}{{\param unsigned long }{i32}}
129
130 Writes the 32 bit integer {\it i32} to the stream.
131
132 \membersection{wxTextOutputStream::WriteDouble}
133
134 \func{void}{wxTextOutputStream::WriteDouble}{{\param double }{f}}
135
136 Writes the double {\it f} to the stream using the IEEE format.
137
138 \membersection{wxTextOutputStream::WriteString}
139
140 \func{void}{wxTextOutputStream::WriteString}{{\param const wxString\& }{string}}
141
142 Writes {\it string} as a line. Depending on the operating system, it adds
143 $\backslash$n or $\backslash$r$\backslash$n.