From: Marek Safar Date: Fri, 21 Apr 2017 12:08:22 +0000 (+0200) Subject: [System] UriBuilder from corefx X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=bf6b05b0a3165552793a352edccb27da9696b62d;p=mono.git [System] UriBuilder from corefx --- diff --git a/mcs/class/System/Makefile b/mcs/class/System/Makefile index 073bb3c9c25..39b0706253f 100644 --- a/mcs/class/System/Makefile +++ b/mcs/class/System/Makefile @@ -17,7 +17,8 @@ endif RESX_RESOURCE_STRING = \ ../../../external/corefx/src/System.Collections.Concurrent/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Collections/src/Resources/Strings.resx \ - ../../../external/corefx/src/System.Buffers/src/Resources/Strings.resx + ../../../external/corefx/src/System.Buffers/src/Resources/Strings.resx \ + ../../../external/corefx/src/System.Private.Uri/src/Resources/Strings.resx TEST_RESOURCES = \ Test/System/test-uri-props.txt \ diff --git a/mcs/class/System/ReferenceSources/SR.cs b/mcs/class/System/ReferenceSources/SR.cs index 7fd9f4e617c..31275cfdcf5 100644 --- a/mcs/class/System/ReferenceSources/SR.cs +++ b/mcs/class/System/ReferenceSources/SR.cs @@ -10,9 +10,6 @@ partial class SR { public const string RTL = "RTL_False"; public const string ContinueButtonText = "Continue"; - public const string DebugAssertBanner = "---- DEBUG ASSERTION FAILED ----"; - public const string DebugAssertShortMessage = "---- Assert Short Message ----"; - public const string DebugAssertLongMessage = "---- Assert Long Message ----"; public const string DebugMessageTruncated = "{0}...\n"; public const string DebugAssertTitleShort = "Assertion Failed"; public const string DebugAssertTitle = "Assertion Failed: Cancel=Debug, OK=Continue"; @@ -530,28 +527,6 @@ partial class SR public const string net_httpstatuscode_ServiceUnavailable = "Server Unavailable"; public const string net_httpstatuscode_GatewayTimeout = "Gateway Timeout"; public const string net_httpstatuscode_HttpVersionNotSupported = "Http Version Not Supported"; - public const string net_uri_BadScheme = "Invalid URI: The URI scheme is not valid."; - public const string net_uri_BadFormat = "Invalid URI: The format of the URI could not be determined."; - public const string net_uri_BadUserPassword = "Invalid URI: The username:password construct is badly formed."; - public const string net_uri_BadHostName = "Invalid URI: The hostname could not be parsed."; - public const string net_uri_BadAuthority = "Invalid URI: The Authority/Host could not be parsed."; - public const string net_uri_BadAuthorityTerminator = "Invalid URI: The Authority/Host cannot end with a backslash character ('\\')."; - public const string net_uri_EmptyUri = "Invalid URI: The URI is empty."; - public const string net_uri_BadString = "Invalid URI: There is an invalid sequence in the string."; - public const string net_uri_MustRootedPath = "Invalid URI: A Dos path must be rooted, for example, 'c:\\'."; - public const string net_uri_BadPort = "Invalid URI: Invalid port specified."; - public const string net_uri_SizeLimit = "Invalid URI: The Uri string is too long."; - public const string net_uri_SchemeLimit = "Invalid URI: The Uri scheme is too long."; - public const string net_uri_NotAbsolute = "This operation is not supported for a relative URI."; - public const string net_uri_PortOutOfRange = "A derived type '{0}' has reported an invalid value for the Uri port '{1}'."; - public const string net_uri_UserDrivenParsing = "A derived type '{0}' is responsible for parsing this Uri instance. The base implementation must not be used."; - public const string net_uri_AlreadyRegistered = "A URI scheme name '{0}' already has a registered custom parser."; - public const string net_uri_NeedFreshParser = "The URI parser instance passed into 'uriParser' parameter is already registered with the scheme name '{0}'."; - public const string net_uri_CannotCreateRelative = "A relative URI cannot be created because the 'uriString' parameter represents an absolute URI."; - public const string net_uri_InvalidUriKind = "The value '{0}' passed for the UriKind parameter is invalid."; - public const string net_uri_BadUnicodeHostForIdn = "An invalid Unicode character by IDN standards was specified in the host."; - public const string net_uri_GenericAuthorityNotDnsSafe = "The generic authority '{0}' is not a valid dns name."; - public const string net_uri_NotJustSerialization = "UriComponents.SerializationInfoString must not be combined with other UriComponents."; public const string net_emptystringset = "This property cannot be set to an empty string."; public const string net_emptystringcall = "The parameter '{0}' cannot be an empty string."; public const string net_headers_req = "This collection holds response headers and cannot contain the specified request header."; @@ -1335,17 +1310,12 @@ partial class SR public const string NotSupported_UnseekableStream = "Stream does not support seeking."; public const string IO_EOF_ReadBeyondEOF = "Unable to read beyond the end of the stream."; public const string ObjectDisposed_StreamClosed = "Can not access a closed Stream."; - public const string UnauthorizedAccess_IODenied_Path = "Access to the port '{0}' is denied."; public const string IO_UnknownError = "Unknown Error '{0}'."; public const string Arg_WrongAsyncResult = "IAsyncResult object did not come from the corresponding async method on this type."; public const string InvalidOperation_EndReadCalledMultiple = "EndRead can only be called once for each asynchronous operation."; public const string InvalidOperation_EndWriteCalledMultiple = "EndWrite can only be called once for each asynchronous operation."; public const string IO_PortNotFound = "The specified port does not exist."; public const string IO_PortNotFoundFileName = "The port '{0}' does not exist."; - public const string UnauthorizedAccess_IODenied_NoPathName = "Access to the port is denied."; - public const string IO_PathTooLong = "The specified port name is too long. The port name must be less than 260 characters."; - public const string IO_SharingViolation_NoFileName = "The process cannot access the port because it is being used by another process."; - public const string IO_SharingViolation_File = "The process cannot access the port '{0}' because it is being used by another process."; public const string NotSupported_UnwritableStream = "Stream does not support writing."; public const string ObjectDisposed_WriterClosed = "Can not write to a closed TextWriter."; public const string BaseStream_Invalid_Not_Open = "The BaseStream is only available when the port is open."; diff --git a/mcs/class/System/Test/System/UriBuilderTest.cs b/mcs/class/System/Test/System/UriBuilderTest.cs index 59ef15dd764..5db45f56b3e 100644 --- a/mcs/class/System/Test/System/UriBuilderTest.cs +++ b/mcs/class/System/Test/System/UriBuilderTest.cs @@ -177,7 +177,7 @@ namespace MonoTests.System Assert.AreEqual ("?\xA9 2002", b.Query, "#1"); Assert.AreEqual (string.Empty, b.Fragment, "#2"); b.Query = "?test"; - Assert.AreEqual ("??test", b.Query, "#3"); + Assert.AreEqual ("?test", b.Query, "#3"); b.Query = null; Assert.AreEqual (string.Empty, b.Query, "#4"); b.Fragment = "test"; @@ -199,7 +199,7 @@ namespace MonoTests.System Assert.AreEqual ("#\xA9 2002", b.Fragment, "#1"); Assert.AreEqual (string.Empty, b.Query, "#2"); b.Fragment = "#test"; - Assert.AreEqual ("##test", b.Fragment, "#3"); + Assert.AreEqual ("#test", b.Fragment, "#3"); b.Fragment = null; Assert.AreEqual (String.Empty, b.Fragment, "#4"); b.Query = "name"; @@ -264,7 +264,7 @@ namespace MonoTests.System b = new UriBuilder ("http", "www.ximian.com", 80, "/lalala/lelele.aspx", "?"); Assert.AreEqual (noquery, b.Uri.ToString (), "#2"); b = new UriBuilder ("http", "www.ximian.com", 80, "/lalala/lelele.aspx", "??"); - Assert.AreEqual (noquery + "??", b.Uri.ToString (), "#3"); + Assert.AreEqual (noquery + "?", b.Uri.ToString (), "#3"); b = new UriBuilder ("http", "www.ximian.com", 80, "/lalala/lelele.aspx", "?something"); Assert.AreEqual (noquery + "?something", b.Uri.ToString (), "#4"); } diff --git a/mcs/class/System/common.sources b/mcs/class/System/common.sources index a12bf86ba80..b4cb1317ba5 100644 --- a/mcs/class/System/common.sources +++ b/mcs/class/System/common.sources @@ -680,7 +680,6 @@ ReferenceSources/Win32Exception.cs ../referencesource/System/net/System/GenericUriParser.cs ../referencesource/System/net/System/IriHelper.cs ../referencesource/System/net/System/URI.cs -../referencesource/System/net/System/uribuilder.cs ../referencesource/System/net/System/UriEnumTypes.cs ../referencesource/System/net/System/UriExt.cs ../referencesource/System/net/System/URIFormatException.cs @@ -977,4 +976,6 @@ corefx/SR.cs ../../../external/corefx/src/System.Net.HttpListener/src/System/Net/WebSockets/HttpListenerWebSocketContext.cs +../../../external/corefx/src/System.Private.Uri/src/System/UriBuilder.cs + ../../../external/corefx/src/System.Runtime.Extensions/src/System/CodeDom/Compiler/IndentedTextWriter.cs diff --git a/mcs/class/System/corefx/SR.cs b/mcs/class/System/corefx/SR.cs index 733acc5e21f..671e89d79a5 100644 --- a/mcs/class/System/corefx/SR.cs +++ b/mcs/class/System/corefx/SR.cs @@ -80,4 +80,43 @@ partial class SR public const string Serialization_MissingKeys = "The keys for this dictionary are missing."; public const string Serialization_MissingValues = "The values for this dictionary are missing."; public const string ArgumentException_BufferNotFromPool = "The buffer is not associated with this pool and may not be returned to it."; + public const string ArgumentOutOfRange_IndexCountBuffer = "Index and count must refer to a location within the buffer."; + public const string Argument_InvalidCharSequenceNoIndex = "String contains invalid Unicode code points."; + public const string net_uri_BadAuthority = "Invalid URI: The Authority/Host could not be parsed."; + public const string net_uri_BadAuthorityTerminator = "Invalid URI: The Authority/Host cannot end with a backslash character ('\\\\')."; + public const string net_uri_BadFormat = "Invalid URI: The format of the URI could not be determined."; + public const string net_uri_NeedFreshParser = "The URI parser instance passed into 'uriParser' parameter is already registered with the scheme name '{0}'."; + public const string net_uri_AlreadyRegistered = "A URI scheme name '{0}' already has a registered custom parser."; + public const string net_uri_BadHostName = "Invalid URI: The hostname could not be parsed."; + public const string net_uri_BadPort = "Invalid URI: Invalid port specified."; + public const string net_uri_BadScheme = "Invalid URI: The URI scheme is not valid."; + public const string net_uri_BadString = "Invalid URI: There is an invalid sequence in the string."; + public const string net_uri_BadUserPassword = "Invalid URI: The username:password construct is badly formed."; + public const string net_uri_CannotCreateRelative = "A relative URI cannot be created because the 'uriString' parameter represents an absolute URI."; + public const string net_uri_SchemeLimit = "Invalid URI: The Uri scheme is too long."; + public const string net_uri_EmptyUri = "Invalid URI: The URI is empty."; + public const string net_uri_InvalidUriKind = "The value '{0}' passed for the UriKind parameter is invalid."; + public const string net_uri_MustRootedPath = "Invalid URI: A Dos path must be rooted, for example, 'c:\\\\'."; + public const string net_uri_NotAbsolute = "This operation is not supported for a relative URI."; + public const string net_uri_PortOutOfRange = "A derived type '{0}' has reported an invalid value for the Uri port '{1}'."; + public const string net_uri_SizeLimit = "Invalid URI: The Uri string is too long."; + public const string net_uri_UserDrivenParsing = "A derived type '{0}' is responsible for parsing this Uri instance. The base implementation must not be used."; + public const string net_uri_NotJustSerialization = "UriComponents.SerializationInfoString must not be combined with other UriComponents."; + public const string net_uri_BadUnicodeHostForIdn = "An invalid Unicode character by IDN standards was specified in the host."; + public const string DebugAssertBanner = "---- DEBUG ASSERTION FAILED ----"; + public const string DebugAssertLongMessage = "---- Assert Long Message ----"; + public const string DebugAssertShortMessage = "---- Assert Short Message ----"; + public const string IO_FileNotFound = "Unable to find the specified file."; + public const string IO_FileNotFound_FileName = "Could not find file '{0}'."; + public const string IO_PathNotFound_NoPathName = "Could not find a part of the path."; + public const string IO_PathNotFound_Path = "Could not find a part of the path '{0}'."; + public const string IO_SharingViolation_File = "The process cannot access the file '{0}' because it is being used by another process."; + public const string IO_SharingViolation_NoFileName = "The process cannot access the file because it is being used by another process."; + public const string UnauthorizedAccess_IODenied_NoPathName = "Access to the path is denied."; + public const string UnauthorizedAccess_IODenied_Path = "Access to the path '{0}' is denied."; + public const string ArgumentOutOfRange_FileLengthTooBig = "Specified file length was too large for the file system."; + public const string IO_FileExists_Name = "The file '{0}' already exists."; + public const string IO_PathTooLong = "The specified file name or path is too long, or a component of the specified path is too long."; + public const string Argument_ExtraNotValid = "Extra portion of URI not valid."; + public const string Argument_InvalidUriSubcomponent = "The subcomponent, {0}, of this uri is not valid."; }