]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/txtstrm.tex
Small distrib updates,
[wxWidgets.git] / docs / latex / wx / txtstrm.tex
CommitLineData
a3c1786d
GL
1% ----------------------------------------------------------------------------
2% wxTextInputStream
3% ----------------------------------------------------------------------------
4\section{\class{wxTextInputStream}}\label{wxtextinputstream}
5
6This class provides functions that read text datas using an input stream.
7So, you can read \it{text} floats, integers.
8
9Operator >> is overloaded and you can use this class a C++ std-iostream.
10
11For 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
33Constructs a text stream object from an input stream. Only read methods will
34be 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
44Destroys the wxTextInputStream object.
45
46\membersection{wxTextInputStream::Read8}
47
48\func{unsigned char}{Read8}{\void}
49
50Reads a single byte from the stream.
51
52\membersection{wxTextInputStream::Read16}
53
54\func{unsigned short}{Read16}{\void}
55
56Reads a 16 bit integer from the stream.
57
58\membersection{wxTextInputStream::Read32}
59
60\func{unsigned long}{Read32}{\void}
61
62Reads a 32 bit integer from the stream.
63
64\membersection{wxTextInputStream::ReadDouble}
65
66\func{double}{ReadDouble}{\void}
67
68Reads a double (IEEE encoded) from the stream.
69
70\membersection{wxTextInputStream::ReadString}
71
72\func{wxString}{wxTextInputStream::ReadString}{\void}
73
74Reads 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
83This class provides functions that write text datas using an output stream.
84So, you can write \it{text} floats, integers.
85
86For 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
101Constructs a text stream object from an output stream. Only write methods will
102be 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
112Destroys the wxTextOutputStream object.
113
114\membersection{wxTextOutputStream::Write8}
115
116\func{void}{wxTextOutputStream::Write8}{{\param unsigned char }{i8}}
117
118Writes the single byte {\it i8} to the stream.
119
120\membersection{wxTextOutputStream::Write16}
121
122\func{void}{wxTextOutputStream::Write16}{{\param unsigned short }{i16}}
123
124Writes 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
130Writes the 32 bit integer {\it i32} to the stream.
131
132\membersection{wxTextOutputStream::WriteDouble}
133
134\func{void}{wxTextOutputStream::WriteDouble}{{\param double }{f}}
135
136Writes 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
142Writes {\it string} as a line. Depending on the operating system, it adds
143$\backslash$n or $\backslash$r$\backslash$n.