Use wxScopedCharBuffer in To8BitData() in ANSI build too.

This allows one to write code compatible with both Unicode and ANSI
builds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2010-07-01 15:28:30 +00:00
parent 227c030f98
commit 908c405611
2 changed files with 3 additions and 7 deletions

View File

@@ -1800,7 +1800,8 @@ public:
// version for NUL-terminated data:
static wxString From8BitData(const char *data)
{ return wxString(data); }
const char *To8BitData() const { return c_str(); }
const wxScopedCharBuffer To8BitData() const
{ return wxScopedCharBuffer::CreateNonOwned(wx_str(), length()); }
#endif // Unicode/ANSI
// conversions with (possible) format conversions: have to return a

View File

@@ -492,12 +492,7 @@ public:
@see wxString::From8BitData()
*/
const char* To8BitData() const;
/**
@overload
*/
const wxCharBuffer To8BitData() const;
const wxScopedCharBuffer To8BitData() const;
/**
Converts the string to an ASCII, 7-bit string in the form of