瀏覽代碼

Thu Dec 20 15:29:52 CET 2001 Paolo Molaro <[email protected]>

	* Byte.cs: removed use of Regexes.

svn path=/trunk/mcs/; revision=1651
Paolo Molaro 24 年之前
父節點
當前提交
c8b44b005e
共有 2 個文件被更改,包括 5 次插入33 次删除
  1. 1 33
      mcs/class/corlib/System/Byte.cs
  2. 4 0
      mcs/class/corlib/System/ChangeLog

+ 1 - 33
mcs/class/corlib/System/Byte.cs

@@ -8,7 +8,6 @@
 //
 
 using System.Globalization;
-using System.Text.RegularExpressions;
 
 namespace System {
 	
@@ -75,38 +74,7 @@ namespace System {
 			}
 
 			// TODO: Handle other styles and FormatProvider properties
-			if (NumberStyles.Integer == style){
-				// the pattern allowed is: [ws][+]digits[ws]
-				// [ws] = optional whitespace (any amount)
-				// [+] = one optional plus sign
-				// digits = one or more characters '0' through '9'
-				Regex bytePattern = new Regex("^\\s*\\+?\\d+\\s*$");
-				if (bytePattern.IsMatch(s)){
-					int retVal = 0;
-					int endIndex;
-					// extract the digits from the string
-					Regex byteDigitPattern = new Regex("\\d+");
-					Match m = byteDigitPattern.Match(s);
-					// find out the index number where the digits end
-					endIndex = m.Index+m.Length-1;
-					// work back-to-front through the digits and
-					// multiply each digit by the next power of 10 (start at 0)
-					for(int j = endIndex; j>=m.Index; j--){
-						retVal += (s[j]-'0')*(int)Math.Pow(10,endIndex-j);
-						if (retVal > Byte.MaxValue || retVal < Byte.MinValue){    
-							throw new OverflowException();
-						}
-					}
-					return (byte)retVal;
-				}
-				else {
-				    throw new FormatException();
-				}
-				
-			}
-			else {
-				throw new NotImplementedException();
-			}
+			throw new NotImplementedException();
 		}
 
 		public override string ToString ()

+ 4 - 0
mcs/class/corlib/System/ChangeLog

@@ -1,4 +1,8 @@
 
+Thu Dec 20 15:29:52 CET 2001 Paolo Molaro <[email protected]>
+	
+	* Byte.cs: removed use of Regexes.
+
 Tue Dec 18 18:39:54 CET 2001 Paolo Molaro <[email protected]>
 
 	* Enum.cs: implemented GetValues(), GetNames(), GetName(),