]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/datostrm.tex
added wxString::ToLongLong() and ToULongLong() (feature request 1290937)
[wxWidgets.git] / docs / latex / wx / datostrm.tex
CommitLineData
f3845e88
VZ
1\section{\class{wxDataOutputStream}}\label{wxdataoutputstream}
2
3This class provides functions that write binary data types in a
2edb0bde 4portable way. Data can be written in either big-endian or little-endian
f3845e88
VZ
5format, little-endian being the default on all architectures.
6
7If you want to write data to text files (or streams) use
8\helpref{wxTextOutputStream}{wxtextoutputstream} instead.
9
10The << operator is overloaded and you can use this class like a standard
11C++ iostream. See \helpref{wxDataInputStream}{wxdatainputstream} for its
12usage and caveats.
13
14See also \helpref{wxDataInputStream}{wxdatainputstream}.
15
16\wxheading{Derived from}
17
18None
19
0e10e38d
VZ
20\wxheading{Include files}
21
22<wx/datstrm.h>
23
f3845e88
VZ
24\latexignore{\rtfignore{\wxheading{Members}}}
25
f510b7b2 26\membersection{wxDataOutputStream::wxDataOutputStream}\label{wxdataoutputstreamctor}
f3845e88
VZ
27
28\func{}{wxDataOutputStream}{\param{wxOutputStream\&}{ stream}}
29
a99acbb0
VS
30\func{}{wxDataOutputStream}{\param{wxOutputStream\&}{ stream}, \param{wxMBConv\&}{ conv = wxMBConvUTF8}}
31
f3845e88 32Constructs a datastream object from an output stream. Only write methods will
fc2171bd 33be available. The second form is only available in Unicode build of wxWidgets.
f3845e88
VZ
34
35\wxheading{Parameters}
36
37\docparam{stream}{The output stream.}
38
a99acbb0
VS
39\docparam{conv}{Charset conversion object object used to encoding Unicode
40strings before writing them to the stream
41in Unicode mode (see \helpref{wxDataOutputStream::WriteString}{wxdataoutputstreamwritestring}
42documentation for detailed description). Note that you must not destroy
43{\it conv} before you destroy this wxDataOutputStream instance! It is
44recommended to use default value (UTF-8).}
45
f510b7b2 46\membersection{wxDataOutputStream::\destruct{wxDataOutputStream}}\label{wxdataoutputstreamdtor}
f3845e88
VZ
47
48\func{}{\destruct{wxDataOutputStream}}{\void}
49
50Destroys the wxDataOutputStream object.
51
f510b7b2 52\membersection{wxDataOutputStream::BigEndianOrdered}\label{wxdataoutputstreambigendianorder}
f3845e88
VZ
53
54\func{void}{BigEndianOrdered}{\param{bool}{ be\_order}}
55
cc81d32f 56If {\it be\_order} is true, all data will be written in big-endian
f3845e88
VZ
57order, e.g. for reading on a Sparc or from Java-Streams (which
58always use big-endian order), otherwise data will be written in
59little-endian order.
60
f510b7b2 61\membersection{wxDataOutputStream::Write8}\label{wxdataoutputstreamwrite8}
f3845e88
VZ
62
63\func{void}{Write8}{{\param wxUint8 }{i8}}
64
65Writes the single byte {\it i8} to the stream.
66
53663be8
VZ
67\func{void}{Write8}{\param{const wxUint8 *}{buffer}, \param{size\_t }{size}}
68
69Writes an array of bytes to the stream. The amount of bytes to write is
70specified with the {\it size} variable.
71
f510b7b2 72\membersection{wxDataOutputStream::Write16}\label{wxdataoutputstreamwrite16}
f3845e88
VZ
73
74\func{void}{Write16}{{\param wxUint16 }{i16}}
75
4d1cbdbe 76Writes the 16 bit unsigned integer {\it i16} to the stream.
f3845e88 77
53663be8
VZ
78\func{void}{Write16}{\param{const wxUint16 *}{buffer}, \param{size\_t }{size}}
79
80Writes an array of 16 bit unsigned integer to the stream. The amount of
8116 bit unsigned integer to write is specified with the {\it size} variable.
82
f510b7b2 83\membersection{wxDataOutputStream::Write32}\label{wxdataoutputstreamwrite32}
f3845e88
VZ
84
85\func{void}{Write32}{{\param wxUint32 }{i32}}
86
4d1cbdbe
VZ
87Writes the 32 bit unsigned integer {\it i32} to the stream.
88
53663be8
VZ
89\func{void}{Write32}{\param{const wxUint32 *}{buffer}, \param{size\_t }{size}}
90
91Writes an array of 32 bit unsigned integer to the stream. The amount of
9232 bit unsigned integer to write is specified with the {\it size} variable.
93
f510b7b2 94\membersection{wxDataOutputStream::Write64}\label{wxdataoutputstreamwrite64}
4d1cbdbe
VZ
95
96\func{void}{Write64}{{\param wxUint64 }{i64}}
97
98Writes the 64 bit unsigned integer {\it i64} to the stream.
f3845e88 99
53663be8
VZ
100\func{void}{Write64}{\param{const wxUint64 *}{buffer}, \param{size\_t }{size}}
101
102Writes an array of 64 bit unsigned integer to the stream. The amount of
10364 bit unsigned integer to write is specified with the {\it size} variable.
104
f510b7b2 105\membersection{wxDataOutputStream::WriteDouble}\label{wxdataoutputstreamwritedouble}
f3845e88
VZ
106
107\func{void}{WriteDouble}{{\param double }{f}}
108
109Writes the double {\it f} to the stream using the IEEE format.
110
53663be8
VZ
111\func{void}{WriteDouble}{\param{const double *}{buffer}, \param{size\_t }{size}}
112
113Writes an array of double to the stream. The amount of double to write is
114specified with the {\it size} variable.
115
a99acbb0
VS
116\membersection{wxDataOutputStream::WriteString}\label{wxdataoutputstreamwritestring}
117
118\func{void}{WriteString}{{\param const wxString\&}{string}}
f3845e88 119
f3845e88
VZ
120Writes {\it string} to the stream. Actually, this method writes the size of
121the string before writing {\it string} itself.
122
fc2171bd 123In ANSI build of wxWidgets, the string is written to the stream in exactly
a99acbb0
VS
124same way it is represented in memory. In Unicode build, however, the string
125is first converted to multibyte representation with {\it conv} object passed
126to stream's constructor (consequently, ANSI application can read data
127written by Unicode application, as long as they agree on encoding) and this
128representation is written to the stream. UTF-8 is used by default.
ba637f22 129