renamed wxImplStringBuffer to wxStringInternalBuffer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48205 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-08-19 21:24:50 +00:00
parent 718fd18080
commit 6798451bb2
2 changed files with 22 additions and 22 deletions

View File

@@ -2644,8 +2644,8 @@ private:
#endif // wxUSE_UNICODE_UTF8 #endif // wxUSE_UNICODE_UTF8
friend class WXDLLIMPEXP_FWD_BASE wxCStrData; friend class WXDLLIMPEXP_FWD_BASE wxCStrData;
friend class wxImplStringBuffer; friend class wxStringInternalBuffer;
friend class wxImplStringBufferLength; friend class wxStringInternalBufferLength;
}; };
#ifdef wxNEEDS_WXSTRING_PRINTF_MIXIN #ifdef wxNEEDS_WXSTRING_PRINTF_MIXIN
@@ -2707,16 +2707,16 @@ inline wxString operator+(wchar_t ch, const wxString& string)
#if !wxUSE_STL_BASED_WXSTRING #if !wxUSE_STL_BASED_WXSTRING
// string buffer for direct access to string data in their native // string buffer for direct access to string data in their native
// representation: // representation:
class wxImplStringBuffer class wxStringInternalBuffer
{ {
public: public:
typedef wxStringCharType CharType; typedef wxStringCharType CharType;
wxImplStringBuffer(wxString& str, size_t lenWanted = 1024) wxStringInternalBuffer(wxString& str, size_t lenWanted = 1024)
: m_str(str), m_buf(NULL) : m_str(str), m_buf(NULL)
{ m_buf = m_str.DoGetWriteBuf(lenWanted); } { m_buf = m_str.DoGetWriteBuf(lenWanted); }
~wxImplStringBuffer() { m_str.DoUngetWriteBuf(); } ~wxStringInternalBuffer() { m_str.DoUngetWriteBuf(); }
operator wxStringCharType*() const { return m_buf; } operator wxStringCharType*() const { return m_buf; }
@@ -2724,22 +2724,22 @@ private:
wxString& m_str; wxString& m_str;
wxStringCharType *m_buf; wxStringCharType *m_buf;
DECLARE_NO_COPY_CLASS(wxImplStringBuffer) DECLARE_NO_COPY_CLASS(wxStringInternalBuffer)
}; };
class wxImplStringBufferLength class wxStringInternalBufferLength
{ {
public: public:
typedef wxStringCharType CharType; typedef wxStringCharType CharType;
wxImplStringBufferLength(wxString& str, size_t lenWanted = 1024) wxStringInternalBufferLength(wxString& str, size_t lenWanted = 1024)
: m_str(str), m_buf(NULL), m_len(0), m_lenSet(false) : m_str(str), m_buf(NULL), m_len(0), m_lenSet(false)
{ {
m_buf = m_str.DoGetWriteBuf(lenWanted); m_buf = m_str.DoGetWriteBuf(lenWanted);
wxASSERT(m_buf != NULL); wxASSERT(m_buf != NULL);
} }
~wxImplStringBufferLength() ~wxStringInternalBufferLength()
{ {
wxASSERT(m_lenSet); wxASSERT(m_lenSet);
m_str.DoUngetWriteBuf(m_len); m_str.DoUngetWriteBuf(m_len);
@@ -2754,7 +2754,7 @@ private:
size_t m_len; size_t m_len;
bool m_lenSet; bool m_lenSet;
DECLARE_NO_COPY_CLASS(wxImplStringBufferLength) DECLARE_NO_COPY_CLASS(wxStringInternalBufferLength)
}; };
#endif // !wxUSE_STL_BASED_WXSTRING #endif // !wxUSE_STL_BASED_WXSTRING
@@ -2834,30 +2834,30 @@ public:
}; };
#if wxUSE_STL_BASED_WXSTRING #if wxUSE_STL_BASED_WXSTRING
class wxImplStringBuffer : public wxStringTypeBufferBase<wxStringCharType> class wxStringInternalBuffer : public wxStringTypeBufferBase<wxStringCharType>
{ {
public: public:
wxImplStringBuffer(wxString& str, size_t lenWanted = 1024) wxStringInternalBuffer(wxString& str, size_t lenWanted = 1024)
: wxStringTypeBufferBase<wxStringCharType>(str, lenWanted) {} : wxStringTypeBufferBase<wxStringCharType>(str, lenWanted) {}
~wxImplStringBuffer() ~wxStringInternalBuffer()
{ m_str.m_impl.assign(m_buf.data()); } { m_str.m_impl.assign(m_buf.data()); }
DECLARE_NO_COPY_CLASS(wxImplStringBuffer) DECLARE_NO_COPY_CLASS(wxStringInternalBuffer)
}; };
class wxImplStringBufferLength : public wxStringTypeBufferLengthBase<wxStringCharType> class wxStringInternalBufferLength : public wxStringTypeBufferLengthBase<wxStringCharType>
{ {
public: public:
wxImplStringBufferLength(wxString& str, size_t lenWanted = 1024) wxStringInternalBufferLength(wxString& str, size_t lenWanted = 1024)
: wxStringTypeBufferLengthBase<wxStringCharType>(str, lenWanted) {} : wxStringTypeBufferLengthBase<wxStringCharType>(str, lenWanted) {}
~wxImplStringBufferLength() ~wxStringInternalBufferLength()
{ {
wxASSERT(m_lenSet); wxASSERT(m_lenSet);
m_str.m_impl.assign(m_buf.data(), m_len); m_str.m_impl.assign(m_buf.data(), m_len);
} }
DECLARE_NO_COPY_CLASS(wxImplStringBufferLength) DECLARE_NO_COPY_CLASS(wxStringInternalBufferLength)
}; };
#endif // wxUSE_STL_BASED_WXSTRING #endif // wxUSE_STL_BASED_WXSTRING
@@ -2866,8 +2866,8 @@ public:
typedef wxStringTypeBuffer<wxChar> wxStringBuffer; typedef wxStringTypeBuffer<wxChar> wxStringBuffer;
typedef wxStringTypeBufferLength<wxChar> wxStringBufferLength; typedef wxStringTypeBufferLength<wxChar> wxStringBufferLength;
#else // if !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 #else // if !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8
typedef wxImplStringBuffer wxStringBuffer; typedef wxStringInternalBuffer wxStringBuffer;
typedef wxImplStringBufferLength wxStringBufferLength; typedef wxStringInternalBufferLength wxStringBufferLength;
#endif // !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 #endif // !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

View File

@@ -986,7 +986,7 @@ wxString wxString::FromAscii(const char *ascii, size_t len)
wxString res; wxString res;
{ {
wxImplStringBuffer buf(res, len); wxStringInternalBuffer buf(res, len);
wxStringCharType *dest = buf; wxStringCharType *dest = buf;
for ( ; len > 0; --len ) for ( ; len > 0; --len )
@@ -1644,7 +1644,7 @@ int wxString::PrintfV(const wxString& format, va_list argptr)
#if wxUSE_STL_BASED_WXSTRING #if wxUSE_STL_BASED_WXSTRING
typedef wxStringTypeBuffer<char> Utf8Buffer; typedef wxStringTypeBuffer<char> Utf8Buffer;
#else #else
typedef wxImplStringBuffer Utf8Buffer; typedef wxStringInternalBuffer Utf8Buffer;
#endif #endif
#endif #endif