From: Ove Kaaven Date: Wed, 14 Apr 1999 14:36:58 +0000 (+0000) Subject: wxMBConv derived classes and instances. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d41bba91572b8a4be20dfebc9d36bb430aaf1c12 wxMBConv derived classes and instances. Added wxConv_gdk (wrapper for gdk_mbstowcs and gdk_wcstombs, which use X calls instead of libc calls), which should probably not be used, but is now there for completeness, and in case it's useful after all. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/string.h b/include/wx/string.h index ac53c0dd08..bbcd039ea3 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -200,15 +200,29 @@ class WXDLLEXPORT wxMBConv const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); } #endif }; -WXDLLEXPORT_DATA(extern wxMBConv) wxConv_libc, wxConv_UTF7, wxConv_UTF8; -#define wxConv_file wxConv_libc +WXDLLEXPORT_DATA(extern wxMBConv) wxConv_libc; -class WXDLLEXPORT wxCSConv : wxMBConv +#define wxANOTHER_MBCONV(type) \ +class type : 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; \ +} + +WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConv_file)) wxConv_file; +WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConv_UTF7)) wxConv_UTF7; +WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConv_UTF8)) wxConv_UTF8; +#ifdef __WXGTK__ +WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConv_gdk)) wxConv_gdk; +#endif + +class WXDLLEXPORT wxCSConv : public wxMBConv { private: wxChar *data; public: wxCSConv(const wxChar *charset); + virtual ~wxCSConv(void); 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; };