}
wxCStrData operator-(size_t n) const
{
- wxASSERT_MSG( n <= (int)m_offset,
+ wxASSERT_MSG( n <= m_offset,
_T("attempt to construct address before the beginning of the string") );
return wxCStrData(m_str, m_offset - n, m_owned);
}
// wchar_t*, UTF-8-encoded char*, depending on the build):
const_pointer wx_str() const { return m_impl.c_str(); }
+ // conversion to *non-const* multibyte or widestring buffer; modifying
+ // returned buffer won't affect the string, these methods are only useful
+ // for passing values to const-incorrect functions
+ wxWritableCharBuffer char_str() const { return mb_str(); }
+ wxWritableWCharBuffer wchar_str() const { return wc_str(); }
+
// conversion to/from plain (i.e. 7 bit) ASCII: this is useful for
// converting numbers or strings which are certain not to contain special
// chars (typically system functions, X atoms, environment variables etc.)
const wxWX2MBbuf mbc_str() const { return mb_str(); }
#if wxUSE_WCHAR_T
- const wxWCharBuffer wc_str(const wxMBConv& conv) const;
+ const wxWCharBuffer wc_str(const wxMBConv& conv = wxConvLibc) const;
#endif // wxUSE_WCHAR_T
#ifdef __WXOSX__
const wxCharBuffer fn_str() const { return wxConvFile.cWC2WX( wc_str( wxConvLocal ) ); }
{ return operator=((wxUniChar)ch); }
wxString& operator=(char ch)
{ return operator=(wxUniChar(ch)); }
+ wxString& operator=(unsigned char ch)
+ { return operator=(wxUniChar(ch)); }
wxString& operator=(wchar_t ch)
{ return operator=(wxUniChar(ch)); }
// from a C string - STL probably will crash on NULL,
wxString& operator<<(wxUniChar ch) { append(1, ch); return *this; }
wxString& operator<<(wxUniCharRef ch) { append(1, ch); return *this; }
wxString& operator<<(char ch) { append(1, ch); return *this; }
+ wxString& operator<<(unsigned char ch) { append(1, ch); return *this; }
wxString& operator<<(wchar_t ch) { append(1, ch); return *this; }
// string += buffer (i.e. from wxGetString)
{ append(count, ch); return *this; }
wxString& Append(char ch, size_t count = 1u)
{ append(count, ch); return *this; }
+ wxString& Append(unsigned char ch, size_t count = 1u)
+ { append(count, ch); return *this; }
wxString& Append(wchar_t ch, size_t count = 1u)
{ append(count, ch); return *this; }
wxString& Append(const char* psz, size_t nLen)
// use Find()
int First( wxUniChar ch ) const { return Find(ch); }
int First( char ch ) const { return Find(ch); }
+ int First( unsigned char ch ) const { return Find(ch); }
int First( wchar_t ch ) const { return Find(ch); }
int First( const wxChar* psz ) const { return Find(psz); }
int First( const wxString &str ) const { return Find(str); }
{ return find(wxUniChar(ch), nStart); }
size_t find(char ch, size_t nStart = 0) const
{ return find(wxUniChar(ch), nStart); }
+ size_t find(unsigned char ch, size_t nStart = 0) const
+ { return find(wxUniChar(ch), nStart); }
size_t find(wchar_t ch, size_t nStart = 0) const
{ return find(wxUniChar(ch), nStart); }
{ return rfind(wxUniChar(ch), nStart); }
size_t rfind(char ch, size_t nStart = npos) const
{ return rfind(wxUniChar(ch), nStart); }
+ size_t rfind(unsigned char ch, size_t nStart = npos) const
+ { return rfind(wxUniChar(ch), nStart); }
size_t rfind(wchar_t ch, size_t nStart = npos) const
{ return rfind(wxUniChar(ch), nStart); }
{ return find_first_of(wxUniChar(ch), nStart); }
size_t find_first_of(char ch, size_t nStart = 0) const
{ return find_first_of(wxUniChar(ch), nStart); }
+ size_t find_first_of(unsigned char ch, size_t nStart = 0) const
+ { return find_first_of(wxUniChar(ch), nStart); }
size_t find_first_of(wchar_t ch, size_t nStart = 0) const
{ return find_first_of(wxUniChar(ch), nStart); }
size_t find_last_of(wxUniCharRef ch, size_t nStart = npos) const
{ return find_last_of(wxUniChar(ch), nStart); }
size_t find_last_of(char ch, size_t nStart = npos) const
{ return find_last_of(wxUniChar(ch), nStart); }
+ size_t find_last_of(unsigned char ch, size_t nStart = npos) const
+ { return find_last_of(wxUniChar(ch), nStart); }
size_t find_last_of(wchar_t ch, size_t nStart = npos) const
{ return find_last_of(wxUniChar(ch), nStart); }
size_t find_first_not_of(wxUniCharRef ch, size_t nStart = 0) const
{ return find_first_not_of(wxUniChar(ch), nStart); }
size_t find_first_not_of(char ch, size_t nStart = 0) const
{ return find_first_not_of(wxUniChar(ch), nStart); }
+ size_t find_first_not_of(unsigned char ch, size_t nStart = 0) const
+ { return find_first_not_of(wxUniChar(ch), nStart); }
size_t find_first_not_of(wchar_t ch, size_t nStart = 0) const
{ return find_first_not_of(wxUniChar(ch), nStart); }
size_t find_last_not_of(wxUniCharRef ch, size_t nStart = npos) const
{ return find_last_not_of(wxUniChar(ch), nStart); }
size_t find_last_not_of(char ch, size_t nStart = npos) const
{ return find_last_not_of(wxUniChar(ch), nStart); }
+ size_t find_last_not_of(unsigned char ch, size_t nStart = npos) const
+ { return find_last_not_of(wxUniChar(ch), nStart); }
size_t find_last_not_of(wchar_t ch, size_t nStart = npos) const
{ return find_last_not_of(wxUniChar(ch), nStart); }