reimplemented wx[W]CharBuffer using templates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-03-22 23:31:08 +00:00
parent 17709275f9
commit d18c8d3d94
2 changed files with 122 additions and 110 deletions

View File

@@ -2044,20 +2044,11 @@ inline wxString& wxString::operator=(const wxCStrData& cstr)
// implementation of wx[W]CharBuffer inline methods using wxCStrData
// ----------------------------------------------------------------------------
#if wxUSE_UNICODE
inline wxWCharBuffer::wxWCharBuffer(const wxCStrData& cstr)
: m_str(wxStrdupW(cstr))
// FIXME-UTF8: move this to buffer.h; provide versions for both variants
template<>
inline void wxCharTypeBuffer<wxChar>::FromCStrData(const wxCStrData& cstr)
{
m_str = wxStrDup(cstr.AsString());
}
#else // !wxUSE_UNICODE
inline wxCharBuffer::wxCharBuffer(const wxCStrData& cstr)
: m_str(wxStrdupA(cstr))
{
}
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
#endif // _WX_WXSTRINGH__