]> git.saurik.com Git - wxWidgets.git/commitdiff
wxUniChar::unicode_type -> value_type
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 19 Mar 2007 16:17:37 +0000 (16:17 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 19 Mar 2007 16:17:37 +0000 (16:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/unichar.h
src/common/unichar.cpp

index e3eb6f0250e3374ab1f9efbe35d590b9a2116780..75a01f62db11603095514d9884e24ae8b6adfb42 100644 (file)
@@ -23,7 +23,7 @@ public:
     // NB: this is not wchar_t on purpose, it needs to represent the entire
     //     Unicode code points range and wchar_t may be too small for that
     //     (e.g. on Win32 where wchar_t* is encoded in UTF-16)
-    typedef unsigned int unicode_type;
+    typedef unsigned int value_type;
 
     wxUniChar() : m_value(0) {}
 
@@ -44,7 +44,7 @@ public:
     wxUniChar(const wxUniCharRef& c);
 
     // Returns Unicode code point value of the character
-    unicode_type GetValue() const { return m_value; }
+    value_type GetValue() const { return m_value; }
 
     // Casts to char and wchar_t types:
     operator char() const { return To8bit(m_value); }
@@ -79,59 +79,59 @@ public:
     // Comparision operators:
     bool operator==(const wxUniChar& c) const { return m_value == c.m_value; }
     bool operator==(char c) const { return m_value == From8bit(c); }
-    bool operator==(wchar_t c) const { return m_value == (unicode_type)c; }
+    bool operator==(wchar_t c) const { return m_value == (value_type)c; }
 #ifndef wxWINT_T_IS_TYPEDEF
-    bool operator==(wint_t c) const { return m_value == (unicode_type)c; }
+    bool operator==(wint_t c) const { return m_value == (value_type)c; }
 #endif
 
     bool operator!=(const wxUniChar& c) const { return m_value != c.m_value; }
     bool operator!=(char c) const { return m_value != From8bit(c); }
-    bool operator!=(wchar_t c) const { return m_value != (unicode_type)c; }
+    bool operator!=(wchar_t c) const { return m_value != (value_type)c; }
 #ifndef wxWINT_T_IS_TYPEDEF
-    bool operator!=(wint_t c) const { return m_value != (unicode_type)c; }
+    bool operator!=(wint_t c) const { return m_value != (value_type)c; }
 #endif
 
     bool operator>(const wxUniChar& c) const { return m_value > c.m_value; }
-    bool operator>(char c) const { return m_value > (unicode_type)c; }
-    bool operator>(wchar_t c) const { return m_value > (unicode_type)c; }
+    bool operator>(char c) const { return m_value > (value_type)c; }
+    bool operator>(wchar_t c) const { return m_value > (value_type)c; }
 #ifndef wxWINT_T_IS_TYPEDEF
-    bool operator>(wint_t c) const { return m_value > (unicode_type)c; }
+    bool operator>(wint_t c) const { return m_value > (value_type)c; }
 #endif
 
     bool operator<(const wxUniChar& c) const { return m_value < c.m_value; }
     bool operator<(char c) const { return m_value < From8bit(c); }
-    bool operator<(wchar_t c) const { return m_value < (unicode_type)c; }
+    bool operator<(wchar_t c) const { return m_value < (value_type)c; }
 #ifndef wxWINT_T_IS_TYPEDEF
-    bool operator<(wint_t c) const { return m_value < (unicode_type)c; }
+    bool operator<(wint_t c) const { return m_value < (value_type)c; }
 #endif
 
     bool operator>=(const wxUniChar& c) const { return m_value >= c.m_value; }
     bool operator>=(char c) const { return m_value >= From8bit(c); }
-    bool operator>=(wchar_t c) const { return m_value >= (unicode_type)c; }
+    bool operator>=(wchar_t c) const { return m_value >= (value_type)c; }
 #ifndef wxWINT_T_IS_TYPEDEF
-    bool operator>=(wint_t c) const { return m_value >= (unicode_type)c; }
+    bool operator>=(wint_t c) const { return m_value >= (value_type)c; }
 #endif
 
     bool operator<=(const wxUniChar& c) const { return m_value <= c.m_value; }
     bool operator<=(char c) const { return m_value <= From8bit(c); }
-    bool operator<=(wchar_t c) const { return m_value <= (unicode_type)c; }
+    bool operator<=(wchar_t c) const { return m_value <= (value_type)c; }
 #ifndef wxWINT_T_IS_TYPEDEF
-    bool operator<=(wint_t c) const { return m_value <= (unicode_type)c; }
+    bool operator<=(wint_t c) const { return m_value <= (value_type)c; }
 #endif
 
     int operator-(const wxUniChar& c) const { return m_value - c.m_value; }
     int operator-(char c) const { return m_value - From8bit(c); }
-    int operator-(wchar_t c) const { return m_value - (unicode_type)c; }
+    int operator-(wchar_t c) const { return m_value - (value_type)c; }
 #ifndef wxWINT_T_IS_TYPEDEF
-    int operator-(wint_t c) const { return m_value - (unicode_type)c; }
+    int operator-(wint_t c) const { return m_value - (value_type)c; }
 #endif
 
 private:
-    static unicode_type From8bit(char c);
-    static char To8bit(unicode_type c);
+    static value_type From8bit(char c);
+    static char To8bit(value_type c);
 
 private:
-    unicode_type m_value;
+    value_type m_value;
 };
 
 
@@ -157,7 +157,7 @@ public:
     static wxUniCharRef CreateForString(wxChar *pos)
         { return wxUniCharRef(pos); }
 
-    wxUniChar::unicode_type GetValue() const { return UniChar().GetValue(); }
+    wxUniChar::value_type GetValue() const { return UniChar().GetValue(); }
 
     // Assignment operators:
     wxUniCharRef& operator=(const wxUniCharRef& c)
index 5dbe8b0825988fc5951dd06bd8b79eb3bfbc2c8b..4aa43533df8f5b1323ac2d6e1e602e15ffdfe7e8 100644 (file)
@@ -26,7 +26,7 @@
 // ===========================================================================
 
 /* static */
-wxUniChar::unicode_type wxUniChar::From8bit(char c)
+wxUniChar::value_type wxUniChar::From8bit(char c)
 {
     // all supported charsets have the first 128 characters same as ASCII:
     if ( (unsigned char)c < 0x80 )
@@ -39,7 +39,7 @@ wxUniChar::unicode_type wxUniChar::From8bit(char c)
 }
 
 /* static */
-char wxUniChar::To8bit(wxUniChar::unicode_type c)
+char wxUniChar::To8bit(wxUniChar::value_type c)
 {
     // all supported charsets have the first 128 characters same as ASCII:
     if ( c < 0x80 )