added FromAscii(unsigned char *) overloads
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -774,9 +774,13 @@ This is a convenience method useful when storing binary data in wxString.
|
||||
|
||||
\func{static wxString }{FromAscii}{\param{const char*}{ s}}
|
||||
|
||||
\func{static wxString }{FromAscii}{\param{const unsigned char*}{ s}}
|
||||
|
||||
\func{static wxString }{FromAscii}{\param{const char*}{ s}, \param{size\_t}{ len}}
|
||||
|
||||
\func{static wxString }{FromAscii}{\param{const char}{ c}}
|
||||
\func{static wxString }{FromAscii}{\param{const unsigned char*}{ s}, \param{size\_t}{ len}}
|
||||
|
||||
\func{static wxString }{FromAscii}{\param{char}{ c}}
|
||||
|
||||
Converts the string or character from an ASCII, 7-bit form
|
||||
to the native wxString representation. Most useful when using
|
||||
|
@@ -1238,18 +1238,25 @@ public:
|
||||
// the behaviour of these functions with the strings containing anything
|
||||
// else than 7 bit ASCII characters is undefined, use at your own risk.
|
||||
#if wxUSE_UNICODE
|
||||
static wxString FromAscii(const char *ascii, size_t len); // string
|
||||
static wxString FromAscii(const char *ascii); // string
|
||||
static wxString FromAscii(const char ascii); // char
|
||||
static wxString FromAscii(const char *ascii, size_t len);
|
||||
static wxString FromAscii(const char *ascii);
|
||||
static wxString FromAscii(char ascii);
|
||||
const wxCharBuffer ToAscii() 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(const char ascii) { return wxString( ascii ); }
|
||||
static wxString FromAscii(char ascii) { return wxString( ascii ); }
|
||||
const char *ToAscii() const { return c_str(); }
|
||||
#endif // Unicode/!Unicode
|
||||
|
||||
// also provide unsigned char overloads as signed/unsigned doesn't matter
|
||||
// for 7 bit ASCII characters
|
||||
static wxString FromAscii(const unsigned char *ascii)
|
||||
{ return FromAscii((const char *)ascii); }
|
||||
static wxString FromAscii(const unsigned char *ascii, size_t len)
|
||||
{ return FromAscii((const char *)ascii, len); }
|
||||
|
||||
// conversion to/from UTF-8:
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
static wxString FromUTF8(const char *utf8)
|
||||
|
Reference in New Issue
Block a user