// initializes the string to the empty value (must be called only from
// ctors, use Reinit() otherwise)
void Init() { m_pchData = (wxChar *)wxEmptyString; }
- // initializaes the string with (a part of) C-string
+ // initializes the string with (a part of) C-string
void InitWith(const wxChar *psz, size_t nPos = 0, size_t nLen = npos);
// as Init, but also frees old data
void Reinit() { GetStringData()->Unlock(); Init(); }
wxString(const wxWCharBuffer& psz) : wxStringBase(psz.data()) { }
#else // ANSI
// from C string (for compilers using unsigned char)
- wxString(const unsigned char* psz, size_t nLength = npos)
+ wxString(const unsigned char* psz)
+ : wxStringBase((const char*)psz) { }
+ // from part of C string (for compilers using unsigned char)
+ wxString(const unsigned char* psz, size_t nLength)
: wxStringBase((const char*)psz, nLength) { }
#if wxUSE_WCHAR_T
#if defined wxLongLong_t && !defined wxLongLongIsLong
// insert a long long if they exist and aren't longs
wxString& operator<<(wxLongLong_t ll)
- { return (*this) << Format(_T("%") wxLongLongFmtSpec _T("d"), ll); }
+ {
+ const wxChar *fmt = _T("%") wxLongLongFmtSpec _T("d");
+ return (*this) << Format(fmt, ll);
+ }
// insert an unsigned long long
wxString& operator<<(wxULongLong_t ull)
- { return (*this) << Format(_T("%") wxLongLongFmtSpec _T("u"), ull); }
+ {
+ const wxChar *fmt = _T("%") wxLongLongFmtSpec _T("u");
+ return (*this) << Format(fmt , ull);
+ }
#endif
// insert a float into string
wxString& operator<<(float f)
// convert to a double
bool ToDouble(double *val) const;
- // formated input/output
+ // formatted input/output
// as sprintf(), returns the number of characters written or < 0 on error
// (take 'this' into account in attribute parameter count)
int Printf(const wxChar *pszFormat, ...) ATTRIBUTE_PRINTF_2;