]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/unichar.h
OS X compilation fix
[wxWidgets.git] / include / wx / unichar.h
index 352018ef25082dc70b35af6ed9b858b643c8f39d..0ecba58e9afff08e7fc4b489b3f16ef0f1a1dcb7 100644 (file)
@@ -71,6 +71,19 @@ public:
     // Returns Unicode code point value of the character
     value_type GetValue() const { return m_value; }
 
+#if wxUSE_UNICODE_UTF8
+    // buffer for single UTF-8 character
+    struct Utf8CharBuffer
+    {
+        char data[5];
+        operator const char*() const { return data; }
+    };
+
+    // returns the character encoded as UTF-8
+    // (NB: implemented in stringops.cpp)
+    Utf8CharBuffer AsUTF8() const;
+#endif // wxUSE_UNICODE_UTF8
+
     // Returns true if the character is an ASCII character:
     bool IsAscii() const { return m_value < 0x80; }
 
@@ -182,6 +195,11 @@ public:
 #endif
 
     wxUniChar::value_type GetValue() const { return UniChar().GetValue(); }
+
+#if wxUSE_UNICODE_UTF8
+    wxUniChar::Utf8CharBuffer AsUTF8() const { return UniChar().AsUTF8(); }
+#endif // wxUSE_UNICODE_UTF8
+
     bool IsAscii() const { return UniChar().IsAscii(); }
 
     // Assignment operators: