Allow specifying the replacement character in wxString::ToAscii()
Don't hardcode "_" as the replacement character but accept the one specified by the user. Closes https://github.com/wxWidgets/wxWidgets/pull/116
This commit is contained in:
committed by
Vadim Zeitlin
parent
cfd4da8fdb
commit
28bc1bdac0
@@ -1556,13 +1556,13 @@ public:
|
||||
static wxString FromAscii(const char *ascii, size_t len);
|
||||
static wxString FromAscii(const char *ascii);
|
||||
static wxString FromAscii(char ascii);
|
||||
const wxScopedCharBuffer ToAscii() const;
|
||||
const wxScopedCharBuffer ToAscii(char replaceWith = '_') const;
|
||||
#else // ANSI
|
||||
static wxString FromAscii(const char *ascii) { return wxString( ascii ); }
|
||||
static wxString FromAscii(const char *ascii, size_t len)
|
||||
{ return wxString( ascii, len ); }
|
||||
static wxString FromAscii(char ascii) { return wxString( ascii ); }
|
||||
const char *ToAscii() const { return c_str(); }
|
||||
const char *ToAscii(char WXUNUSED(replaceWith) = '_') const { return c_str(); }
|
||||
#endif // Unicode/!Unicode
|
||||
|
||||
// also provide unsigned char overloads as signed/unsigned doesn't matter
|
||||
|
Reference in New Issue
Block a user