add support for Ayatana indicator to Notification plugin
[claws.git] / src / plugins / litehtml_viewer / litehtml / utf8_strings.h
blob72969fd3d77b2675c26245ec6b75e4c01fef5897
1 #ifndef LH_UTF8_STRINGS_H
2 #define LH_UTF8_STRINGS_H
4 #include "os_types.h"
5 #include "types.h"
7 namespace litehtml
9 class utf8_to_wchar
11 const byte* m_utf8;
12 std::wstring m_str;
13 public:
14 utf8_to_wchar(const char* val);
15 operator const wchar_t*() const
17 return m_str.c_str();
19 private:
20 ucode_t getb()
22 if (!(*m_utf8)) return 0;
23 return *m_utf8++;
25 ucode_t get_next_utf8(ucode_t val)
27 return (val & 0x3f);
29 ucode_t get_char();
32 class wchar_to_utf8
34 std::string m_str;
35 public:
36 wchar_to_utf8(const std::wstring& val);
37 operator const char*() const
39 return m_str.c_str();
42 const char* c_str() const
44 return m_str.c_str();
48 #define litehtml_from_wchar(str) litehtml::wchar_to_utf8(str)
49 #define litehtml_to_wchar(str) litehtml::utf8_to_wchar(str)
52 #endif // LH_UTF8_STRINGS_H