]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
source clean-up
[wxWidgets.git] / include / wx / string.h
index 7cd776c85fa0f4b7f1374564fc19cbffdc484c20..a47ca920c5a4c4b48c936cfe43946b57c4807e0c 100644 (file)
@@ -156,6 +156,15 @@ inline int WXDLLEXPORT Stricmp(const char *psz1, const char *psz2)
 #endif  // OS/compiler
 }
 
+// wxSnprintf() is like snprintf() if it's available and sprintf() (always
+// available, but dangerous!) if not
+extern int WXDLLEXPORT wxSnprintf(wxChar *buf, size_t len,
+                                  const wxChar *format, ...);
+
+// and wxVsnprintf() is like vsnprintf() or vsprintf()
+extern int WXDLLEXPORT wxVsnprintf(wxChar *buf, size_t len,
+                                   const wxChar *format, va_list argptr);
+
 // return an empty wxString
 class WXDLLEXPORT wxString; // not yet defined
 inline const wxString& wxGetEmptyString() { return *(wxString *)&wxEmptyString; }
@@ -696,6 +705,8 @@ public:
   void clear() { Empty(); }
     // returns true if the string is empty
   bool empty() const { return IsEmpty(); }
+    // inform string about planned change in size
+  void reserve(size_t size) { Alloc(size); }
 
   // lib.string.access
     // return the character at position n
@@ -848,7 +859,8 @@ public:
               const wxChar* sz, size_t nCount = npos) const;
 
   // substring extraction
-  wxString substr(size_t nStart = 0, size_t nLen = npos) const;
+  wxString substr(size_t nStart = 0, size_t nLen = npos) const
+    { return Mid(nStart, nLen); }
 #endif // wxSTD_STRING_COMPATIBILITY
 };