14[
TypeForwardedFrom(
"System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
199 private static readonly
char[]
s_pathDelims =
new char[5] {
':',
'\\',
'/',
'?',
'#' };
228 if (c !=
'/' && c !=
'\\')
386 if (
uriInfo.PathAndQuery ==
null)
410 return Array.Empty<
string>();
550 case Flags.DnsHostType:
553 case Flags.IPv6HostType:
556 case Flags.BasicHostType:
608 return (
_flags & flags) == 0;
613 return (
_flags & flags) != 0;
629 if ((flags &
Flags.MinimalUriInfoSet) ==
Flags.Zero)
653 public Uri(
string uriString)
655 if (uriString ==
null)
663 [
Obsolete(
"This constructor has been deprecated; the dontEscape parameter is always false. Use Uri(string) instead.")]
666 if (uriString ==
null)
674 [
Obsolete(
"This constructor has been deprecated; the dontEscape parameter is always false. Use Uri(Uri, string) instead.")]
677 if ((
object)baseUri ==
null)
690 if (uriString ==
null)
700 if (uriString ==
null)
709 if ((
object)baseUri ==
null)
724 if (@
string.Length != 0)
768 if ((
object)
this !=
uri2)
796 if ((
object)baseUri ==
null)
813 if ((
object)
this != uri)
915 for (
int i = 0; i <
text.Length; i++)
934 UriHelper.
UnescapeString(
host, 0,
host.Length,
array,
ref destPosition,
'\uffff',
'\uffff',
'\uffff',
UnescapeMode.CopyOnly,
_syntax,
isQuery:
false);
942 UriHelper.
UnescapeString(
_string, num,
_info.
Offset.
Query,
array,
ref destPosition,
'\uffff',
'\uffff',
'\uffff',
unescapeMode,
_syntax,
isQuery:
true);
965 if (
string.IsNullOrEmpty(name) || name.Length > 32767)
969 int end = name.Length;
995 name =
"[" + name +
"]";
1020 return string.Empty;
1051 if (pattern[
index] ==
'%' && pattern.Length -
index >= 3)
1060 return pattern[
index++];
1078 for (
int num =
schemeName.Length - 1; num > 0; num--)
1116 return text.GetHashCode();
1146 if ((
object)
uri1 ==
null || (
object)
uri2 ==
null)
1159 if ((
object)
uri1 ==
null || (
object)
uri2 ==
null)
1177 if ((
object)result ==
null)
1226 string @
string = result.
_string;
1237 if (@
string[
num3] ==
':')
1278 if ((
object)uri ==
null)
1305 return uriString[num] ==
':';
1316 return string.Empty;
1321 int length = uriString.Length;
1338 flags |= (
Flags)num;
1373 for (i = num; i <
num2; i++)
1376 if ((c =
ptr[i]) !=
'\\' && c !=
'/')
1390 if (i + 2 >=
num2 || ((c =
ptr[i + 2]) !=
'\\' && c !=
'/'))
1404 num = ((i == num || i - num == 2) ? i : (i - 1));
1416 if (num + 2 <=
num2)
1419 char c3 =
ptr[num + 1];
1422 if ((
c2 !=
'/' &&
c2 !=
'\\') || (
c3 !=
'/' &&
c3 !=
'\\'))
1509 for (
int num = (
int)(
cF &
Flags.IndexMask); i < num && (
_string[i] ==
'/' ||
_string[i] ==
'\\'); i++)
1549 cF |=
Flags.SchemeNotCanonical;
1565 for (;
_string[i] !=
'@'; i++)
1575 i = (int)(
cF &
Flags.IndexMask);
1579 cF |=
Flags.SchemeNotCanonical;
1597 if ((uint)
num3 <= 9
u)
1604 for (i++; i <
uriInfo.Offset.End; i++)
1607 if ((uint)
num4 > 9
u)
1631 cF |=
Flags.MinimalUriInfoSet;
1634 while ((flags &
Flags.MinimalUriInfoSet) ==
Flags.Zero)
1638 if (
num5 == (ulong)flags)
1663 if (
text.Length != 0)
1673 if ((check &
Check.DisplayCanonical) == 0 && (
NotAny(
Flags.ImplicitFile) || (check &
Check.ReservedFound) != 0))
1675 flags |=
Flags.HostNotCanonical;
1679 check &=
~Check.EscapedCanonical;
1681 if ((check & (
Check.EscapedCanonical |
Check.BackslashInPath)) !=
Check.EscapedCanonical)
1683 flags |=
Flags.E_HostNotCanonical;
1698 for (
int i = 0; i <
text.Length; i++)
1717 switch (flags &
Flags.HostTypeMask)
1719 case Flags.DnsHostType:
1722 case Flags.IPv6HostType:
1725 case Flags.IPv4HostType:
1728 case Flags.UncHostType:
1731 case Flags.BasicHostType:
1733 if (
text.Length == 0)
1738 case Flags.HostTypeMask:
1739 text =
string.Empty;
1746 flags |=
Flags.LoopbackHost;
1760 if (
text.Length >= 65520)
1771 flags = (
Flags)((ulong)flags & 0xFFFFFFFFFFF8FFFF
uL);
1772 flags |=
Flags.HostTypeMask;
1775 if (
err != 0 || (flags &
Flags.HostTypeMask) ==
Flags.HostTypeMask)
1782 for (
int i = 0; i <
text.Length; i++)
1795 if (
string.IsNullOrEmpty(
text2))
1803 for (
int j = 0;
j <
text2.Length;
j++)
1835 ushort num = (ushort)(((ushort)
_flags & 0
x3F80) >> 6);
1838 num = (ushort)(num | 1
u);
1844 num = (ushort)(num | 0
x10u);
1848 num = (ushort)(num | 0
x10u);
1864 ushort num = (ushort)((ushort)
_flags & 0x7F
u);
1869 num = (ushort)(num | 0
x10u);
1873 num = (ushort)(num | 0
x10u);
1892 if (@
string.Length <= 512)
1957 if (
text.Length != 0)
1997 string result =
format.ToString();
2066 return dest.ToString();
2132 return string.Empty;
2139 return string.Empty;
2148 return string.Empty;
2157 return string.Empty;
2166 return string.Empty;
2191 return string.Empty;
2196 return string.Empty;
2231 flags |=
Flags.SchemeNotCanonical;
2241 flags |=
Flags.SchemeNotCanonical;
2246 flags |=
Flags.SchemeNotCanonical;
2253 if ((check &
Check.DisplayCanonical) == 0)
2255 flags |=
Flags.UserNotCanonical;
2257 if ((check & (
Check.EscapedCanonical |
Check.BackslashInPath)) !=
Check.EscapedCanonical)
2259 flags |=
Flags.E_UserNotCanonical;
2263 flags |=
Flags.UserIriCanonical;
2298 scheme = @
string.IndexOf(
'?');
2340 flags |=
Flags.FirstSlashAbsent;
2358 flags |=
Flags.ShouldBeCompressed;
2360 if ((check &
Check.BackslashInPath) != 0)
2362 flags |=
Flags.BackslashInPath;
2365 else if ((check &
Check.BackslashInPath) != 0)
2367 flags |=
Flags.E_PathNotCanonical;
2372 flags |=
Flags.PathNotCanonical;
2377 check &=
~Check.EscapedCanonical;
2379 if ((check &
Check.EscapedCanonical) == 0)
2381 flags |=
Flags.E_PathNotCanonical;
2385 flags |=
Flags.PathIriCanonical;
2422 if ((check &
Check.DisplayCanonical) == 0)
2424 flags |=
Flags.QueryNotCanonical;
2426 if ((check & (
Check.EscapedCanonical |
Check.BackslashInPath)) !=
Check.EscapedCanonical)
2428 flags |=
Flags.E_QueryNotCanonical;
2432 flags |=
Flags.QueryIriCanonical;
2459 if ((check &
Check.DisplayCanonical) == 0)
2461 flags |=
Flags.FragmentNotCanonical;
2463 if ((check & (
Check.EscapedCanonical |
Check.BackslashInPath)) !=
Check.EscapedCanonical)
2465 flags |=
Flags.E_FragmentNotCanonical;
2469 flags |=
Flags.FragmentIriCanonical;
2487 for (
j = i;
j <
length && uriString[
j] !=
':';
j++)
2493 if (i + 2 >=
length ||
j == i)
2499 if ((c = uriString[i + 1]) ==
':' || c ==
'|')
2503 if ((c = uriString[i + 2]) ==
'\\' || c ==
'/')
2522 if ((c = uriString[i]) ==
'/' || c ==
'\\')
2524 if ((c = uriString[i + 1]) ==
'\\' || c ==
'/')
2528 for (i += 2; i <
length; i++)
2530 if ((c = uriString[i]) !=
'/' && c !=
'\\')
2555 if (
span.Length == 0)
2620 switch (
span.Length)
2666 for (
int i = 1; i <
span.Length; i++)
2669 if ((uint)(
c3 - 97) > 25
u && (uint)(
c3 - 65) > 25
u && (uint)(
c3 - 48) > 9
u &&
c3 !=
'+' &&
c3 !=
'-' &&
c3 !=
'.')
2674 if (
span.Length > 1024)
2690 if ((uint)(c - 65) > 25
u)
2694 return (
char)(c | 0x20
u);
2706 bool flag2 = (flags &
Flags.HasUnicode) != 0;
2721 flags |=
Flags.BasicHostType;
2730 flags |=
Flags.HostUnicodeNormalized;
2752 flags |=
Flags.HasUserInfo;
2778 flags |=
Flags.IPv6HostType;
2782 flags |=
Flags.HostUnicodeNormalized;
2788 flags |=
Flags.IPv4HostType;
2792 flags |=
Flags.HostUnicodeNormalized;
2798 flags |=
Flags.DnsHostType;
2801 flags |=
Flags.CanonicalDnsHost;
2810 flags |=
Flags.UncHostType;
2814 flags |=
Flags.HostUnicodeNormalized;
2823 flags |=
Flags.HostTypeMask;
2826 flags &=
~Flags.HostTypeMask;
2857 flags &=
~Flags.HostTypeMask;
2876 flags &=
~Flags.HostTypeMask;
2885 flags &=
~Flags.HostTypeMask;
2888 if ((flags &
Flags.HostTypeMask) ==
Flags.Zero)
2890 flags &=
~Flags.HasUserInfo;
2893 flags |=
Flags.BasicHostType;
2908 flags |=
Flags.HostUnicodeNormalized;
2923 flags |=
Flags.HostTypeMask;
2926 flags |=
Flags.BasicHostType;
2939 flags |=
Flags.HostUnicodeNormalized;
2945 flags |=
Flags.HostTypeMask;
2954 flags |=
Flags.DnsHostType;
2968 flags |=
Flags.HostUnicodeNormalized;
2978 for (i =
idx; i < end; i++)
2981 if (c <=
'\u001f' || (c >=
'\u007f' && c <=
'\u009f'))
2985 check |=
Check.ReservedFound;
2993 check |=
Check.FoundNonAscii;
2994 if (
char.IsHighSurrogate(c))
3007 check |=
Check.NotIriCanonical;
3024 check |=
Check.ReservedFound;
3035 check |=
Check.ReservedFound;
3040 if (c ==
'/' || c ==
'\\')
3042 if ((check &
Check.BackslashInPath) == 0 && c ==
'\\')
3044 check |=
Check.BackslashInPath;
3046 if ((check &
Check.DotSlashAttn) == 0 && i + 1 != end && (
str[i + 1] ==
'/' ||
str[i + 1] ==
'\\'))
3048 check |=
Check.DotSlashAttn;
3054 if (((check &
Check.DotSlashAttn) == 0 && i + 1 == end) ||
str[i + 1] ==
'.' ||
str[i + 1] ==
'/' ||
str[i + 1] ==
'\\' ||
str[i + 1] ==
'?' ||
str[i + 1] ==
'#')
3056 check |=
Check.DotSlashAttn;
3060 if ((c >
'"' || c ==
'!') && (c <
'[' || c >
'^'))
3084 if (c ==
'.' || c ==
'/' || c ==
'\\')
3086 check |=
Check.DotSlashEscaped;
3103 check |=
Check.NotIriCanonical;
3110 check |=
Check.EscapedCanonical;
3115 check |=
Check.DisplayCanonical;
3118 check |=
Check.EscapedCanonical;
3146 int end =
dest.Length;
3184 dest[num - 1] =
':';
3246 if (end -
start < 3)
3250 char*
ptr =
pch + end - 2;
3255 if (*(
pch++) !=
'%')
3268 if ((*(
ptr2++) = *(
pch++)) ==
'%')
3386 int num =
basePart.OriginalString.IndexOf(
':');
3391 num =
basePart.OriginalString.IndexOf(
':', num + 1);
3425 if (c ==
'/' || (c ==
'\\' && flag))
3432 if (!flag || c !=
'\\')
3457 if (c !=
'\uffff' ||
c2 !=
'\uffff')
3504 if (
path1[i] ==
'/')
3515 return string.Empty;
3518 for (; i <
path1.Length; i++)
3520 if (
path1[i] ==
'/')
3532 [
Obsolete(
"Uri.MakeRelative has been deprecated. Use MakeRelativeUri(Uri uri) instead.")]
3547 return toUri.ToString();
3550 [
Obsolete(
"Uri.Canonicalize has been deprecated and is not supported.")]
3555 [
Obsolete(
"Uri.Parse has been deprecated and is not supported.")]
3560 [
Obsolete(
"Uri.Escape has been deprecated and is not supported.")]
3565 [
Obsolete(
"Uri.Unescape has been deprecated. Use GetComponents() or static UnescapeDataString() to unescape a Uri component or a string.")]
3568 char[]
dest =
new char[
path.Length];
3570 dest =
UriHelper.
UnescapeString(
path, 0,
path.Length,
dest,
ref destPosition,
'\uffff',
'\uffff',
'\uffff',
UnescapeMode.Unescape |
UnescapeMode.UnescapeAll,
null,
isQuery:
false);
3574 [
Obsolete(
"Uri.EscapeString has been deprecated. Use GetComponents() or Uri.EscapeDataString to escape a Uri component or a string.")]
3581 return string.Empty;
3584 [
Obsolete(
"Uri.CheckSecurity has been deprecated and is not supported.")]
3589 [
Obsolete(
"Uri.IsReservedCharacter has been deprecated and is not supported.")]
3599 [
Obsolete(
"Uri.IsExcludedCharacter has been deprecated and is not supported.")]
3609 [
Obsolete(
"Uri.IsBadFileSystemCharacter has been deprecated and is not supported.")]
3625 _string = uri ??
string.Empty;
3632 _flags |=
Flags.DisablePathAndQueryCanonicalization;
3770 for (
int i = 0; i < data.Length; i++)
3775 if ((uint)(i + 2) < (uint)data.Length)
3785 else if (c >
'\u007f')
3795 if (uriString ==
null)
3805 return result !=
null;
3812 if (uriString ==
null)
3821 return result !=
null;
3844 if ((
object)baseUri ==
null || (
object)
relativeUri ==
null)
3869 if ((
object)result ==
null)
3878 return result.IsAbsoluteUri;
3919 if ((
object)
uri1 ==
null)
3921 if ((
object)
uri2 ==
null)
3927 if ((
object)
uri2 ==
null)
3931 if (!
uri1.IsAbsoluteUri || !
uri2.IsAbsoluteUri)
3933 if (!
uri1.IsAbsoluteUri)
3935 if (!
uri2.IsAbsoluteUri)
3961 return result.IsWellFormedOriginalString();
3987 if ((flags &
Flags.IriCanonical) !=
Flags.Zero)
3993 if ((flags & (
Flags.E_PathNotCanonical |
Flags.PathIriCanonical)) == (
Flags.E_PathNotCanonical |
Flags.PathIriCanonical))
3997 if ((flags & (
Flags.E_QueryNotCanonical |
Flags.QueryIriCanonical)) == (
Flags.E_QueryNotCanonical |
Flags.QueryIriCanonical))
4001 if ((flags & (
Flags.E_FragmentNotCanonical |
Flags.FragmentIriCanonical)) == (
Flags.E_FragmentNotCanonical |
Flags.FragmentIriCanonical))
4006 if ((flags &
Flags.E_CannotDisplayCanonical & (
Flags.E_UserNotCanonical |
Flags.E_PathNotCanonical |
Flags.E_QueryNotCanonical |
Flags.E_FragmentNotCanonical)) !=
Flags.Zero)
4046 while (
ptr[
idx++] !=
':')
4066 return string.Empty;
4078 return dest.ToString();
4081 [
Obsolete(
"Uri.EscapeUriString can corrupt the Uri string in some cases. Consider using Uri.EscapeDataString for query string components instead.", DiagnosticId =
"SYSLIB0013", UrlFormat =
"https://aka.ms/dotnet-warnings/{0}")]
4118 flags |=
Flags.UserEscaped;
4122 flags |=
Flags.DisablePathAndQueryCanonicalization;
4128 return new Uri(flags &
Flags.UserEscaped,
null, uriString);
4163 text =
string.Empty;
4169 if (
text.Length == 0)
4217 return string.Empty;
4222 return dest.ToString();
4254 return string.Empty;
4280 if ((
object)uri ==
null)
4365 int num =
otherUri._info.Offset.Path;
int EnsureCapacity(int capacity)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
void Add(TKey key, TValue value)
static bool TryGetUnicodeEquivalent(string hostname, ref System.Text.ValueStringBuilder dest)
static string ParseCanonicalName(string str, int start, int end, ref bool loopback)
static unsafe bool IsValid(char *name, int pos, ref int returnedEnd, ref bool notCanonical, bool notImplicitFile)
static string IdnEquivalent(string hostname)
static unsafe bool IsValidByIri(char *name, int pos, ref int returnedEnd, ref bool notCanonical, bool notImplicitFile)
static CultureInfo InvariantCulture
static void ToCharsBuffer(byte value, Span< char > buffer, int startingIndex=0, Casing casing=Casing.Upper)
static bool IsHexChar(int c)
static int FromChar(int c)
static unsafe bool IsValid(char *name, int start, ref int end, bool allowIPv6, bool notImplicitFile, bool unknownScheme)
static unsafe string ParseCanonicalName(string str, int start, int end, ref bool isLoopback)
static string ParseCanonicalName(string str, int start, ref bool isLoopback, ref string scopeId)
static unsafe bool IsValid(char *name, int start, ref int end)
static unsafe string EscapeUnescapeIri(char *pInput, int start, int end, UriComponents component)
static bool CheckIriUnicodeRange(char unicode, bool isQuery)
static string net_uri_BadAuthority
static string net_uri_BadPort
static string InvalidNullArgument
static string net_uri_EmptyUri
static string net_uri_BadScheme
static string Format(string resourceFormat, object p1)
static string net_uri_BadFormat
static string net_uri_PortOutOfRange
static string net_uri_SizeLimit
static string net_uri_MustRootedPath
static string net_uri_NotAbsolute
static string net_uri_BadHostName
static string net_uri_InvalidUriKind
static string net_uri_SchemeLimit
static string net_uri_UserDrivenParsing
static string net_uri_GetComponentsCalledWhenCanonicalizationDisabled
static string net_uri_BadAuthorityTerminator
static string Argument_InvalidUriSubcomponent
static string net_uri_CannotCreateRelative
static string net_uri_NotJustSerialization
static StringComparer OrdinalIgnoreCase
static int CompareExchange(ref int location1, int value, int comparand)
static int Or(ref int location1, int value)
static string ParseCanonicalName(string str, int start, int end, ref bool loopback)
static unsafe bool IsValid(char *name, int start, ref int returnedEnd, bool notImplicitFile)
static bool IsLWS(char ch)
static ReadOnlySpan< bool > UnreservedReservedTable
static ReadOnlySpan< bool > UnreservedTable
static unsafe char[] UnescapeString(string input, int start, int end, char[] dest, ref int destPosition, char rsvd1, char rsvd2, char rsvd3, UnescapeMode unescapeMode, UriParser syntax, bool isQuery)
static bool IsAsciiLetterOrDigit(char character)
static string EscapeString(string stringToEscape, bool checkExistingEscaped, ReadOnlySpan< bool > unreserved, char forceEscape1='\0', char forceEscape2='\0')
static unsafe bool TestForSubPath(char *selfPtr, int selfLength, char *otherPtr, int otherLength, bool ignoreCase)
static bool IsAsciiLetter(char character)
static readonly char[] s_WSchars
static char DecodeHexChars(int first, int second)
static unsafe string StripBidiControlCharacters(ReadOnlySpan< char > strToClean, string backingString=null)
bool IsAllSet(UriSyntaxFlags flags)
string InternalGetComponents(Uri thisUri, UriComponents uriComponents, UriFormat uriFormat)
static readonly UriParser FtpUri
bool InternalIsBaseOf(Uri thisBaseUri, Uri uriLink)
string InternalResolve(Uri thisBaseUri, Uri uriLink, out UriFormatException parsingError)
static readonly UriParser NewsUri
static readonly UriParser NetTcpUri
static readonly UriParser WssUri
static UriParser FindOrFetchAsUnknownV1Syntax(string lwrCaseScheme)
static readonly UriParser GopherUri
bool NotAny(UriSyntaxFlags flags)
UriParser InternalOnNewUri()
static readonly UriParser TelnetUri
static readonly UriParser FileUri
static readonly UriParser NetPipeUri
void InternalValidate(Uri thisUri, out UriFormatException parsingError)
static readonly UriParser HttpsUri
bool InternalIsWellFormedOriginalString(Uri thisUri)
static readonly UriParser NntpUri
static readonly UriParser MailToUri
bool InFact(UriSyntaxFlags flags)
static readonly UriParser WsUri
static readonly UriParser HttpUri
static readonly string UriSchemeWs
static int FromHex(char digit)
string GetUriPartsFromUserString(UriComponents uriParts)
static readonly string UriSchemeNews
static void GetCombinedString(Uri baseUri, string relativeStr, bool dontEscape, ref string result)
void CreateThisFromUri(Uri otherUri)
unsafe bool IsBaseOfHelper(Uri uriLink)
Uri(string uriString, bool dontEscape)
void InitializeUri(ParsingError err, UriKind uriKind, out UriFormatException e)
unsafe string EscapeUnescapeIri(string input, int start, int end, UriComponents component)
unsafe bool InternalIsWellFormedOriginalString()
unsafe void CheckAuthorityHelperHandleDnsIri(char *pString, int start, int end, bool hasUnicode, ref Flags flags, ref bool justNormalized, ref string newHost, ref ParsingError err)
void EnsureParseRemaining()
Uri(string uriString, in UriCreationOptions creationOptions)
static readonly string UriSchemeSftp
void InterlockedSetFlags(Flags flags)
Uri(string uriString, UriKind uriKind)
UriFormatException ParseMinimal()
static Uri CreateHelper(string uriString, bool dontEscape, UriKind uriKind, ref UriFormatException e, in UriCreationOptions creationOptions=default(UriCreationOptions))
static bool TryCreate([NotNullWhen(true)] string? uriString, UriKind uriKind, [NotNullWhen(true)] out Uri? result)
virtual bool IsBadFileSystemCharacter(char character)
static bool TryCreate(Uri? baseUri, string? relativeUri, [NotNullWhen(true)] out Uri? result)
string GetComponentsHelper(UriComponents uriComponents, UriFormat uriFormat)
virtual void Canonicalize()
string GetUnescapedParts(UriComponents uriParts, UriFormat formatAs)
static bool IsHexEncoding(string pattern, int index)
static readonly string UriSchemeFtp
static string EscapeDataString(string stringToEscape)
void ISerializable. GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
Uri MakeRelativeUri(Uri uri)
virtual void CheckSecurity()
static unsafe UriHostNameType CheckHostName(string? name)
Uri(SerializationInfo serializationInfo, StreamingContext streamingContext)
static string EscapeUriString(string stringToEscape)
unsafe void GetHostViaCustomSyntax()
string GetLeftPart(UriPartial part)
static readonly string UriSchemeTelnet
Uri(Uri baseUri, string? relativeUri, bool dontEscape)
static readonly string UriSchemeFile
string _originalUnicodeString
bool DisablePathAndQueryCanonicalization
static readonly string UriSchemeNetTcp
Uri(Flags flags, UriParser uriParser, string uri)
static unsafe ParsingError ParseScheme(string uriString, ref Flags flags, ref UriParser syntax)
static bool IriParsingStatic(UriParser syntax)
static bool CheckForUnicodeOrEscapedUnreserved(string data)
static int Compare(Uri? uri1, Uri? uri2, UriComponents partsToCompare, UriFormat compareFormat, StringComparison comparisonType)
static readonly string UriSchemeWss
static string HexEscape(char character)
static readonly string UriSchemeNntp
static readonly string UriSchemeGopher
static string CreateHostStringHelper(string str, int idx, int end, ref Flags flags, ref string scopeId)
virtual string Unescape(string path)
static bool operator==(Uri? uri1, Uri? uri2)
static unsafe ParsingError CheckSchemeSyntax(ReadOnlySpan< char > span, ref UriParser syntax)
string MakeRelative(Uri toUri)
static readonly string UriSchemeMailto
Uri(Uri baseUri, Uri relativeUri)
string InternalGetComponents(UriComponents components, UriFormat format)
static bool IsExcludedCharacter(char character)
static readonly string UriSchemeSsh
static bool StaticInFact(Flags allFlags, Flags checkFlags)
virtual bool IsReservedCharacter(char character)
string PrivateAbsolutePath
static string CombineUri(Uri basePart, string relativePart, UriFormat uriFormat)
string GetParts(UriComponents uriParts, UriFormat formatAs)
static bool CheckForColonInFirstPathSegment(string uriString)
static bool TryCreate([NotNullWhen(true)] string? uriString, in UriCreationOptions creationOptions, [NotNullWhen(true)] out Uri? result)
static readonly string UriSchemeHttps
static readonly char[] s_pathDelims
static bool CheckSchemeName([NotNullWhen(true)] string? schemeName)
override string ToString()
string ReCreateParts(UriComponents parts, ushort nonCanonical, UriFormat formatAs)
static bool StaticIsFile(UriParser syntax)
static readonly string SchemeDelimiter
static bool IsWellFormedUriString([NotNullWhen(true)] string? uriString, UriKind uriKind)
static string InternalEscapeString(string rawString)
static unsafe void UnescapeOnly(char *pch, int start, ref int end, char ch1, char ch2, char ch3)
void EnsureHostString(bool allowDnsOptimization)
void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
override bool Equals([NotNullWhen(true)] object? comparand)
static char HexUnescape(string pattern, ref int index)
static bool StaticNotAny(Flags allFlags, Flags checkFlags)
unsafe void CreateHostString()
UriHostNameType HostNameType
void CreateThis(string uri, bool dontEscape, UriKind uriKind, in UriCreationOptions creationOptions=default(UriCreationOptions))
string GetEscapedParts(UriComponents uriParts)
static readonly string UriSchemeHttp
static string UnescapeDataString(string stringToUnescape)
static unsafe int ParseSchemeCheckImplicitFile(char *uriString, int length, ref ParsingError err, ref Flags flags, ref UriParser syntax)
unsafe ParsingError PrivateParseMinimal()
static UriFormatException GetException(ParsingError err)
static readonly string UriSchemeFtps
static bool IsHexDigit(char character)
Uri(Uri baseUri, string? relativeUri)
unsafe void CreateUriInfo(Flags cF)
unsafe int CheckAuthorityHelper(char *pString, int idx, int length, ref ParsingError err, ref Flags flags, UriParser syntax, ref string newHost)
@ ErrorOrParsingRecursion
@ CustomParser_ParseMinimalAlreadyCalled
@ E_CannotDisplayCanonical
static bool TryCreate(Uri? baseUri, Uri? relativeUri, [NotNullWhen(true)] out Uri? result)
string GetRelativeSerializationString(UriFormat format)
static Uri ResolveHelper(Uri baseUri, Uri relativeUri, ref string newUriString, ref bool userEscaped)
unsafe void ParseRemaining()
static string PathDifference(string path1, string path2, bool compareCase)
void CreateUri(Uri baseUri, string relativeUri, bool dontEscape)
static int Compress(Span< char > span, UriParser syntax)
unsafe void GetCanonicalPath(ref System.Text.ValueStringBuilder dest, UriFormat formatAs)
static string EscapeString(string? str)
override int GetHashCode()
unsafe Check CheckCanonical(char *str, ref int idx, int end, char delim)
static bool operator!=(Uri? uri1, Uri? uri2)
string GetComponents(UriComponents components, UriFormat format)
void GetLengthWithoutTrailingSpaces(string str, ref int length, int idx)
static readonly string UriSchemeNetPipe
bool IsWellFormedOriginalString()
static void Compress(char[] dest, int start, ref int destLength, UriParser syntax)
void GetObjectData(SerializationInfo info, StreamingContext context)