]> git.sesse.net Git - ccbs/blob - bigscreen/widestring.h
Shape text using Pango and HarfBuzz; gives us nice ligatures and exotic scripts.
[ccbs] / bigscreen / widestring.h
1 #ifndef _WIDESTRING_H
2 #define _WIDESTRING_H 1
3
4 #include <string>
5 #include <pqxx/util>
6
7 // UCS-4 string with support for getting from UTF-8
8 class widestring : public std::wstring
9 {
10 public:
11         widestring();
12         widestring(const char *from);
13         widestring(const std::string &from);
14         widestring(const std::wstring &from);
15         void operator= (const char *from);
16         std::string to_utf8() const;
17 };
18
19 namespace pqxx
20 {
21
22 template<>
23 inline void from_string<widestring>(const char *from, widestring &to)
24 {
25         to = from;
26 }
27
28 }
29
30 #endif /* !defined(_WIDESTRING_H) */