]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
added missing public keyword to wxWritableCharTypeBuffer declaration
[wxWidgets.git] / include / wx / string.h
index f462273ecd6262f4e34cf7620f132031fb54c8f3..4ff1d975911ab6409af693bc89f43f32af17994a 100644 (file)
@@ -220,6 +220,26 @@ public:
     wxCStrData operator+(size_t n) const
         { return wxCStrData(m_str, m_offset + n, m_owned); }
 
+    // and these for "str.c_str() + n - 2":
+    wxCStrData operator-(int n) const
+    {
+        wxASSERT_MSG( n <= (int)m_offset,
+                      _T("attempt to construct address before the beginning of the string") );
+        return wxCStrData(m_str, m_offset - n, m_owned);
+    }
+    wxCStrData operator-(long n) const
+    {
+        wxASSERT_MSG( n <= (int)m_offset,
+                      _T("attempt to construct address before the beginning of the string") );
+        return wxCStrData(m_str, m_offset - n, m_owned);
+    }
+    wxCStrData operator-(size_t n) const
+    {
+        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);
+    }
+
     // this operator is needed to make expressions like "*c_str()" or
     // "*(c_str() + 2)" work
     wxUniChar operator*() const;
@@ -903,6 +923,12 @@ public:
     // 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.)
@@ -952,7 +978,7 @@ public:
     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 ) ); }
@@ -1839,6 +1865,7 @@ public:
   wxString& operator+=(wxUniChar ch)
     { m_impl += EncodeChar(ch); return *this; }
   wxString& operator+=(wxUniCharRef ch) { return *this += wxUniChar(ch); }
+  wxString& operator+=(int ch) { return *this += wxUniChar(ch); }
   wxString& operator+=(char ch) { return *this += wxUniChar(ch); }
   wxString& operator+=(unsigned char ch) { return *this += wxUniChar(ch); }
   wxString& operator+=(wchar_t ch) { return *this += wxUniChar(ch); }