Author: kornelpal
Date: 2006-06-28 16:07:25 -0400 (Wed, 28 Jun 2006)
New Revision: 62129

Modified:
   trunk/mcs/class/corlib/System/ChangeLog
   trunk/mcs/class/corlib/System/Char.cs
Log:
Char.cs: Implemented IsHighSurrogate and IsLowSurrogate methods.

Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog     2006-06-28 20:06:07 UTC (rev 
62128)
+++ trunk/mcs/class/corlib/System/ChangeLog     2006-06-28 20:07:25 UTC (rev 
62129)
@@ -1,3 +1,7 @@
+2006-06-28  Kornél Pál  <[EMAIL PROTECTED]>
+
+       * Char.cs: Implemented IsHighSurrogate and IsLowSurrogate methods.
+
 2006-06-27  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * Double.cs : don't throw Exception in TryParse() for 'E'.

Modified: trunk/mcs/class/corlib/System/Char.cs
===================================================================
--- trunk/mcs/class/corlib/System/Char.cs       2006-06-28 20:06:07 UTC (rev 
62128)
+++ trunk/mcs/class/corlib/System/Char.cs       2006-06-28 20:07:25 UTC (rev 
62129)
@@ -214,6 +214,24 @@
                        return IsDigit (str[index]);
                }
 
+#if NET_2_0
+               public static bool IsHighSurrogate (char c)
+               {
+                       return c >= '\uD800' && c <= '\uDBFF';
+               }
+
+               public static bool IsHighSurrogate (string s, int index)
+               {
+                       if (s == null) 
+                               throw new ArgumentNullException ("s");
+                       
+                       if (index < 0 || index >= s.Length)
+                               throw new ArgumentOutOfRangeException ("index");
+                       
+                       return IsHighSurrogate (s [index]);
+               }
+#endif
+
                public static bool IsLetter (char c)
                {
                        unsafe {
@@ -292,6 +310,24 @@
                        return IsLower (str[index]);
                }
 
+#if NET_2_0
+               public static bool IsLowSurrogate (char c)
+               {
+                       return c >= '\uDC00' && c <= '\uDFFF';
+               }
+
+               public static bool IsLowSurrogate (string s, int index)
+               {
+                       if (s == null) 
+                               throw new ArgumentNullException ("s");
+                       
+                       if (index < 0 || index >= s.Length)
+                               throw new ArgumentOutOfRangeException ("index");
+                       
+                       return IsLowSurrogate (s [index]);
+               }
+#endif
+
                public static bool IsNumber (char c)
                {
                        unsafe {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to