Author: atsushi
Date: 2005-04-25 02:19:02 -0400 (Mon, 25 Apr 2005)
New Revision: 43532

Modified:
   branches/atsushi/mcs/class/corlib/ChangeLog
   branches/atsushi/mcs/class/corlib/System/ChangeLog
   branches/atsushi/mcs/class/corlib/System/String.cs
   branches/atsushi/mcs/class/corlib/corlib.dll.sources
Log:
2005-04-25  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * corlib.dll.sources : added Normalization.cs, CodePointIndexer.cs and
          NormalizationTableUtil.cs in Mono.Globalization.Unicode.

        * String.cs : added IsNormalized() and Normalize() (NET_2_0). Note that
          you will have to build Normalization.cs which can be generated in
          Mono.Globalization.Unicode directory (automatic build is not supported
          and those generated sources will be checked in at a certain stage).



Modified: branches/atsushi/mcs/class/corlib/ChangeLog
===================================================================
--- branches/atsushi/mcs/class/corlib/ChangeLog 2005-04-25 06:05:08 UTC (rev 
43531)
+++ branches/atsushi/mcs/class/corlib/ChangeLog 2005-04-25 06:19:02 UTC (rev 
43532)
@@ -1,3 +1,8 @@
+2005-04-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * corlib.dll.sources : added Normalization.cs, CodePointIndexer.cs and
+         NormalizationTableUtil.cs in Mono.Globalization.Unicode.
+
 2005-04-16  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * corlib.dll.sources : added System.Text/NormalizationForm.cs.

Modified: branches/atsushi/mcs/class/corlib/System/ChangeLog
===================================================================
--- branches/atsushi/mcs/class/corlib/System/ChangeLog  2005-04-25 06:05:08 UTC 
(rev 43531)
+++ branches/atsushi/mcs/class/corlib/System/ChangeLog  2005-04-25 06:19:02 UTC 
(rev 43532)
@@ -1,3 +1,10 @@
+2005-04-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * String.cs : added IsNormalized() and Normalize() (NET_2_0). Note that
+         you will have to build Normalization.cs which can be generated in
+         Mono.Globalization.Unicode directory (automatic build is not supported
+         and those generated sources will be checked in at a certain stage).
+
 2005-04-22  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * Attribute.cs: Added _Attribute interface to NET_2_0 to reduce the 

Modified: branches/atsushi/mcs/class/corlib/System/String.cs
===================================================================
--- branches/atsushi/mcs/class/corlib/System/String.cs  2005-04-25 06:05:08 UTC 
(rev 43531)
+++ branches/atsushi/mcs/class/corlib/System/String.cs  2005-04-25 06:19:02 UTC 
(rev 43532)
@@ -35,6 +35,7 @@
 using System.Collections;
 using System.Globalization;
 using System.Runtime.CompilerServices;
+using Mono.Globalization.Unicode;
 
 namespace System
 {
@@ -669,6 +670,25 @@
                        return IndexOf (value) != -1;
                }
 
+               public bool IsNormalized ()
+               {
+                       return IsNormalized (NormalizationForm.FormC);
+               }
+
+               public bool IsNormalized (NormalizationForm f)
+               {
+                       switch (f) {
+                       case NormalizationForm.FormKD:
+                               return Normalization.IsNormalized (this, 3);
+                       case NormalizationForm.FormKC:
+                               return Normalization.IsNormalized (this, 2);
+                       case NormalizationForm.FormD:
+                               return Normalization.IsNormalized (this, 1);
+                       default:
+                               return Normalization.IsNormalized (this, 0);
+                       }
+               }
+
                public static bool IsNullOrEmpty (String value)
                {
                        return (value == null) || (value.Length == 0);
@@ -683,6 +703,25 @@
 
                        return Remove (startIndex, this.length - startIndex);
                }
+
+               public string Normalize ()
+               {
+                       return Normalize (NormalizationForm.FormC);
+               }
+
+               public string Normalize (NormalizationForm f)
+               {
+                       switch (f) {
+                       case NormalizationForm.FormKD:
+                               return Normalization.Normalize (this, 3);
+                       case NormalizationForm.FormKC:
+                               return Normalization.Normalize (this, 2);
+                       case NormalizationForm.FormD:
+                               return Normalization.Normalize (this, 1);
+                       default:
+                               return Normalization.Normalize (this, 0);
+                       }
+               }
 #endif
 
                public String PadLeft (int totalWidth)

Modified: branches/atsushi/mcs/class/corlib/corlib.dll.sources
===================================================================
--- branches/atsushi/mcs/class/corlib/corlib.dll.sources        2005-04-25 
06:05:08 UTC (rev 43531)
+++ branches/atsushi/mcs/class/corlib/corlib.dll.sources        2005-04-25 
06:19:02 UTC (rev 43532)
@@ -8,6 +8,9 @@
 Microsoft.Win32/Win32RegistryApi.cs
 Microsoft.Win32/Win32ResultCode.cs
 Microsoft.Win32.SafeHandles/SafeFileHandle.cs
+Mono.Globalization.Unicode/CodePointIndexer.cs
+Mono.Globalization.Unicode/Normalization.cs
+Mono.Globalization.Unicode/NormalizationTableUtil.cs
 Mono/Runtime.cs
 Mono.Math/BigInteger.cs
 Mono.Math.Prime/ConfidenceFactor.cs

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

Reply via email to