- : m_impl(nRepeat, ch) { }
- // ctor takes first nLength characters from C string
- // (default value of npos means take all the string)
- wxString(const wxChar *psz)
- : m_impl(psz ? psz : wxT("")) { }
- wxString(const wxChar *psz, size_t nLength)
- : m_impl(psz, nLength) { }
- wxString(const wxChar *psz,
- const wxMBConv& WXUNUSED(conv),
- size_t nLength = npos)
- : m_impl(psz, nLength == npos ? wxStrlen(psz) : nLength) { }
-
- // even if we're not built with wxUSE_STL == 1 it is very convenient to allow
- // implicit conversions from std::string to wxString as this allows to use
- // the same strings in non-GUI and GUI code, however we don't want to
- // unconditionally add this ctor as it would make wx lib dependent on
- // libstdc++ on some Linux versions which is bad, so instead we ask the
- // client code to define this wxUSE_STD_STRING symbol if they need it
-#if wxUSE_STD_STRING && !wxUSE_STL_BASED_WXSTRING
- wxString(const wxStdString& s)
- : m_impl(s.c_str()) { } // FIXME-UTF8: this is broken for embedded 0s
-#endif // wxUSE_STD_STRING && !wxUSE_STL_BASED_WXSTRING
-
-#if wxUSE_UNICODE
- // from multibyte string
- wxString(const char *psz,
- const wxMBConv& conv = wxConvLibc,
- size_t nLength = npos);
- // from multibyte string for ANSI compatibility, with wxConvLibc
- wxString(const char *psz, size_t nLength);
- // from wxWCharBuffer (i.e. return from wxGetString)
- wxString(const wxWCharBuffer& psz) : m_impl(psz.data()) { }
-#else // ANSI
- // from C string (for compilers using unsigned char)
- wxString(const unsigned char* psz)
- : m_impl((const char*)psz) { }
- // from part of C string (for compilers using unsigned char)
- wxString(const unsigned char* psz, size_t nLength)
- : m_impl((const char*)psz, nLength) { }
+ { assign(nRepeat, ch); }
+
+ // ctors from char* strings:
+ wxString(const char *psz)
+ : m_impl(ImplStr(psz)) {}
+ wxString(const char *psz, const wxMBConv& conv)
+ : m_impl(ImplStr(psz, conv)) {}
+ wxString(const char *psz, size_t nLength)
+ { assign(psz, nLength); }
+ wxString(const char *psz, const wxMBConv& conv, size_t nLength)
+ {
+ SubstrBufFromMB str(ImplStr(psz, nLength, conv));
+ m_impl.assign(str.data, str.len);
+ }