Pārlūkot izejas kodu

* RegexRunnerFactory.cs: removed comment, no longer throw exception
from ctor
* regex.cs: fixed public API signature by renaming protected
internal fields and adding destructor, added MonoTODO attribute to
fields and method that are not yet implemented, changed not
implemented methods to throw NotImplementedException instead of
Exception, fixed names of field that are serialized

svn path=/trunk/mcs/; revision=29210

Gert Driesen 21 gadi atpakaļ
vecāks
revīzija
95afd686ee

+ 10 - 0
mcs/class/System/System.Text.RegularExpressions/ChangeLog

@@ -1,3 +1,13 @@
+2004-06-10  Gert Driesen <[email protected]>
+
+	* RegexRunnerFactory.cs: removed comment, no longer throw exception
+	from ctor
+	* regex.cs: fixed public API signature by renaming protected 
+	internal fields and adding destructor, added MonoTODO attribute to
+	fields and method that are not yet implemented, changed not 
+	implemented methods to throw NotImplementedException instead of
+	Exception, fixed names of field that are serialized
+
 2004-06-06  Jambunathan K <[email protected]>
 	
 	* parser.cs: Fixed issues with Regex.Unescape() identified as part of

+ 0 - 5
mcs/class/System/System.Text.RegularExpressions/RegexRunnerFactory.cs

@@ -10,14 +10,9 @@ using System;
 using System.ComponentModel;
 
 namespace System.Text.RegularExpressions {
-	/* I'm just guessing that this is the correct place for this
-	 * attribute, and that the option is correct.  It shuts up
-	 * CorCompare for this undocumented class.
-	 */
 	[EditorBrowsable (EditorBrowsableState.Never)]
 	public abstract class RegexRunnerFactory {
 		protected RegexRunnerFactory () {
-			throw new NotImplementedException ("RegexRunnerFactory is not supported by Mono.");
 		}
 
 		protected internal abstract RegexRunner CreateInstance ();

+ 34 - 21
mcs/class/System/System.Text.RegularExpressions/regex.cs

@@ -49,14 +49,15 @@ namespace System.Text.RegularExpressions {
 			(RegexCompilationInfo[] regexes, AssemblyName aname,
 			 CustomAttributeBuilder[] attribs)
 		{
-			Regex.CompileToAssembly(regexes, aname, attribs, null);		       
+			Regex.CompileToAssembly(regexes, aname, attribs, null);
 		}
 
+		[MonoTODO]
 		public static void CompileToAssembly
 			(RegexCompilationInfo[] regexes, AssemblyName aname,
 			 CustomAttributeBuilder[] attribs, string resourceFile)
 		{
-			throw new Exception ("Not fully implemented.");
+			throw new NotImplementedException ();
 			// TODO : Make use of attribs and resourceFile parameters
 			/*
 			AssemblyBuilder asmBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly (aname, AssemblyBuilderAccess.RunAndSave);
@@ -209,11 +210,15 @@ namespace System.Text.RegularExpressions {
 			}
 		}
 
-		protected Regex (SerializationInfo info, StreamingContext context) :
+		private Regex (SerializationInfo info, StreamingContext context) :
 			this (info.GetString ("pattern"), 
-			      (RegexOptions) info.GetValue ("roptions", typeof (RegexOptions))) {			
+			      (RegexOptions) info.GetValue ("options", typeof (RegexOptions))) {
 		}
 
+		// fixes public API signature
+		~Regex ()
+		{
+		}
 
 		// public instance properties
 		
@@ -422,17 +427,19 @@ namespace System.Text.RegularExpressions {
 		}
 
 		// MS undocummented method
-                               
+		[MonoTODO]
 		protected void InitializeReferences() {
-			throw new Exception ("Not implemented.");
+			throw new NotImplementedException ();
 		}
-		
+
+		[MonoTODO]
 		protected bool UseOptionC(){
-			throw new Exception ("Not implemented.");
+			throw new NotImplementedException ();
 		}
 
+		[MonoTODO]
 		protected bool UseOptionR(){
-			throw new Exception ("Not implemented.");
+			throw new NotImplementedException ();
 		}
 
 		// object methods
@@ -444,7 +451,7 @@ namespace System.Text.RegularExpressions {
 		// ISerializable interface
 		void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) {
 			info.AddValue ("pattern", this.ToString (), typeof (string));
-			info.AddValue ("roptions", this.Options, typeof (RegexOptions));
+			info.AddValue ("options", this.Options, typeof (RegexOptions));
 		}
 
 		// internal
@@ -470,26 +477,32 @@ namespace System.Text.RegularExpressions {
 		protected internal RegexOptions roptions;
 		
 		// MS undocumented members
+		[MonoTODO]
 		protected internal System.Collections.Hashtable capnames;
-		protected internal System.Collections.Hashtable cap;
+		[MonoTODO]
+		protected internal System.Collections.Hashtable caps;
+		[MonoTODO]
 		protected internal int capsize;
-		protected internal string[] caplist;
+		[MonoTODO]
+		protected internal string[] capslist;
+		[MonoTODO]
 		protected internal RegexRunnerFactory factory;
 	}
 
 	[Serializable]
 	public class RegexCompilationInfo {
-		public RegexCompilationInfo (string pattern, RegexOptions options, string name, string full_namespace, bool is_public) {
+		public RegexCompilationInfo (string pattern, RegexOptions options, string name, string nspace, bool isPublic)
+		{
 			this.pattern = pattern;
 			this.options = options;
 			this.name = name;
-			this.full_namespace = full_namespace;
-			this.is_public = is_public;
+			this.nspace = nspace;
+			this.isPublic = isPublic;
 		}
 
 		public bool IsPublic {
-			get { return is_public; }
-			set { is_public = value; }
+			get { return isPublic; }
+			set { isPublic = value; }
 		}
 
 		public string Name {
@@ -498,8 +511,8 @@ namespace System.Text.RegularExpressions {
 		}
 
 		public string Namespace {
-			get { return full_namespace; }
-			set { full_namespace = value; }
+			get { return nspace; }
+			set { nspace = value; }
 		}
 
 		public RegexOptions Options {
@@ -514,8 +527,8 @@ namespace System.Text.RegularExpressions {
 
 		// private
 
-		private string pattern, name, full_namespace;
+		private string pattern, name, nspace;
 		private RegexOptions options;
-		private bool is_public;
+		private bool isPublic;
 	}
 }