X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe1b98f5d55ae9d518b59072c38bd73955c2555d..50ccc908dc4e6376de91edd7f74018898fd690b1:/include/wx/string.h diff --git a/include/wx/string.h b/include/wx/string.h index 8178d100d9..7c4bf74d87 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -380,8 +380,9 @@ protected: #if wxUSE_UNICODE_UTF8 // see the comment near wxString::iterator for why we need this -struct WXDLLIMPEXP_BASE wxStringIteratorNode +class WXDLLIMPEXP_BASE wxStringIteratorNode { +public: wxStringIteratorNode() : m_str(NULL), m_citer(NULL), m_iter(NULL), m_prev(NULL), m_next(NULL) {} wxStringIteratorNode(const wxString *str, @@ -933,7 +934,7 @@ public: wxString(const wxString& stringSrc) : m_impl(stringSrc.m_impl) { } // string containing nRepeat copies of ch - wxString(wxUniChar ch, size_t nRepeat = 1) + wxString(wxUniChar ch, size_t nRepeat = 1 ) { assign(nRepeat, ch); } wxString(size_t nRepeat, wxUniChar ch) { assign(nRepeat, ch); } @@ -1371,11 +1372,7 @@ public: #if wxUSE_WCHAR_T const wxWCharBuffer wc_str(const wxMBConv& conv = wxConvLibc) const; #endif // wxUSE_WCHAR_T -#ifdef __WXOSX__ - const wxCharBuffer fn_str() const { return wxConvFile.cWC2WX( wc_str( wxConvLocal ) ); } -#else - const wxChar* fn_str() const { return c_str(); } -#endif + const wxCharBuffer fn_str() const { return wxConvFile.cWC2WX( wc_str( wxConvLibc ) ); } #endif // Unicode/ANSI // overloaded assignment @@ -2590,12 +2587,6 @@ private: private: wxStringImpl m_impl; -#ifdef __VISUALC__ - // "struct 'ConvertedBuffer' needs to have dll-interface to be used by - // clients of class 'wxString'" - this is private, we don't care - #pragma warning (disable:4251) -#endif - // buffers for compatibility conversion from (char*)c_str() and // (wchar_t*)c_str(): // FIXME-UTF8: bechmark various approaches to keeping compatibility buffers @@ -2624,10 +2615,6 @@ private: ConvertedBuffer m_convertedToWChar; #endif -#ifdef __VISUALC__ - #pragma warning (default:4251) -#endif - #if wxUSE_UNICODE_UTF8 // FIXME-UTF8: (try to) move this elsewhere (TLS) or solve differently // assigning to character pointer to by wxString::interator may @@ -2766,7 +2753,7 @@ private: #endif // !wxUSE_STL_BASED_WXSTRING template -class wxStringTypeBufferBase +class WXDLLIMPEXP_BASE wxStringTypeBufferBase { public: typedef T CharType; @@ -2784,7 +2771,7 @@ protected: }; template -class wxStringTypeBufferLengthBase +class WXDLLIMPEXP_BASE wxStringTypeBufferLengthBase { public: typedef T CharType; @@ -2834,6 +2821,9 @@ public: }; #if wxUSE_STL_BASED_WXSTRING + +WXDLLIMPEXP_TEMPLATE_INSTANCE_BASE( wxStringTypeBufferBase ) + class wxStringInternalBuffer : public wxStringTypeBufferBase { public: @@ -2845,7 +2835,11 @@ public: DECLARE_NO_COPY_CLASS(wxStringInternalBuffer) }; -class wxStringInternalBufferLength : public wxStringTypeBufferLengthBase +WXDLLIMPEXP_TEMPLATE_INSTANCE_BASE( + wxStringTypeBufferLengthBase ) + +class wxStringInternalBufferLength + : public wxStringTypeBufferLengthBase { public: wxStringInternalBufferLength(wxString& str, size_t lenWanted = 1024) @@ -2874,6 +2868,9 @@ typedef wxStringInternalBufferLength wxStringBufferLength; typedef wxStringInternalBuffer wxUTF8StringBuffer; typedef wxStringInternalBufferLength wxUTF8StringBufferLength; #elif wxUSE_UNICODE_WCHAR + +WXDLLIMPEXP_TEMPLATE_INSTANCE_BASE( wxStringTypeBufferBase ) + class WXDLLIMPEXP_BASE wxUTF8StringBuffer : public wxStringTypeBufferBase { public: @@ -2884,6 +2881,8 @@ public: DECLARE_NO_COPY_CLASS(wxUTF8StringBuffer) }; +WXDLLIMPEXP_TEMPLATE_INSTANCE_BASE( wxStringTypeBufferLengthBase ) + class WXDLLIMPEXP_BASE wxUTF8StringBufferLength : public wxStringTypeBufferLengthBase { @@ -3019,7 +3018,15 @@ WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxCharBuffer&); WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxWCharBuffer&); #endif -#endif // wxSTD_STRING_COMPATIBILITY +#if wxUSE_UNICODE && defined(HAVE_WOSTREAM) + +WXDLLIMPEXP_BASE wxSTD wostream& operator<<(wxSTD wostream&, const wxString&); +WXDLLIMPEXP_BASE wxSTD wostream& operator<<(wxSTD wostream&, const wxCStrData&); +WXDLLIMPEXP_BASE wxSTD wostream& operator<<(wxSTD wostream&, const wxWCharBuffer&); + +#endif // wxUSE_UNICODE && defined(HAVE_WOSTREAM) + +#endif // wxUSE_STD_IOSTREAM // --------------------------------------------------------------------------- // wxCStrData implementation