$szTitle = "wxdataoutputstream"; include "./_header.inc"; ?>
this class provides functions that write binary data types in a portable way. data can be written in either big-endian or little-endian format, little-endian being the default on all architectures.
if you want to write data to text files (or streams) use wxtextoutputstream instead.
the << operator is overloaded and you can use this class like a standard c++ iostream. see wxdatainputstream for its usage and caveats.
see also wxdatainputstream.
derived from
none
include files
<wx/datstrm.h>
members
wxdataoutputstream::wxdataoutputstream
wxdataoutputstream::~wxdataoutputstream
wxdataoutputstream::bigendianordered
wxdataoutputstream::write8
wxdataoutputstream::write16
wxdataoutputstream::write32
wxdataoutputstream::write64
wxdataoutputstream::writedouble
wxdataoutputstream::writestring
wxdataoutputstream(wxoutputstream& stream)
wxdataoutputstream(wxoutputstream& stream, wxmbconv& conv = wxmbconvutf8)
constructs a datastream object from an output stream. only write methods will be available. the second form is only available in unicode build of wxwidgets.
parameters
stream
conv
~wxdataoutputstream()
destroys the wxdataoutputstream object.
void bigendianordered(bool be_order)
if be_order is true, all data will be written in big-endian order, e.g. for reading on a sparc or from java-streams (which always use big-endian order), otherwise data will be written in little-endian order.
void write8(wxuint8 i8)
writes the single byte i8 to the stream.
void write8(const wxuint8 *buffer, size_t size)
writes an array of bytes to the stream. the amount of bytes to write is specified with the size variable.
void write16(wxuint16 i16)
writes the 16 bit unsigned integer i16 to the stream.
void write16(const wxuint16 *buffer, size_t size)
writes an array of 16 bit unsigned integer to the stream. the amount of 16 bit unsigned integer to write is specified with the size variable.
void write32(wxuint32 i32)
writes the 32 bit unsigned integer i32 to the stream.
void write32(const wxuint32 *buffer, size_t size)
writes an array of 32 bit unsigned integer to the stream. the amount of 32 bit unsigned integer to write is specified with the size variable.
void write64(wxuint64 i64)
writes the 64 bit unsigned integer i64 to the stream.
void write64(const wxuint64 *buffer, size_t size)
writes an array of 64 bit unsigned integer to the stream. the amount of 64 bit unsigned integer to write is specified with the size variable.
void writedouble(double f)
writes the double f to the stream using the ieee format.
void writedouble(const double *buffer, size_t size)
writes an array of double to the stream. the amount of double to write is specified with the size variable.
void writestring(const wxstring&string)
writes string to the stream. actually, this method writes the size of the string before writing string itself.
in ansi build of wxwidgets, the string is written to the stream in exactly same way it is represented in memory. in unicode build, however, the string is first converted to multibyte representation with conv object passed to stream's constructor (consequently, ansi application can read data written by unicode application, as long as they agree on encoding) and this representation is written to the stream. utf-8 is used by default.
include "./_footer.inc"; ?>