aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/FbString.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/FbString.hh')
-rw-r--r--src/FbTk/FbString.hh37
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)
37typedef std::string FbString; 37typedef std::string FbString;
38 38
39class BiDiString {
40
41public:
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
50private:
51 FbString m_logical;
52#ifdef HAVE_FRIBIDI
53 mutable FbString m_visual;
54 mutable bool m_visual_dirty;
55#endif
56};
57
39namespace FbStringUtil { 58namespace FbStringUtil {
40 59
41void init(); 60void init();
@@ -52,11 +71,6 @@ std::string FbStrToX(const FbString &src);
52FbString LocaleStrToFb(const std::string &src); 71FbString LocaleStrToFb(const std::string &src);
53std::string FbStrToLocale(const FbString &src); 72std::string FbStrToLocale(const FbString &src);
54 73
55#ifdef HAVE_FRIBIDI
56/// Make Bidi
57FbString BidiLog2Vis (const FbString& src);
58#endif
59
60bool haveUTF8(); 74bool 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
83private: 91private:
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