diff dwtx/dwtxhelper/mangoicu/URegex.d @ 91:11e8159caf7a

make the mango icu fork work.
author Frank Benoit <benoit@tionex.de>
date Mon, 07 Jul 2008 15:53:07 +0200
parents 040da1cb0d76
children f05207c07a98
line wrap: on
line diff
--- a/dwtx/dwtxhelper/mangoicu/URegex.d	Sun Jul 06 23:30:07 2008 +0200
+++ b/dwtx/dwtxhelper/mangoicu/URegex.d	Mon Jul 07 15:53:07 2008 +0200
@@ -82,14 +82,14 @@
 
 *******************************************************************************/
 
-module dwtx.dwthelper.mangoicu.URegex;
+module dwtx.dwtxhelper.mangoicu.URegex;
 
-private import  dwtx.dwthelper.mangoicu.ICU;
+private import  dwtx.dwtxhelper.mangoicu.ICU;
 
-public  import  dwtx.dwthelper.mangoicu.ULocale,
-                dwtx.dwthelper.mangoicu.UString,
-                dwtx.dwthelper.mangoicu.UCollator,
-                dwtx.dwthelper.mangoicu.UBreakIterator;
+public  import  dwtx.dwtxhelper.mangoicu.ULocale,
+                dwtx.dwtxhelper.mangoicu.UString,
+                dwtx.dwtxhelper.mangoicu.UCollator,
+                dwtx.dwtxhelper.mangoicu.UBreakIterator;
 
 
 /*******************************************************************************
@@ -125,7 +125,7 @@
 class URegex : Groups
 {       
         private Handle  handle;
-        private UText   theText;
+        private UStringView   theText;
 
         // Regex modes 
         public enum     Flag 
@@ -168,7 +168,7 @@
 
         this (wchar[] pattern, Flag flags=Flag.None, ParseError* pe=null)
         {
-                Error e;
+                UErrorCode e;
 
                 handle = uregex_open (pattern.ptr, pattern.length, flags, pe, e);
                 testError (e, "failed to open regex");
@@ -184,7 +184,7 @@
 
         ***********************************************************************/
 
-        this (UText pattern, Flag flags=Flag.None, ParseError* pe=null)
+        this (UStringView pattern, Flag flags=Flag.None, ParseError* pe=null)
         {
                 this (pattern.get, flags, pe);
         }
@@ -197,7 +197,7 @@
 
         private this (Handle handle)
         {
-                Error e;
+                UErrorCode e;
 
                 this.handle = handle;
                 uregex_setText (handle, "", 0, e);
@@ -234,7 +234,7 @@
 
         URegex clone ()
         {       
-                Error e;
+                UErrorCode e;
 
                 Handle h = uregex_clone (handle, e);
                 testError (e, "failed to clone regex");
@@ -250,7 +250,7 @@
 
         UString getPattern ()
         {       
-                Error e;
+                UErrorCode e;
                 uint  len;
 
                 wchar* x = uregex_pattern (handle, len, e);
@@ -267,7 +267,7 @@
 
         Flag getFlags ()
         {       
-                Error e;
+                UErrorCode e;
 
                 Flag f = cast(Flag) uregex_flags (handle, e);
                 testError (e, "failed to get regex flags");
@@ -293,9 +293,9 @@
 
         ***********************************************************************/
 
-        void setText (UText t)
+        void setText (UStringView t)
         {       
-                Error e;
+                UErrorCode e;
 
                 theText = t;
                 uregex_setText (handle, t.get.ptr, t.length, e);
@@ -312,7 +312,7 @@
 
         ***********************************************************************/
 
-        UText getText ()
+        UStringView getText ()
         {      
                 return theText;
         }
@@ -360,7 +360,7 @@
 
         void group (UString s, uint index)
         {       
-                uint fmt (wchar* dst, uint length, inout Error e)
+                uint fmt (wchar* dst, uint length, inout UErrorCode e)
                 {
                         return uregex_group (handle, index, dst, length, e);
                 }
@@ -377,7 +377,7 @@
 
         uint groupCount ()
         {       
-                Error e;
+                UErrorCode e;
 
                 uint i = uregex_groupCount (handle, e);
                 testError (e, "failed to get regex group-count");
@@ -399,7 +399,7 @@
 
         uint start (uint index = 0)
         {       
-                Error e;
+                UErrorCode e;
 
                 uint i = uregex_start (handle, index, e);
                 testError (e, "failed to get regex start");
@@ -421,7 +421,7 @@
 
         uint end (uint index = 0)
         {       
-                Error e;
+                UErrorCode e;
 
                 uint i = uregex_end (handle, index, e);
                 testError (e, "failed to get regex end");
@@ -441,7 +441,7 @@
 
         void reset (uint startIndex)
         {       
-                Error e;
+                UErrorCode e;
 
                 uregex_reset (handle, startIndex, e);
                 testError (e, "failed to set regex next-index");
@@ -459,7 +459,7 @@
 
         bool match (uint startIndex)
         {       
-                Error e;
+                UErrorCode e;
 
                 bool b = uregex_matches (handle, startIndex, e);
                 testError (e, "failed while matching regex");
@@ -478,7 +478,7 @@
 
         bool probe (uint startIndex)
         {       
-                Error e;
+                UErrorCode e;
 
                 bool b = uregex_lookingAt (handle, startIndex, e);
                 testError (e, "failed while looking at regex");
@@ -497,7 +497,7 @@
 
         bool next (uint startIndex = uint.max)
         {     
-                Error e;
+                UErrorCode e;
                 bool  b;
 
                 b = (startIndex == uint.max) ? uregex_findNext (handle, e) : 
@@ -535,9 +535,9 @@
                 
         ***********************************************************************/
 
-        uint replaceAll (UText replace, UString result)
+        uint replaceAll (UStringView replace, UString result)
         {
-                Error e;
+                UErrorCode e;
 
                 uint len = uregex_replaceAll (handle, replace.get.ptr, replace.length, result.get.ptr, result.length, e);
                 testError (e, "failed during regex replace");  
@@ -573,9 +573,9 @@
                 
         ***********************************************************************/
 
-        uint replaceFirst (UText replace, UString result)
+        uint replaceFirst (UStringView replace, UString result)
         {
-                Error e;
+                UErrorCode e;
 
                 uint len = uregex_replaceFirst (handle, replace.get.ptr, replace.length, result.get.ptr, result.length, e);
                 testError (e, "failed during regex replace");  
@@ -594,7 +594,7 @@
 
         uint split (wchar[][] fields)
         {     
-                Error           e;
+                UErrorCode           e;
                 uint            pos,
                                 count;
                 wchar[]         content = theText.get;
@@ -634,24 +634,24 @@
 
         private static extern (C) 
         {
-                Handle  function (wchar*, uint, uint, ParseError*, inout Error) uregex_open;
+                Handle  function (wchar*, uint, uint, ParseError*, inout UErrorCode) uregex_open;
                 void    function (Handle) uregex_close;
-                Handle  function (Handle, inout Error) uregex_clone;
-                wchar*  function (Handle, inout uint, inout Error) uregex_pattern;
-                uint    function (Handle, inout Error) uregex_flags;
-                void    function (Handle, wchar*, uint, inout Error) uregex_setText;
-                wchar*  function (Handle, inout uint, inout Error) uregex_getText;
-                uint    function (Handle, uint, wchar*, uint, inout Error) uregex_group;
-                uint    function (Handle, inout Error) uregex_groupCount;
-                uint    function (Handle, uint, inout Error) uregex_start;
-                uint    function (Handle, uint, inout Error) uregex_end;
-                void    function (Handle, uint, inout Error) uregex_reset;
-                bool    function (Handle, uint, inout Error) uregex_matches;
-                bool    function (Handle, uint, inout Error) uregex_lookingAt;
-                bool    function (Handle, uint, inout Error) uregex_find;
-                bool    function (Handle, inout Error) uregex_findNext;
-                uint    function (Handle, wchar*, uint, wchar*, uint, inout Error) uregex_replaceAll;
-                uint    function (Handle, wchar*, uint, wchar*, uint, inout Error) uregex_replaceFirst;
+                Handle  function (Handle, inout UErrorCode) uregex_clone;
+                wchar*  function (Handle, inout uint, inout UErrorCode) uregex_pattern;
+                uint    function (Handle, inout UErrorCode) uregex_flags;
+                void    function (Handle, wchar*, uint, inout UErrorCode) uregex_setText;
+                wchar*  function (Handle, inout uint, inout UErrorCode) uregex_getText;
+                uint    function (Handle, uint, wchar*, uint, inout UErrorCode) uregex_group;
+                uint    function (Handle, inout UErrorCode) uregex_groupCount;
+                uint    function (Handle, uint, inout UErrorCode) uregex_start;
+                uint    function (Handle, uint, inout UErrorCode) uregex_end;
+                void    function (Handle, uint, inout UErrorCode) uregex_reset;
+                bool    function (Handle, uint, inout UErrorCode) uregex_matches;
+                bool    function (Handle, uint, inout UErrorCode) uregex_lookingAt;
+                bool    function (Handle, uint, inout UErrorCode) uregex_find;
+                bool    function (Handle, inout UErrorCode) uregex_findNext;
+                uint    function (Handle, wchar*, uint, wchar*, uint, inout UErrorCode) uregex_replaceAll;
+                uint    function (Handle, wchar*, uint, wchar*, uint, inout UErrorCode) uregex_replaceFirst;
         }
 
         /***********************************************************************