use const wxMBConv& instead of wxMBConv& in public methods so that it's possible to pass in temporary objects;

don't use global wxConvUTF8 object internally, it may be unavailable at static objects destruction time


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-05-11 20:55:24 +00:00
parent 163d9efc6b
commit 5487ff0f50
16 changed files with 45 additions and 42 deletions

View File

@@ -353,7 +353,7 @@ The following functions control this option:
\param{const wxString\& }{localFilename = wxEmptyString},
\param{const wxString\& }{globalFilename = wxEmptyString},
\param{long}{ style = 0},
\param{wxMBConv\&}{ conv = wxConvUTF8}}
\param{const wxMBConv\&}{ conv = wxConvAuto()}}
This is the default and only constructor of the wxConfigBase class, and
derived classes.

View File

@@ -43,7 +43,7 @@ None
\func{}{wxDataInputStream}{\param{wxInputStream\&}{ stream}}
\func{}{wxDataInputStream}{\param{wxInputStream\&}{ stream}, \param{wxMBConv\&}{ conv = wxMBConvUTF8}}
\func{}{wxDataInputStream}{\param{wxInputStream\&}{ stream}, \param{const wxMBConv\&}{ conv = wxConvAuto()}}
Constructs a datastream object from an input stream. Only read methods will
be available. The second form is only available in Unicode build of wxWidgets.

View File

@@ -27,7 +27,7 @@ None
\func{}{wxDataOutputStream}{\param{wxOutputStream\&}{ stream}}
\func{}{wxDataOutputStream}{\param{wxOutputStream\&}{ stream}, \param{wxMBConv\&}{ conv = wxMBConvUTF8}}
\func{}{wxDataOutputStream}{\param{wxOutputStream\&}{ stream}, \param{const wxMBConv\&}{ conv = wxConvAuto(){}
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.

View File

@@ -210,7 +210,7 @@ The number of bytes read.
\membersection{wxFFile::ReadAll}\label{wxffilereadall}
\func{bool}{ReadAll}{\param{wxString *}{ str}, \param{wxMBConv\&}{ conv = wxConvUTF8}}
\func{bool}{ReadAll}{\param{wxString *}{ str}, \param{const wxMBConv\&}{ conv = wxConvAuto()}}
Reads the entire contents of the file into a string.
@@ -277,7 +277,7 @@ Number of bytes written.
\membersection{wxFFile::Write}\label{wxffilewrites}
\func{bool}{Write}{\param{const wxString\& }{s}, \param{wxMBConv\&}{ conv = wxConvUTF8}}
\func{bool}{Write}{\param{const wxString\& }{s}, \param{const wxMBConv\&}{ conv = wxConvAuto()}}
Writes the contents of the string to the file, returns \true on success.

View File

@@ -335,7 +335,7 @@ the number of bytes actually written
\membersection{wxFile::Write}\label{wxfilewrites}
\func{bool}{Write}{\param{const wxString\& }{s}, \param{wxMBConv\&}{ conv = wxConvUTF8}}
\func{bool}{Write}{\param{const wxString\& }{s}, \param{const wxMBConv\&}{ conv = wxConvUTF8}}
Writes the contents of the string to the file, returns true on success.

View File

@@ -34,7 +34,7 @@ Windows.
\membersection{wxFileConfig::wxFileConfig}\label{wxfileconfigctor}
\func{}{wxFileConfig}{\param{wxInputStream\& }{is}, \param{wxMBConv\& }{conv = wxConvUTF8}}
\func{}{wxFileConfig}{\param{wxInputStream\& }{is}, \param{const wxMBConv\& }{conv = wxConvAuto()}}
Read the config data from the specified stream instead of the associated file,
as usual.
@@ -72,7 +72,7 @@ path name.
\membersection{wxFileConfig::Save}\label{wxfileconfigsave}
\func{bool}{Save}{\param{wxOutputStream\& }{os}, \param{wxMBConv\& }{conv = wxConvUTF8}}
\func{bool}{Save}{\param{wxOutputStream\& }{os}, \param{const wxMBConv\& }{conv = wxConvAuto()}}
Saves all config data to the given stream, returns \true if data was saved
successfully or \false on error.

View File

@@ -107,7 +107,7 @@ Write to the file, return {\tt true} on success, {\tt false} on failure.
\membersection{wxTempFile::Write}\label{wxtempfilewrites}
\func{bool}{Write}{\param{const wxString\& }{str}, \param{wxMBConv\&}{ conv = wxConvLibc}}
\func{bool}{Write}{\param{const wxString\& }{str}, \param{const wxMBConv\&}{ conv = wxConvUTF8}}
Write to the file, return {\tt true} on success, {\tt false} on failure.

View File

@@ -262,9 +262,9 @@ Insert a line before the line number {\it n}.
\membersection{wxTextFile::Open}\label{wxtextfileopen}
\constfunc{bool}{Open}{\param{wxMBConv\&}{ conv = wxConvUTF8}}
\constfunc{bool}{Open}{\param{const wxMBConv\&}{ conv = wxConvAuto()}}
\constfunc{bool}{Open}{\param{const wxString\& }{strFile}, \param{wxMBConv\&}{ conv = wxConvUTF8}}
\constfunc{bool}{Open}{\param{const wxString\& }{strFile}, \param{const wxMBConv\&}{ conv = wxConvAuto()}}
Open() opens the file with the given name or the name which was given in the
\helpref{constructor}{wxtextfilector} and also loads file in memory on
@@ -288,7 +288,7 @@ Delete all lines from the file, set current line number to 0.
\membersection{wxTextFile::Write}\label{wxtextfilewrite}
\constfunc{bool}{Write}{\param{wxTextFileType }{typeNew = wxTextFileType\_None}, \param{wxMBConv\&}{ conv = wxConvUTF8}}
\constfunc{bool}{Write}{\param{wxTextFileType }{typeNew = wxTextFileType\_None}, \param{const wxMBConv\&}{ conv = wxConvAuto()}}
Change the file on disk. The {\it typeNew} parameter allows you to change the
file format (default argument means "don't change type") and may be used to

View File

@@ -45,7 +45,7 @@ For example:
\membersection{wxTextInputStream::wxTextInputStream}\label{wxtextinputstreamctor}
\func{}{wxTextInputStream}{\param{wxInputStream\&}{ stream}, \param{const wxString\&}{ sep=" $\backslash$t"},
\param{wxMBConv\&}{ conv = wxConvUTF8} }
\param{const wxMBConv\&}{ conv = wxConvAuto()} }
Constructs a text stream associated to the given input stream.
@@ -216,7 +216,7 @@ and Unix in their native formats (concerning the line ending).
\membersection{wxTextOutputStream::wxTextOutputStream}\label{wxtextoutputstreamctor}
\func{}{wxTextOutputStream}{\param{wxOutputStream\&}{ stream}, \param{wxEOL}{ mode = wxEOL\_NATIVE}, \param{wxMBConv\&}{ conv = wxConvUTF8}}
\func{}{wxTextOutputStream}{\param{wxOutputStream\&}{ stream}, \param{wxEOL}{ mode = wxEOL\_NATIVE}, \param{const wxMBConv\&}{ conv = wxConvAuto()}}
Constructs a text stream object associated to the given output stream.

View File

@@ -454,7 +454,7 @@ For ANSI builds only (note the use of {\tt char} instead of {\tt wxChar}).
The following constructors allow you to construct wxString from a wide string
in ANSI build or from a C string in Unicode build.
\func{}{wxString}{\param{const wchar\_t*}{ psz}, \param{wxMBConv\&}{ conv}, \param{size\_t}{ nLength = wxSTRING\_MAXLEN}}
\func{}{wxString}{\param{const wchar\_t*}{ psz}, \param{const wxMBConv\&}{ conv}, \param{size\_t}{ nLength = wxSTRING\_MAXLEN}}
Initializes the string from first \arg{nLength} characters of wide string.
The default value of {\tt wxSTRING\_MAXLEN} means take all the string.
@@ -462,7 +462,7 @@ In ANSI build, \arg{conv}'s
\helpref{WC2MB}{wxmbconvwc2mb} method is called to
convert \arg{psz} to wide string. It is ignored in Unicode build.
\func{}{wxString}{\param{const char*}{ psz}, \param{wxMBConv\&}{ conv = wxConvLibc}, \param{size\_t}{ nLength = wxSTRING\_MAXLEN}}
\func{}{wxString}{\param{const char*}{ psz}, \param{const wxMBConv\&}{ conv = wxConvLibc}, \param{size\_t}{ nLength = wxSTRING\_MAXLEN}}
Initializes the string from first \arg{nLength} characters of C string.
The default value of {\tt wxSTRING\_MAXLEN} means take all the string.
@@ -586,7 +586,7 @@ to a function expecting non-const pointer.
\membersection{wxString::char\_str}\label{wxstringcharstr}
\constfunc{wxWritableCharBuffer}{char\_str}{\param{wxMBConv\&}{ conv = wxConvLibc}}
\constfunc{wxWritableCharBuffer}{char\_str}{\param{const wxMBConv\&}{ conv = wxConvLibc}}
Returns an object with string data that is implicitly convertible to
{\tt char*} pointer. Note that any change to the returned buffer is lost and so
@@ -980,9 +980,9 @@ Returns \true if the string contents matches a mask containing '*' and '?'.
\membersection{wxString::mb\_str}\label{wxstringmbstr}
\constfunc{const char*}{mb\_str}{\param{wxMBConv\&}{ conv = wxConvLibc}}
\constfunc{const char*}{mb\_str}{\param{const wxMBConv\&}{ conv = wxConvLibc}}
\constfunc{const wxCharBuffer}{mb\_str}{\param{wxMBConv\&}{ conv = wxConvLibc}}
\constfunc{const wxCharBuffer}{mb\_str}{\param{const wxMBConv\&}{ conv = wxConvLibc}}
Returns multibyte (C string) representation of the string.
In Unicode build, converts using \arg{conv}'s \helpref{cWC2MB}{wxmbconvcwc2mb}
@@ -1350,9 +1350,9 @@ UTF-8 build.
\membersection{wxString::wc\_str}\label{wxstringwcstr}
\constfunc{const wchar\_t*}{wc\_str}{\param{wxMBConv\&}{ conv}}
\constfunc{const wchar\_t*}{wc\_str}{\param{const wxMBConv\&}{ conv}}
\constfunc{const wxWCharBuffer}{wc\_str}{\param{wxMBConv\&}{ conv}}
\constfunc{const wxWCharBuffer}{wc\_str}{\param{const wxMBConv\&}{ conv}}
Returns wide character representation of the string.
In ANSI build, converts using \arg{conv}'s \helpref{cMB2WC}{wxmbconvcmb2wc}