X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Fwidestring.h;h=1e4f9a2640cd2cd09d35af5b84cbdc5fd96f2f6a;hp=437428c8ad316ff2c05341935053fb81c2275f07;hb=HEAD;hpb=00cc6937fb4d2d0525c90536697fc88eea3d0d6e diff --git a/bigscreen/widestring.h b/bigscreen/widestring.h index 437428c..1e4f9a2 100644 --- a/bigscreen/widestring.h +++ b/bigscreen/widestring.h @@ -2,6 +2,7 @@ #define _WIDESTRING_H 1 #include +#include // UCS-4 string with support for getting from UTF-8 class widestring : public std::wstring @@ -9,7 +10,21 @@ class widestring : public std::wstring public: widestring(); widestring(const char *from); + widestring(const std::string &from); + widestring(const std::wstring &from); void operator= (const char *from); + std::string to_utf8() const; }; +namespace pqxx +{ + +template<> +inline void from_string(const char *from, widestring &to) +{ + to = from; +} + +} + #endif /* !defined(_WIDESTRING_H) */