VideoTools
|
A static class which provides string encoding conversion functions. More...
#include <gconvert.h>
Classes | |
struct | ThrowOnError |
Holds context information which convert() adds to the exception when it fails. More... | |
struct | utf8 |
A string wrapper that indicates UTF-8 encoding. More... | |
Public Types | |
typedef std::basic_string< TCHAR > | tstring |
Public Member Functions | |
G_EXCEPTION_CLASS (Error,"string conversion error") | |
Static Public Member Functions | |
static void | convert (utf8 &utf_out, const std::string &in_) |
Converts between string types/encodings: ansi to utf8. More... | |
static void | convert (utf8 &utf_out, const utf8 &in_) |
Converts between string types/encodings: utf8 to utf8. More... | |
static void | convert (utf8 &utf_out, const std::wstring &in_) |
Converts between string types/encodings: utf16 to utf8. More... | |
static void | convert (std::string &ansi_out, const std::string &in_) |
Converts between string types/encodings: ansi to ansi. More... | |
static void | convert (std::string &ansi_out, const utf8 &in_, const ThrowOnError &) |
Converts between string types/encodings: utf8 to ansi. More... | |
static void | convert (std::string &ansi_out, const std::wstring &in_, const ThrowOnError &) |
Converts between string types/encodings: utf16 to ansi. More... | |
static void | convert (std::wstring &wide_out, const std::string &ansi_in) |
Converts between string types/encodings: ansi to utf16. More... | |
static void | convert (std::wstring &wide_out, const utf8 &utf_in) |
Converts between string types/encodings: utf8 to utf16. More... | |
static void | convert (std::wstring &wide_out, const std::wstring &wide_in) |
Converts between string types/encodings: utf8 to utf16. More... | |
static void | convert (std::string &ansi_out, const std::string &in_, const ThrowOnError &) |
An overload for TCHAR shenanigans on windows. More... | |
A static class which provides string encoding conversion functions.
Supported encodings are "ANSI" (CP-1252/ISO-8859-1) char, UTF-16 wchar, and UTF-8 multi-byte char. Conversions that can fail take a ThrowOnError parameter which is used to add context information to the G::Convert::Error exception that is thrown.
Eg:
Definition at line 57 of file gconvert.h.
|
static |
Converts between string types/encodings: ansi to utf8.
Definition at line 44 of file gconvert.cpp.
Converts between string types/encodings: utf8 to utf8.
Definition at line 24 of file gconvert.cpp.
|
static |
Converts between string types/encodings: utf16 to utf8.
Definition at line 49 of file gconvert.cpp.
|
static |
Converts between string types/encodings: ansi to ansi.
Definition at line 29 of file gconvert.cpp.
|
static |
Converts between string types/encodings: utf8 to ansi.
Definition at line 54 of file gconvert.cpp.
|
static |
Converts between string types/encodings: utf16 to ansi.
Definition at line 59 of file gconvert.cpp.
|
static |
Converts between string types/encodings: ansi to utf16.
Definition at line 64 of file gconvert.cpp.
|
static |
Converts between string types/encodings: utf8 to utf16.
Definition at line 69 of file gconvert.cpp.
|
static |
Converts between string types/encodings: utf8 to utf16.
Definition at line 39 of file gconvert.cpp.
|
static |
An overload for TCHAR shenanigans on windows.
Converts between string types/encodings: ansi to ansi.
Definition at line 34 of file gconvert.cpp.