diff options
Diffstat (limited to 'src/FbTk/FbString.hh')
-rw-r--r-- | src/FbTk/FbString.hh | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/FbTk/FbString.hh b/src/FbTk/FbString.hh index e1a5dc5..55798e5 100644 --- a/src/FbTk/FbString.hh +++ b/src/FbTk/FbString.hh | |||
@@ -36,6 +36,25 @@ namespace FbTk { | |||
36 | // (or just plain whatever for now if no utf-8 available) | 36 | // (or just plain whatever for now if no utf-8 available) |
37 | typedef std::string FbString; | 37 | typedef std::string FbString; |
38 | 38 | ||
39 | class BiDiString { | ||
40 | |||
41 | public: | ||
42 | |||
43 | BiDiString(const FbString& logical = FbString()); | ||
44 | |||
45 | const FbString& logical() const { return m_logical; } | ||
46 | const FbString& visual() const; | ||
47 | |||
48 | const FbString& setLogical(const FbString& logical); | ||
49 | |||
50 | private: | ||
51 | FbString m_logical; | ||
52 | #ifdef HAVE_FRIBIDI | ||
53 | mutable FbString m_visual; | ||
54 | mutable bool m_visual_dirty; | ||
55 | #endif | ||
56 | }; | ||
57 | |||
39 | namespace FbStringUtil { | 58 | namespace FbStringUtil { |
40 | 59 | ||
41 | void init(); | 60 | void init(); |
@@ -52,11 +71,6 @@ std::string FbStrToX(const FbString &src); | |||
52 | FbString LocaleStrToFb(const std::string &src); | 71 | FbString LocaleStrToFb(const std::string &src); |
53 | std::string FbStrToLocale(const FbString &src); | 72 | std::string FbStrToLocale(const FbString &src); |
54 | 73 | ||
55 | #ifdef HAVE_FRIBIDI | ||
56 | /// Make Bidi | ||
57 | FbString BidiLog2Vis (const FbString& src); | ||
58 | #endif | ||
59 | |||
60 | bool haveUTF8(); | 74 | bool haveUTF8(); |
61 | 75 | ||
62 | } // namespace FbStringUtil | 76 | } // namespace FbStringUtil |
@@ -70,23 +84,14 @@ public: | |||
70 | ~StringConvertor(); | 84 | ~StringConvertor(); |
71 | 85 | ||
72 | bool setSource(const std::string &encoding); | 86 | bool setSource(const std::string &encoding); |
73 | void reset() { | 87 | void reset(); |
74 | #ifdef HAVE_ICONV | ||
75 | if (m_iconv != ((iconv_t)-1)) | ||
76 | iconv_close(m_iconv); | ||
77 | m_iconv = ((iconv_t)(-1)); | ||
78 | #endif | ||
79 | } | ||
80 | 88 | ||
81 | std::string recode(const std::string &src); | 89 | FbString recode(const FbString &src); |
82 | 90 | ||
83 | private: | 91 | private: |
84 | #ifdef HAVE_ICONV | 92 | #ifdef HAVE_ICONV |
85 | iconv_t m_iconv; | 93 | iconv_t m_iconv; |
86 | #else | ||
87 | int m_iconv; | ||
88 | #endif | 94 | #endif |
89 | |||
90 | std::string m_destencoding; | 95 | std::string m_destencoding; |
91 | }; | 96 | }; |
92 | 97 | ||