diff options
Diffstat (limited to 'src/FbTk/FbString.hh')
-rw-r--r-- | src/FbTk/FbString.hh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/FbTk/FbString.hh b/src/FbTk/FbString.hh index 011d47a..cfa44d9 100644 --- a/src/FbTk/FbString.hh +++ b/src/FbTk/FbString.hh | |||
@@ -52,6 +52,26 @@ std::string FbStrToLocale(const FbString &src); | |||
52 | bool haveUTF8(); | 52 | bool haveUTF8(); |
53 | 53 | ||
54 | } // namespace FbStringUtil | 54 | } // namespace FbStringUtil |
55 | |||
56 | class StringConvertor { | ||
57 | public: | ||
58 | |||
59 | enum EncodingTarget { ToFbString, ToLocaleStr }; | ||
60 | |||
61 | StringConvertor(EncodingTarget target); | ||
62 | ~StringConvertor(); | ||
63 | |||
64 | bool setSource(const std::string &encoding); | ||
65 | void reset() { m_iconv = ((iconv_t)(-1)); } | ||
66 | |||
67 | std::string recode(const std::string &src); | ||
68 | |||
69 | private: | ||
70 | iconv_t m_iconv; | ||
71 | |||
72 | std::string m_destencoding; | ||
73 | }; | ||
74 | |||
55 | } // namespace FbTk | 75 | } // namespace FbTk |
56 | 76 | ||
57 | #endif // FBTK_FBSTRING_HH | 77 | #endif // FBTK_FBSTRING_HH |