X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..76b92fa5c75d542c44dcccd551e432fbad660fda:/interface/wx/datstrm.h diff --git a/interface/wx/datstrm.h b/interface/wx/datstrm.h index 3a0629dba9..f570c3eec4 100644 --- a/interface/wx/datstrm.h +++ b/interface/wx/datstrm.h @@ -3,12 +3,11 @@ // Purpose: interface of wxDataInputStream and wxDataOutputStream // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @class wxDataOutputStream - @wxheader{datstrm.h} 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, @@ -29,29 +28,22 @@ class wxDataOutputStream { public: /** - Constructs a datastream object from an output stream. Only write - methods will be available. + Constructs a datastream object from an output stream. + Only write methods will be available. - @param stream - The output stream. - */ - wxDataOutputStream(wxOutputStream& stream); - /** - Constructs a datastream object from an output stream. Only write - methods will be available. This constructor is only available in - Unicode builds of wxWidgets. + Note that the @a conv parameter is only available in Unicode builds of wxWidgets. @param stream The output stream. @param conv - Charset conversion object object used to encoding Unicode strings + Charset conversion object used to encoding Unicode strings before writing them to the stream in Unicode mode (see WriteString() for a detailed description). Note that you must not destroy @a conv before you destroy this wxDataOutputStream instance! It is recommended to use the default value (UTF-8). */ wxDataOutputStream(wxOutputStream& stream, - const wxMBConv& conv = wxConvAuto()); + const wxMBConv& conv = wxConvUTF8); /** Destroys the wxDataOutputStream object. @@ -65,7 +57,18 @@ public: order. */ void BigEndianOrdered(bool be_order); + + /** + Returns the current text conversion class used for + writing strings. + */ + wxMBConv *GetConv() const; + /** + Sets the text conversion class used for writing strings. + */ + void SetConv( const wxMBConv &conv ); + /** Writes the single byte @a i8 to the stream. */ @@ -135,7 +138,6 @@ public: /** @class wxDataInputStream - @wxheader{datstrm.h} This class provides functions that read binary data types in a portable way. Data can be read in either big-endian or little-endian format, @@ -174,28 +176,21 @@ class wxDataInputStream { public: /** - Constructs a datastream object from an input stream. Only read methods - will be available. + Constructs a datastream object from an input stream. + Only read methods will be available. - @param stream - The input stream. - */ - wxDataInputStream(wxInputStream& stream); - /** - Constructs a datastream object from an input stream. Only read methods - will be available. This constructor is only available in Unicode builds - of wxWidgets. + Note that the @a conv parameter is only available in Unicode builds of wxWidgets. @param stream The input stream. @param conv - Charset conversion object object used to decode strings in Unicode + Charset conversion object used to decode strings in Unicode mode (see ReadString() for a detailed description). Note that you must not destroy @a conv before you destroy this wxDataInputStream instance! */ wxDataInputStream(wxInputStream& stream, - const wxMBConv& conv = wxConvAuto()); + const wxMBConv& conv = wxConvUTF8 ); /** Destroys the wxDataInputStream object. @@ -209,6 +204,13 @@ public: */ void BigEndianOrdered(bool be_order); + + /** + Returns the current text conversion class used for + reading strings. + */ + wxMBConv *GetConv() const; + /** Reads a single byte from the stream. */ @@ -270,11 +272,16 @@ public: In Unicode build of wxWidgets, the fuction first reads multibyte (char*) string from the stream and then converts it to Unicode using the @e conv object passed to constructor and returns the result as - wxString. You are responsible for using the same convertor as when + wxString. You are responsible for using the same converter as when writing the stream. @see wxDataOutputStream::WriteString() */ wxString ReadString(); + + /** + Sets the text conversion class used for reading strings. + */ + void SetConv( const wxMBConv &conv ); };