]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
don't build wxscintilla lib if wxSTC is not built
[wxWidgets.git] / include / wx / string.h
index 72900dcfb1e428356ae3f3cd25bcd4d5e39ac03c..208f343912417971fc72e265ca031c86c5dc4543 100644 (file)
@@ -2347,6 +2347,22 @@ inline wxUniChar wxCStrData::operator[](size_t n) const
     return m_str->at(m_offset + n);
 }
 
+// ----------------------------------------------------------------------------
+// more wxCStrData operators
+// ----------------------------------------------------------------------------
+
+// we need to define those to allow "size_t pos = p - s.c_str()" where p is
+// some pointer into the string
+inline size_t operator-(const char *p, const wxCStrData& cs)
+{
+    return p - cs.AsChar();
+}
+
+inline size_t operator-(const wchar_t *p, const wxCStrData& cs)
+{
+    return p - cs.AsWChar();
+}
+
 // ----------------------------------------------------------------------------
 // implementation of wx[W]CharBuffer inline methods using wxCStrData
 // ----------------------------------------------------------------------------