wxTextOutputStream

This class provides functions that write text datas using an output stream. So, you can write text floats, integers.

You can also simulate the C++ cout class:

  wxFFileOutputStream output( stderr );
  wxTextOutputStream cout( output );

  cout << "This is a text line" << endl;
  cout << 1234;
  cout << 1.23456;

The wxTextOutputStream writes text files (or streams) on DOS, Macintosh and Unix in their native formats (concerning the line ending).

Include files

<wx/txtstrm.h>



wxTextOutputStream::wxTextOutputStream



wxTextOutputStream(wxOutputStream& stream, wxEOL mode = wxEOL_NATIVE, wxMBConv& conv = wxConvUTF8)

Constructs a text stream object associated to the given output stream.

Parameters

stream
The output stream.

mode
The end-of-line mode. One of wxEOL_NATIVE, wxEOL_DOS, wxEOL_MAC and wxEOL_UNIX.

conv
In Unicode build only: The object used to convert Unicode text into ASCII characters written to the output stream.



wxTextOutputStream::~wxTextOutputStream



~wxTextOutputStream(void)

Destroys the wxTextOutputStream object.



wxTextOutputStream::GetMode



wxEOL GetMode(void)

Returns the end-of-line mode. One of wxEOL_DOS, wxEOL_MAC and wxEOL_UNIX.



wxTextOutputStream::PutChar



void PutChar(w xChar c)

Writes a character to the stream.



wxTextOutputStream::SetMode



void SetMode(w xEOL mode = wxEOL_NATIVE)

Set the end-of-line mode. One of wxEOL_NATIVE, wxEOL_DOS, wxEOL_MAC and wxEOL_UNIX.



wxTextOutputStream::Write8



void Write8(w xUint8 i8)

Writes the single byte i8 to the stream.



wxTextOutputStream::Write16



void Write16(w xUint16 i16)

Writes the 16 bit integer i16 to the stream.



wxTextOutputStream::Write32



void Write32(w xUint32 i32)

Writes the 32 bit integer i32 to the stream.



wxTextOutputStream::WriteDouble



virtual void WriteDouble(d ouble f)

Writes the double f to the stream using the IEEE format.



wxTextOutputStream::WriteString



virtual void WriteString(c onst wxString& string)

Writes string as a line. Depending on the end-of-line mode the end of line ('$\backslash$n') characters in the string are converted to the correct line ending terminator.

ymasuda 平成17年11月19日