From 5b5d025c1dec1c1a5abf4decb367a05e40f0c26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 2 Jan 2000 19:51:04 +0000 Subject: [PATCH] added wxEncodingConverter::Convert(char*,wxChar*) and variants git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/encconv.tex | 13 +++++++++++-- include/wx/encconv.h | 12 +++++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/latex/wx/encconv.tex b/docs/latex/wx/encconv.tex index 45e630294b..2bc0632ad1 100644 --- a/docs/latex/wx/encconv.tex +++ b/docs/latex/wx/encconv.tex @@ -68,6 +68,8 @@ or output encoding is not supported.) \func{void}{Convert}{\param{wxChar* }{str}} +\func{void}{Convert}{\param{const char* }{input}, \param{wxChar* }{output}} + Convert input string according to settings passed to \helpref{Init}{wxencodingconverterinit}. Note that you must call Init before using Convert! @@ -75,7 +77,7 @@ Note that you must call Init before using Convert! \membersection{wxEncodingConverter::GetPlatformEquivalents}\label{wxencodingconvertergetplatformequivalents} -\func{wxFontEncodingArray}{GetPlatformEquivalents}{\param{wxFontEncoding }{enc}, \param{int }{platform = wxPLATFORM\_CURRENT}} +\func{static wxFontEncodingArray}{GetPlatformEquivalents}{\param{wxFontEncoding }{enc}, \param{int }{platform = wxPLATFORM\_CURRENT}} Return equivalents for given font that are used under given platform. Supported platforms: @@ -121,15 +123,22 @@ encoding is native for this platform or not.) \item helpref{Convert}{wxencodingconverterconvert} is not limited to converting between equivalent encodings, it can convert between arbitrary two encodings! + +\item If {\it enc} is present in returned array, then it is {\bf always} first +item of it. + +\item Please not that returned array may not contain any item at all! \end{itemize} \membersection{wxEncodingConverter::GetAllEquivalents}\label{wxencodingconvertergetallequivalents} -\func{wxFontEncodingArray}{GetAllEquivalents}{\param{wxFontEncoding }{enc}} +\func{static wxFontEncodingArray}{GetAllEquivalents}{\param{wxFontEncoding }{enc}} Similar to \helpref{GetPlatformEquivalents}{wxencodingconvertergetplatformequivalents}, but this one will return ALL equivalent encodings, regardless the platform, and including itself. +This platform's encodings are before others in the array. And again, if {\it enc} is in the array, +it is the very first item in it. diff --git a/include/wx/encconv.h b/include/wx/encconv.h index 1610dd06b4..05dbfeaf40 100644 --- a/include/wx/encconv.h +++ b/include/wx/encconv.h @@ -82,10 +82,16 @@ class WXDLLEXPORT wxEncodingConverter : public wxObject // Convert input string according to settings passed to Init. // Note that you must call Init before using Convert! - wxString Convert(const wxString& input); void Convert(const wxChar* input, wxChar* output); void Convert(wxChar* str) { Convert(str, str); } - + wxString Convert(const wxString& input); + +#if wxUSE_UNICODE // otherwise wxChar === char + void Convert(const char* input, wxChar* output); + void Convert(const wxChar* input, char* output); + void Convert(const char* input, char* output); + void Convert(char* str) { Convert(str, str); } +#endif // Return equivalent(s) for given font that are used // under given platform. wxPLATFORM_CURRENT means the plaform // this binary was compiled for @@ -124,7 +130,7 @@ class WXDLLEXPORT wxEncodingConverter : public wxObject private: wxChar *m_Table; - bool m_UnicodeInput; + bool m_UnicodeInput, m_UnicodeOutput; bool m_JustCopy; };