X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2523e9b70044baa92a1c63ffdfe179c28ad53536..951f68d01cabb566f1e3015768622c5e040af07a:/include/wx/string.h?ds=sidebyside diff --git a/include/wx/string.h b/include/wx/string.h index 476af64419..43bde5e5c1 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -186,8 +186,9 @@ private: public: // Ctor constructs the object from char literal; they are needed to make // operator?: compile and they intentionally take char*, not const char* - wxCStrData(char *buf); - wxCStrData(wchar_t *buf); + inline wxCStrData(char *buf); + inline wxCStrData(wchar_t *buf); + inline wxCStrData(const wxCStrData& data); inline ~wxCStrData(); @@ -2649,6 +2650,13 @@ inline wxCStrData::wxCStrData(char *buf) inline wxCStrData::wxCStrData(wchar_t *buf) : m_str(new wxString(buf)), m_offset(0), m_owned(true) {} +inline wxCStrData::wxCStrData(const wxCStrData& data) + : m_str(data.m_owned ? new wxString(*data.m_str) : data.m_str), + m_offset(data.m_offset), + m_owned(data.m_owned) +{ +} + inline wxCStrData::~wxCStrData() { if ( m_owned ) @@ -2748,4 +2756,12 @@ inline wxWCharBuffer::wxWCharBuffer(const wxCStrData& cstr) { } +#if WXWIN_COMPATIBILITY_2_8 + // lot of code out there doesn't explicitly include wx/wxchar.h, but uses + // CRT wrappers that are now declared in wx/wxcrt.h and wx/wxcrtvararg.h, + // so let's include this header now that wxString is defined and it's safe + // to do it: + #include "wx/wxchar.h" +#endif + #endif // _WX_WXSTRING_H_