X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3affcd078b1dc6d92cd06f18b5cc4c41a33161ea..580ca0a4e10dbd2fb0a144065004394b9d5dcc56:/include/wx/string.h diff --git a/include/wx/string.h b/include/wx/string.h index c2202864cb..0db91472e0 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -76,9 +76,15 @@ class WXDLLIMPEXP_BASE wxString; // constants // ---------------------------------------------------------------------------- +#if WXWIN_COMPATIBILITY_2_6 + +// deprecated in favour of wxString::npos, don't use in new code +// // maximum possible length for a string means "take all string" everywhere #define wxSTRING_MAXLEN wxStringBase::npos +#endif // WXWIN_COMPATIBILITY_2_6 + // ---------------------------------------------------------------------------- // global data // ---------------------------------------------------------------------------- @@ -163,6 +169,17 @@ inline int Stricmp(const char *psz1, const char *psz2) // deal with STL/non-STL/non-STL-but-wxUSE_STD_STRING // ---------------------------------------------------------------------------- +#if wxUSE_STL || wxUSE_STD_STRING + // these compilers come without standard C++ library headers by default, + // remove the tests here if you do have them (e.g. from STLPort) + #if defined(__DMC__) || defined(__WATCOMC__) + #undef wxUSE_STL + #undef wxUSE_STD_STRING + #define wxUSE_STL 0 + #define wxUSE_STD_STRING 0 + #endif +#endif // wxUSE_STL || wxUSE_STD_STRING + // in both cases we need to define wxStdString #if wxUSE_STL || wxUSE_STD_STRING @@ -407,7 +424,7 @@ public: // return the length of the string size_type size() const { return length(); } // return the maximum size of the string - size_type max_size() const { return wxSTRING_MAXLEN; } + size_type max_size() const { return npos; } // resize the string, filling the space with c if c != 0 void resize(size_t nSize, wxChar ch = wxT('\0')); // delete the contents of the string @@ -1126,9 +1143,17 @@ public: bool ToLong(long *val, int base = 10) const; // convert to an unsigned integer bool ToULong(unsigned long *val, int base = 10) const; + // convert to wxLongLong +#if defined(wxLongLong_t) + bool ToLongLong(wxLongLong_t *val, int base = 10) const; + // convert to wxULongLong + bool ToULongLong(wxULongLong_t *val, int base = 10) const; +#endif // wxLongLong_t // convert to a double bool ToDouble(double *val) const; + + // formatted input/output // as sprintf(), returns the number of characters written or < 0 on error // (take 'this' into account in attribute parameter count) @@ -1578,7 +1603,6 @@ inline bool operator!=(const wxString& s, wxChar c) { return !s.IsSameAs(c); } #include "wx/iosfwrap.h" -WXDLLIMPEXP_BASE wxSTD istream& operator>>(wxSTD istream&, wxString&); WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxString&); #endif // wxSTD_STRING_COMPATIBILITY