X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e810df36b3d5e73e53e2d536802df0174c571bb2..e7bed112b866057a27d3ab3ba76a5722a0dc2561:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 13804f2211..5729c48c65 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -76,6 +76,15 @@ struct wxStrCacheInitializer } }; +/* +wxString::Cache& wxString::GetCache() +{ + static wxTLS_TYPE(Cache) s_cache; + + return wxTLS_VALUE(s_cache); +} +*/ + static wxStrCacheInitializer gs_stringCacheInit; #endif // wxHAS_COMPILER_TLS/!wxHAS_COMPILER_TLS @@ -1267,7 +1276,7 @@ wxString wxString::Right(size_t nCount) const return dest; } -// get all characters after the last occurence of ch +// get all characters after the last occurrence of ch // (returns the whole string if ch not found) wxString wxString::AfterLast(wxUniChar ch) const { @@ -1276,7 +1285,7 @@ wxString wxString::AfterLast(wxUniChar ch) const if ( iPos == wxNOT_FOUND ) str = *this; else - str = wx_str() + iPos + 1; + str.assign(*this, iPos + 1, npos); return str; } @@ -1294,16 +1303,17 @@ wxString wxString::Left(size_t nCount) const return dest; } -// get all characters before the first occurence of ch +// get all characters before the first occurrence of ch // (returns the whole string if ch not found) wxString wxString::BeforeFirst(wxUniChar ch) const { int iPos = Find(ch); - if ( iPos == wxNOT_FOUND ) iPos = length(); + if ( iPos == wxNOT_FOUND ) + iPos = length(); return wxString(*this, 0, iPos); } -/// get all characters before the last occurence of ch +/// get all characters before the last occurrence of ch /// (returns empty string if ch not found) wxString wxString::BeforeLast(wxUniChar ch) const { @@ -1315,19 +1325,19 @@ wxString wxString::BeforeLast(wxUniChar ch) const return str; } -/// get all characters after the first occurence of ch +/// get all characters after the first occurrence of ch /// (returns empty string if ch not found) wxString wxString::AfterFirst(wxUniChar ch) const { wxString str; int iPos = Find(ch); if ( iPos != wxNOT_FOUND ) - str = wx_str() + iPos + 1; + str.assign(*this, iPos + 1, npos); return str; } -// replace first (or all) occurences of some substring with another one +// replace first (or all) occurrences of some substring with another one size_t wxString::Replace(const wxString& strOld, const wxString& strNew, bool bReplaceAll) { @@ -2114,10 +2124,14 @@ wxUTF8StringBufferLength::~wxUTF8StringBufferLength() // wxCharBufferType // ---------------------------------------------------------------------------- +#ifndef __VMS_BROKEN_TEMPLATES template<> +#endif wxCharTypeBuffer::Data wxCharTypeBuffer::NullData(NULL); +#ifndef __VMS_BROKEN_TEMPLATES template<> +#endif wxCharTypeBuffer::Data wxCharTypeBuffer::NullData(NULL);