60 G_EXCEPTION_CLASS( Error ,
"string conversion error" ) ;
61 typedef std::basic_string<TCHAR> tstring ;
66 explicit utf8(
const std::string & s_ ) : s(s_) {}
73 explicit ThrowOnError(
const std::string & context_ ) : context(context_) {}
77 static void convert(
utf8 & utf_out ,
const std::string & in_ ) ;
85 static void convert(
utf8 & utf_out ,
const std::wstring & in_ ) ;
89 static void convert( std::string & ansi_out ,
const std::string & in_ ) ;
97 static void convert( std::string & ansi_out ,
const std::wstring & in_ ,
const ThrowOnError & ) ;
101 static void convert( std::wstring & wide_out ,
const std::string & ansi_in ) ;
105 static void convert( std::wstring & wide_out ,
const utf8 & utf_in ) ;
109 static void convert( std::wstring & wide_out ,
const std::wstring & wide_in ) ;
113 static void convert( std::string & ansi_out ,
const std::string & in_ ,
const ThrowOnError & ) ;
119 static std::string narrow(
const std::wstring & s ,
bool is_utf8 ,
const std::string & = std::string() ) ;
120 static std::wstring widen(
const std::string & s ,
bool is_utf8 ,
const std::string & = std::string() ) ;
static void convert(utf8 &utf_out, const std::string &in_)
Converts between string types/encodings: ansi to utf8.
A static class which provides string encoding conversion functions.
Holds context information which convert() adds to the exception when it fails.
A string wrapper that indicates UTF-8 encoding.