#define wxSTD_STRING_COMPATIBILITY
// define to derive wxString from wxObject
+#ifdef WXSTRING_IS_WXOBJECT
#undef WXSTRING_IS_WXOBJECT
+#endif
// maximum possible length for a string means "take all string" everywhere
// (as sizeof(StringData) is unknown here we substract 100)
return _stricmp(psz1, psz2);
#elif defined(__SC__)
return _stricmp(psz1, psz2);
+#elif defined(__SALFORDC__)
+ return stricmp(psz1, psz2);
#elif defined(__BORLANDC__)
return stricmp(psz1, psz2);
#elif defined(__WATCOMC__)
size_t Len() const { return GetStringData()->nDataLength; }
// string contains any characters?
bool IsEmpty() const { return Len() == 0; }
+ // empty string is "FALSE", so !str will return TRUE
+ bool operator!() const { return IsEmpty(); }
// empty string contents
void Empty()
{
wxString& operator<<(float f);
// insert a double into string
wxString& operator<<(double d);
-
+
// string comparison
// case-sensitive comparison: return 0 if =, +1 if > or -1 if <
int Cmp(const char *psz) const { return strcmp(c_str(), psz); }
wxString AfterLast(char ch) const;
// for compatibility only, use more explicitly named functions above
- wxString Before(char ch) const { return BeforeLast(ch); }
- wxString After(char ch) const { return AfterFirst(ch); }
+ wxString Before(char ch) const { return BeforeLast(ch); }
+ wxString After(char ch) const { return AfterFirst(ch); }
// case conversion
- // convert to upper case, return the string itself
+ // convert to upper case in place, return the string itself
wxString& MakeUpper();
- // convert to lower case, return the string itself
+ // convert to upper case, return the copy of the string
+ // Here's something to remember: BC++ doesn't like returns in inlines.
+ wxString Upper() const ;
+ // convert to lower case in place, return the string itself
wxString& MakeLower();
+ // convert to lower case, return the copy of the string
+ wxString Lower() const ;
// trimming/padding whitespace (either side) and truncating
// remove spaces from left or from right (default) side
enum caseCompare {exact, ignoreCase};
// values for first parameter of Strip function
enum stripType {leading = 0x1, trailing = 0x2, both = 0x3};
+
// use Printf()
- inline int sprintf(const char *pszFormat, ...)
- {
- va_list argptr;
- va_start(argptr, pszFormat);
- int iLen = PrintfV(pszFormat, argptr);
- va_end(argptr);
- return iLen;
- }
+ int sprintf(const char *pszFormat, ...);
// use Cmp()
inline int CompareTo(const char* psz, caseCompare cmp = exact) const
// wxString comparison functions: operator versions are always case sensitive
// ---------------------------------------------------------------------------
//
-inline bool operator==(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) == 0; }
+inline bool operator==(const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) == 0); }
//
-inline bool operator==(const wxString& s1, const char * s2) { return s1.Cmp(s2) == 0; }
+inline bool operator==(const wxString& s1, const char * s2) { return (s1.Cmp(s2) == 0); }
//
-inline bool operator==(const char * s1, const wxString& s2) { return s2.Cmp(s1) == 0; }
+inline bool operator==(const char * s1, const wxString& s2) { return (s2.Cmp(s1) == 0); }
//
-inline bool operator!=(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) != 0; }
+inline bool operator!=(const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) != 0); }
//
-inline bool operator!=(const wxString& s1, const char * s2) { return s1.Cmp(s2) != 0; }
+inline bool operator!=(const wxString& s1, const char * s2) { return (s1.Cmp(s2) != 0); }
//
-inline bool operator!=(const char * s1, const wxString& s2) { return s2.Cmp(s1) != 0; }
+inline bool operator!=(const char * s1, const wxString& s2) { return (s2.Cmp(s1) != 0); }
//
-inline bool operator< (const wxString& s1, const wxString& s2) { return s1.Cmp(s2) < 0; }
+inline bool operator< (const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) < 0); }
//
-inline bool operator< (const wxString& s1, const char * s2) { return s1.Cmp(s2) < 0; }
+inline bool operator< (const wxString& s1, const char * s2) { return (s1.Cmp(s2) < 0); }
//
-inline bool operator< (const char * s1, const wxString& s2) { return s2.Cmp(s1) > 0; }
+inline bool operator< (const char * s1, const wxString& s2) { return (s2.Cmp(s1) > 0); }
//
-inline bool operator> (const wxString& s1, const wxString& s2) { return s1.Cmp(s2) > 0; }
+inline bool operator> (const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) > 0); }
//
-inline bool operator> (const wxString& s1, const char * s2) { return s1.Cmp(s2) > 0; }
+inline bool operator> (const wxString& s1, const char * s2) { return (s1.Cmp(s2) > 0); }
//
-inline bool operator> (const char * s1, const wxString& s2) { return s2.Cmp(s1) < 0; }
+inline bool operator> (const char * s1, const wxString& s2) { return (s2.Cmp(s1) < 0); }
//
-inline bool operator<=(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) <= 0; }
+inline bool operator<=(const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) <= 0); }
//
-inline bool operator<=(const wxString& s1, const char * s2) { return s1.Cmp(s2) <= 0; }
+inline bool operator<=(const wxString& s1, const char * s2) { return (s1.Cmp(s2) <= 0); }
//
-inline bool operator<=(const char * s1, const wxString& s2) { return s2.Cmp(s1) >= 0; }
+inline bool operator<=(const char * s1, const wxString& s2) { return (s2.Cmp(s1) >= 0); }
//
-inline bool operator>=(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) >= 0; }
+inline bool operator>=(const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) >= 0); }
//
-inline bool operator>=(const wxString& s1, const char * s2) { return s1.Cmp(s2) >= 0; }
+inline bool operator>=(const wxString& s1, const char * s2) { return (s1.Cmp(s2) >= 0); }
//
-inline bool operator>=(const char * s1, const wxString& s2) { return s2.Cmp(s1) <= 0; }
+inline bool operator>=(const char * s1, const wxString& s2) { return (s2.Cmp(s1) <= 0); }
wxString WXDLLEXPORT operator+(const wxString& string1, const wxString& string2);
wxString WXDLLEXPORT operator+(const wxString& string, char ch);