// ----------------------------------------------------------------------------
// global pointer to empty string
-extern const char *g_szNul;
+WXDLLEXPORT_DATA(extern const char*) g_szNul;
// return an empty wxString
-class wxString; // not yet defined
+class WXDLLEXPORT wxString; // not yet defined
inline const wxString& wxGetEmptyString() { return *(wxString *)&g_szNul; }
// ---------------------------------------------------------------------------
/** @name string comparison */
//@{
/**
- case-sensitive comparaison
+ case-sensitive comparison
@return 0 if equal, +1 if greater or -1 if less
@see CmpNoCase, IsSameAs
*/
int Cmp(const char *psz) const { return strcmp(c_str(), psz); }
/**
- case-insensitive comparaison, return code as for wxString::Cmp()
+ case-insensitive comparison, return code as for wxString::Cmp()
@see: Cmp, IsSameAs
*/
int CmpNoCase(const char *psz) const { return Stricmp(c_str(), psz); }
wxString& Remove(size_t nStart, size_t nLen)
{ return erase( nStart, nLen ); }
- size_t First( const char ch ) const { return find(ch); }
- size_t First( const char* psz ) const { return find(psz); }
- size_t First( const wxString &str ) const { return find(str); }
+ int First( const char ch ) const { size_t res = find(ch); return res == wxString::npos ? -1 : res; }
+ int First( const char* psz ) const { size_t res = find(psz); return res == wxString::npos ? -1 : res; }
+ int First( const wxString &str ) const { size_t res = find(str); return res == wxString::npos ? -1 : res; }
- size_t Last( const char ch ) const { return rfind(ch,0); }
- size_t Last( const char* psz ) const { return rfind(psz,0); }
- size_t Last( const wxString &str ) const { return rfind(str,0); }
+ int Last( const char ch ) const { size_t res = rfind(ch,0); return res == wxString::npos ? -1 : res; }
+ int Last( const char* psz ) const { size_t res = rfind(psz,0); return res == wxString::npos ? -1 : res; }
+ int Last( const wxString &str ) const { size_t res = rfind(str,0); return res == wxString::npos ? -1 : res; }
/// same as IsEmpty
bool IsNull() const { return IsEmpty(); }
//@{
/// just like strcmp()
int compare(const wxString& str) const { return Cmp(str); }
- /// comparaison with a substring
+ /// comparison with a substring
int compare(size_t nStart, size_t nLen, const wxString& str) const;
- /// comparaison of 2 substrings
+ /// comparison of 2 substrings
int compare(size_t nStart, size_t nLen,
const wxString& str, size_t nStart2, size_t nLen2) const;
/// just like strcmp()
int compare(const char* sz) const { return Cmp(sz); }
- /// substring comparaison with first nCount characters of sz
+ /// substring comparison with first nCount characters of sz
int compare(size_t nStart, size_t nLen,
const char* sz, size_t nCount = npos) const;
//@}
/**
Search the element in the array, starting from the either side
@param if bFromEnd reverse search direction
- @param if bCase, comparaison is case sensitive (default)
+ @param if bCase, comparison is case sensitive (default)
@return index of the first item matched or NOT_FOUND
@see NOT_FOUND
*/
};
// ---------------------------------------------------------------------------
-/** @name wxString comparaison functions
- @memo Comparaisons are case sensitive
+/** @name wxString comparison functions
+ @memo Comparisons are case sensitive
*/
// ---------------------------------------------------------------------------
//@{