X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8c264b23adf380bf9262b96dd8df3ed78fda74cd..f0f951faab071a72c06179224f0ab09ffc9e9b76:/include/wx/string.h diff --git a/include/wx/string.h b/include/wx/string.h index a47ca920c5..d469d96866 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -38,7 +38,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __WXMAC__ +#if defined(__WXMAC__) || defined(__VISAGECPP__) #include #endif @@ -46,11 +46,20 @@ #include #endif -#include -#include -#include -#include -#include +#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 + // problem in VACPP V4 with including stdlib.h multiple times + // strconv includes it anyway +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include +#endif #ifdef HAVE_STRINGS_H #include // for strcasecmp() @@ -391,7 +400,7 @@ public: wxChar operator[](unsigned int n) const { ASSERT_VALID_INDEX( n ); return m_pchData[n]; } #endif - + // operator version of GetWriteableChar wxChar& operator[](size_t n) { ASSERT_VALID_INDEX( n ); CopyBeforeWrite(); return m_pchData[n]; } @@ -606,12 +615,26 @@ public: // check if the string contents matches a mask containing '*' and '?' bool Matches(const wxChar *szMask) const; + // conversion to numbers: all functions return TRUE only if the whole string + // is a number and put the value of this number into the pointer provided + // convert to a signed integer + bool ToLong(long *val) const; + // convert to an unsigned integer + bool ToULong(unsigned long *val) const; + // convert to a double + bool ToDouble(double *val) const; + // formated input/output // as sprintf(), returns the number of characters written or < 0 on error int Printf(const wxChar *pszFormat, ...); // as vprintf(), returns the number of characters written or < 0 on error int PrintfV(const wxChar* pszFormat, va_list argptr); + // returns the string containing the result of Printf() to it + static wxString Format(const wxChar *pszFormat, ...); + // the same as above, but takes a va_list + static wxString FormatV(const wxChar *pszFormat, va_list argptr); + // raw access to string memory // ensure that string has space for at least nLen characters // only works if the data of this string is not shared