#else
+#if wxUSE_WCHAR_T
// from wide string
wxString::wxString(const wchar_t *pwz)
{
Init();
}
}
+#endif
#endif
return *this;
}
+#if wxUSE_WCHAR_T
wxString& wxString::operator=(const wchar_t *pwz)
{
wxString str(pwz);
*this = str;
return *this;
}
+#endif
#endif
char *val = va_arg(argptr, char *);
#if wxUSE_UNICODE
// ASCII->Unicode constructor handles max_width right
- wxString s(val, wxConv_libc, max_width);
+ wxString s(val, wxConvLibc, max_width);
#else
size_t len = wxSTRING_MAXLEN;
if (val) {
// MBConv
// ============================================================================
+WXDLLEXPORT_DATA(wxMBConv *) wxConvCurrent = &wxConvLibc;
+#if !wxUSE_WCHAR_T
+WXDLLEXPORT_DATA(wxMBConv) wxConvLibc, wxConvFile;
+#endif
+
#if wxUSE_WCHAR_T
-WXDLLEXPORT_DATA(wxMBConv *) wxConv_current = &wxConv_libc;
// ----------------------------------------------------------------------------
// standard libc conversion
// ----------------------------------------------------------------------------
-WXDLLEXPORT_DATA(wxMBConv) wxConv_libc;
+WXDLLEXPORT_DATA(wxMBConv) wxConvLibc;
size_t wxMBConv::MB2WC(wchar_t *buf, const char *psz, size_t n) const
{
#endif
// TODO: write actual implementations of UTF-7 here
-size_t wxMBConvUTF7::MB2WC(wchar_t *buf, const char *psz, size_t n) const
+size_t wxMBConvUTF7::MB2WC(wchar_t * WXUNUSED(buf),
+ const char * WXUNUSED(psz),
+ size_t WXUNUSED(n)) const
{
return 0;
}
-size_t wxMBConvUTF7::WC2MB(char *buf, const wchar_t *psz, size_t n) const
+size_t wxMBConvUTF7::WC2MB(char * WXUNUSED(buf),
+ const wchar_t * WXUNUSED(psz),
+ size_t WXUNUSED(n)) const
{
return 0;
}
}
#endif//wxUSE_WCHAR_T
+
+#if wxUSE_WCHAR_T
+const wxWCharBuffer wxMBConv::cMB2WC(const char *psz) const
+ {
+ if (psz) {
+ size_t nLen = MB2WC((wchar_t *) NULL, psz, 0);
+ wxWCharBuffer buf(nLen);
+ MB2WC(WCSTRINGCAST buf, psz, nLen);
+ return buf;
+ } else return wxWCharBuffer((wchar_t *) NULL);
+ }
+
+const wxCharBuffer wxMBConv::cWC2MB(const wchar_t *psz) const
+ {
+ if (psz) {
+ size_t nLen = WC2MB((char *) NULL, psz, 0);
+ wxCharBuffer buf(nLen);
+ WC2MB(MBSTRINGCAST buf, psz, nLen);
+ return buf;
+ } else return wxCharBuffer((char *) NULL);
+ }
+
+#endif//wxUSE_WCHAR_T
+