wxWidgets3: update to svn r70933

This commit is contained in:
Shawn Hoffman
2012-03-17 18:12:27 -07:00
parent 0ed8af2287
commit a648aca65c
906 changed files with 39468 additions and 17244 deletions

View File

@ -4,7 +4,7 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id: string.h 67181 2011-03-13 13:53:54Z VZ $
// RCS-ID: $Id: string.h 70796 2012-03-04 00:29:31Z VZ $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -24,7 +24,6 @@
#include "wx/defs.h" // everybody should include this
#ifndef __WXPALMOS5__
#if defined(__WXMAC__) || defined(__VISAGECPP__)
#include <ctype.h>
#endif
@ -47,7 +46,6 @@
#ifdef HAVE_STRCASECMP_IN_STRINGS_H
#include <strings.h> // for strcasecmp()
#endif // HAVE_STRCASECMP_IN_STRINGS_H
#endif // ! __WXPALMOS5__
#include "wx/wxcrtbase.h" // for wxChar, wxStrlen() etc.
#include "wx/strvararg.h"
@ -71,7 +69,7 @@
// it would have to be re-tested and probably corrected
// CS: under OSX release builds the string destructor/cache cleanup sometimes
// crashes, disable until we find the true reason or a better workaround
#if wxUSE_UNICODE_UTF8 && !defined(__WXMSW__) && !defined(__WXOSX__)
#if wxUSE_UNICODE_UTF8 && !defined(__WINDOWS__) && !defined(__WXOSX__)
#define wxUSE_STRING_POS_CACHE 1
#else
#define wxUSE_STRING_POS_CACHE 0
@ -170,8 +168,7 @@ inline int Stricmp(const char *psz1, const char *psz2)
return stricmp(psz1, psz2);
#elif defined(__WXPM__)
return stricmp(psz1, psz2);
#elif defined(__WXPALMOS__) || \
defined(HAVE_STRCASECMP_IN_STRING_H) || \
#elif defined(HAVE_STRCASECMP_IN_STRING_H) || \
defined(HAVE_STRCASECMP_IN_STRINGS_H) || \
defined(__GNUWIN32__)
return strcasecmp(psz1, psz2);
@ -1345,12 +1342,13 @@ public:
}
#endif // wxUSE_STRING_POS_CACHE
// even if we're not built with wxUSE_STL == 1 it is very convenient to allow
// implicit conversions from std::string to wxString and vice verse as this
// allows to use the same strings in non-GUI and GUI code, however we don't
// want to unconditionally add this ctor as it would make wx lib dependent on
// libstdc++ on some Linux versions which is bad, so instead we ask the
// client code to define this wxUSE_STD_STRING symbol if they need it
// even if we're not built with wxUSE_STD_STRING_CONV_IN_WXSTRING == 1 it is
// very convenient to allow implicit conversions from std::string to wxString
// and vice verse as this allows to use the same strings in non-GUI and GUI
// code, however we don't want to unconditionally add this ctor as it would
// make wx lib dependent on libstdc++ on some Linux versions which is bad, so
// instead we ask the client code to define this wxUSE_STD_STRING symbol if
// they need it
#if wxUSE_STD_STRING
#if wxUSE_UNICODE_WCHAR
wxString(const wxStdWideString& str) : m_impl(str) {}
@ -1368,10 +1366,8 @@ public:
#endif
#endif // wxUSE_STD_STRING
// Unlike ctor from std::string, we provide conversion to std::string only
// if wxUSE_STL and not merely wxUSE_STD_STRING (which is on by default),
// because it conflicts with operator const char/wchar_t* but we still
// provide explicit conversions to std::[w]string for convenience in any case
// Also always provide explicit conversions to std::[w]string in any case,
// see below for the implicit ones.
#if wxUSE_STD_STRING
// We can avoid a copy if we already use this string type internally,
// otherwise we create a copy on the fly:
@ -1408,13 +1404,14 @@ public:
}
#endif
#if wxUSE_STL
// In wxUSE_STL case we also provide implicit conversions as there is no
// ambiguity with the const char/wchar_t* ones as they are disabled in this
// build (for consistency with std::basic_string<>)
#if wxUSE_STD_STRING_CONV_IN_WXSTRING
// Implicit conversions to std::[w]string are not provided by default as
// they conflict with the implicit conversions to "const char/wchar_t *"
// which we use for backwards compatibility but do provide them if
// explicitly requested.
operator wxStringToStdStringRetType() const { return ToStdString(); }
operator wxStringToStdWstringRetType() const { return ToStdWstring(); }
#endif // wxUSE_STL
#endif // wxUSE_STD_STRING_CONV_IN_WXSTRING
#undef wxStringToStdStringRetType
#undef wxStringToStdWstringRetType
@ -1654,11 +1651,12 @@ public:
operator wxCStrData() const { return c_str(); }
// the first two operators conflict with operators for conversion to
// std::string and they must be disabled in STL build; the next one only
// makes sense if conversions to char* are also defined and not defining it
// in STL build also helps us to get more clear error messages for the code
// which relies on implicit conversion to char* in STL build
#if !wxUSE_STL
// std::string and they must be disabled if those conversions are enabled;
// the next one only makes sense if conversions to char* are also defined
// and not defining it in STL build also helps us to get more clear error
// messages for the code which relies on implicit conversion to char* in
// STL build
#if !wxUSE_STD_STRING_CONV_IN_WXSTRING
operator const char*() const { return c_str(); }
operator const wchar_t*() const { return c_str(); }
@ -1666,7 +1664,7 @@ public:
// wxWidgets versions: this is the same as conversion to const char * so it
// may fail!
operator const void*() const { return c_str(); }
#endif // wxUSE_STL
#endif // !wxUSE_STD_STRING_CONV_IN_WXSTRING
// identical to c_str(), for MFC compatibility
const wxCStrData GetData() const { return c_str(); }