X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..461573cc244a194f804e2bf0c8ba6a365e77c95c:/include/wx/strconv.h diff --git a/include/wx/strconv.h b/include/wx/strconv.h index 97239009c4..2e651a9940 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -12,7 +12,7 @@ #ifndef _WX_WXSTRCONVH__ #define _WX_WXSTRCONVH__ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "strconv.h" #endif @@ -20,6 +20,10 @@ #include "wx/wxchar.h" #include "wx/buffer.h" +#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 +# undef __BSEXCPT__ +#endif + #include #if wxUSE_WCHAR_T @@ -43,29 +47,19 @@ public: const wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); } const wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); } const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; } - const wchar_t* cMB2WC(const wchar_t *psz) const { return psz; } + const wchar_t* cWX2WC(const wchar_t *psz) const { return psz; } #else // ANSI const char* cMB2WX(const char *psz) const { return psz; } const char* cWX2MB(const char *psz) const { return psz; } const wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); } const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); } #endif // Unicode/ANSI -}; - -WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc; - -// ---------------------------------------------------------------------------- -// wxMBConvFile (for conversion to filenames) -// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMBConvFile : public wxMBConv -{ -public: - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; - virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + // virtual dtor for any base class + virtual ~wxMBConv(); }; -WXDLLEXPORT_DATA(extern wxMBConvFile) wxConvFile; +WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc; // ---------------------------------------------------------------------------- // wxMBConvUTF7 (for conversion using UTF7 encoding) @@ -120,22 +114,31 @@ class WXDLLEXPORT wxCSConv : public wxMBConv { public: wxCSConv(const wxChar *charset); + wxCSConv(const wxCSConv& conv); virtual ~wxCSConv(); + wxCSConv& operator=(const wxCSConv& conv); + void LoadNow(); virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + void Clear() ; + private: void SetName(const wxChar *charset); + // note that we can't use wxString here because of compilation + // dependencies: we're included from wx/string.h wxChar *m_name; wxCharacterSet *m_cset; bool m_deferred; }; +#define wxConvFile wxConvLocal WXDLLEXPORT_DATA(extern wxCSConv) wxConvLocal; +WXDLLEXPORT_DATA(extern wxCSConv) wxConvISO8859_1; WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent; // ---------------------------------------------------------------------------- @@ -149,7 +152,7 @@ WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent; #define wxMBFILES 0 #endif -#if wxMBFILES +#if wxMBFILES && wxUSE_UNICODE #define wxFNCONV(name) wxConvFile.cWX2MB(name) #define wxFNSTRINGCAST wxMBSTRINGCAST #else @@ -171,7 +174,7 @@ public: const char* cWX2MB(const char *psz) const { return psz; } }; -WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc, wxConvFile; +WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc, wxConvFile, wxConvLocal, wxConvISO8859_1, wxConvUTF8; WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent; #define wxFNCONV(name) name