2005-10-17 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Mon, 17 Oct 2005 19:14:04 +0000 (19:14 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Mon, 17 Oct 2005 19:14:04 +0000 (19:14 -0000)
* GenericUriParserOptions.cs: New. 2.0 enum.
* UriBuilder.cs: Port == -1 is valid (default) in 2.0. Default name
is "localhhost" (not loopback) in 2.0. Fixed case where the Password
property could be null (instead of String.Empty).
* UriComponents.cs: New. 2.0 enum.
* UriFormat.cs: New. 2.0 enum.
* UriFormatException.cs: Added comments about GetObjectData.
* UriKind.cs: New. 2.0 enum.
* UriPartial.cs: Added Query value for 2.0.

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

mcs/class/System/System/ChangeLog
mcs/class/System/System/GenericUriParserOptions.cs [new file with mode: 0644]
mcs/class/System/System/UriBuilder.cs
mcs/class/System/System/UriComponents.cs [new file with mode: 0644]
mcs/class/System/System/UriFormat.cs [new file with mode: 0644]
mcs/class/System/System/UriFormatException.cs
mcs/class/System/System/UriKind.cs [new file with mode: 0644]
mcs/class/System/System/UriPartial.cs

index 162a962fe1680a70ce44ffa83b667d7e17cb1321..430db0685442ac4f556fec367813776e04077b86 100644 (file)
@@ -1,3 +1,15 @@
+2005-10-17  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * GenericUriParserOptions.cs: New. 2.0 enum.
+       * UriBuilder.cs: Port == -1 is valid (default) in 2.0. Default name
+       is "localhhost" (not loopback) in 2.0. Fixed case where the Password
+       property could be null (instead of String.Empty).
+       * UriComponents.cs: New. 2.0 enum.
+       * UriFormat.cs: New. 2.0 enum.
+       * UriFormatException.cs: Added comments about GetObjectData.
+       * UriKind.cs: New. 2.0 enum.
+       * UriPartial.cs: Added Query value for 2.0.
+
 2005-08-16  Daniel Drake  <dsd@gentoo.org>
 
        * Uri.cs: Various parsing fixes from bug #75144.
diff --git a/mcs/class/System/System/GenericUriParserOptions.cs b/mcs/class/System/System/GenericUriParserOptions.cs
new file mode 100644 (file)
index 0000000..418c331
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// System.GenericUriParserOptions enumeration
+//
+// Author:
+//     Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+namespace System {
+
+       [Flags]
+       public enum GenericUriParserOptions {
+
+               Default,
+               GenericAuthority,
+               AllowEmptyAuthority,
+               NoUserInfo,
+               NoPort,
+               NoQuery,
+               NoFragment,
+               DontConvertPathBackslashes,
+               DontCompressPath,
+               DontUnescapePathDotsAndSlashes
+       }
+}
+
+#endif
index 77dce03deef1e9036ad2818dc3a28995fb462e32..35d309e7dcd6b4d037264228e3b9fb026fcef985 100644 (file)
@@ -4,7 +4,7 @@
 // Author:\r
 //   Lawrence Pit (loz@cable.a2000.nl)\r
 //\r
-
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@
 \r
 using System;\r
 using System.Collections;\r
-using System.Runtime.Serialization;\r
+using System.Runtime.Serialization;
 using System.Text;\r
 \r
 // See RFC 2396 for more info on URI's.\r
@@ -52,7 +52,12 @@ namespace System
                \r
                // Constructors         \r
                \r
-               public UriBuilder () : this (Uri.UriSchemeHttp, "loopback")\r
+               public UriBuilder ()
+#if NET_2_0
+                       : this (Uri.UriSchemeHttp, "localhost")
+#else
+                       : this (Uri.UriSchemeHttp, "loopback")
+#endif\r
                {               \r
                }\r
 \r
@@ -73,6 +78,8 @@ namespace System
                        if (pos != -1) {\r
                                password = username.Substring (pos + 1);\r
                                username = username.Substring (0, pos);\r
+                       } else {
+                               password = String.Empty;\r
                        }\r
                        modified = true;\r
                }\r
@@ -163,9 +170,14 @@ namespace System
                \r
                public int Port {\r
                        get { return port; }\r
-                       set {\r
+                       set {
+#if NET_2_0
+                               if (value < -1)\r
+                                       throw new ArgumentOutOfRangeException ("value");
+#else\r
                                if (value < 0)\r
-                                       throw new ArgumentOutOfRangeException ("value");\r
+                                       throw new ArgumentOutOfRangeException ("value");
+#endif\r
                                // apparently it is\r
                                port = value;\r
                                modified = true;\r
diff --git a/mcs/class/System/System/UriComponents.cs b/mcs/class/System/System/UriComponents.cs
new file mode 100644 (file)
index 0000000..000cb74
--- /dev/null
@@ -0,0 +1,55 @@
+//
+// System.UriComponents enumeration
+//
+// Author:
+//     Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+namespace System {
+
+       [Flags]
+       public enum UriComponents {
+
+               Schema,
+               UserInfo,
+               Host,
+               Port,
+               Path,
+               Query,
+               Fragment,
+               StrongPort,
+               KeepDelimiter = 0x40000000,
+
+               HostAndPort = Host | StrongPort,
+               StrongAuthority = Host | UserInfo | StrongPort,
+               AbsoluteUri = Schema | UserInfo | Host | Port | Path | Query | Fragment,
+               PathAndQuery = Path | Query,
+               SchemaAndServer = Schema | Host | Port,
+               SerializationInfoString = Int32.MinValue
+       }
+}
+
+#endif
diff --git a/mcs/class/System/System/UriFormat.cs b/mcs/class/System/System/UriFormat.cs
new file mode 100644 (file)
index 0000000..0bee75a
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// System.UriFormat enumeration
+//
+// Author:
+//     Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+namespace System {
+
+       public enum UriFormat {
+
+               UriEscaped = 1,
+               Unescaped,
+               SafeUnescaped,
+       }
+}
+
+#endif
index c44385267a916da7ce5eafdcdb1387f73e44827c..a0f5804c35fe2c8573092a696f2f775fcdfe3c9d 100644 (file)
@@ -7,8 +7,7 @@
 //
 // (C) 2001 Scott Sanders
 // (C) 2002 Ximian, Inc.
-//
-
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -34,6 +33,7 @@ using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System {
+
        [Serializable]
        public class UriFormatException : FormatException, ISerializable
        {
@@ -55,6 +55,9 @@ namespace System {
                }
 
                // Methods
+
+               // This effectively kills the LinkDemand from Exception.GetObjectData (if someone
+               // use the ISerializable interface to serialize the object). See unit tests.
                void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
                {
                        base.GetObjectData (info, context);
diff --git a/mcs/class/System/System/UriKind.cs b/mcs/class/System/System/UriKind.cs
new file mode 100644 (file)
index 0000000..af6b734
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// System.UriKind enumeration
+//
+// Author:
+//     Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+namespace System {
+
+       public enum UriKind {
+
+               RelativeOrAbsolute,
+               Absolute,
+               Relative,
+       }
+}
+
+#endif
index c1160491687722b77eb41dcef0e99f23448bcecb..07a0a2c4a3256f2f2fd54ba39c193c247bab9d62 100644 (file)
@@ -8,7 +8,7 @@
 // URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
 //
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
-
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-
 namespace System {
 
-
-       /// <summary>
-       /// </summary>
        public enum UriPartial {
 
-               /// <summary>
-               /// </summary>
                Scheme = 0,
-
-               /// <summary>
-               /// </summary>
                Authority = 1,
-
-               /// <summary>
-               /// </summary>
                Path = 2,
-       } // UriPartial
-
-} // System
+#if NET_2_0
+               Query
+#endif
+       }
+}