287 references to UriSyntaxFlags
System.Private.Uri (287)
System\GenericUriParser.cs (32)
61private static UriSyntaxFlags MapGenericParserOptions(GenericUriParserOptions options) 67UriSyntaxFlags flags = DefaultGenericUriParserFlags; 72flags &= ~(UriSyntaxFlags.MayHaveUserInfo | UriSyntaxFlags.MayHavePort | UriSyntaxFlags.AllowUncHost | UriSyntaxFlags.AllowAnInternetHost); 73flags |= UriSyntaxFlags.AllowAnyOtherHost; 78flags |= UriSyntaxFlags.AllowEmptyHost; 83flags &= ~UriSyntaxFlags.MayHaveUserInfo; 88flags &= ~UriSyntaxFlags.MayHavePort; 93flags &= ~UriSyntaxFlags.MayHaveQuery; 98flags &= ~UriSyntaxFlags.MayHaveFragment; 103flags &= ~UriSyntaxFlags.ConvertPathSlashes; 108flags &= ~(UriSyntaxFlags.CompressPath | UriSyntaxFlags.CanonicalizeAsFilePath); 113flags &= ~UriSyntaxFlags.UnEscapeDotsAndSlashes; 118flags |= UriSyntaxFlags.AllowIdn; 123flags |= UriSyntaxFlags.AllowIriParsing; 129private const UriSyntaxFlags DefaultGenericUriParserFlags = 130UriSyntaxFlags.MustHaveAuthority | 131UriSyntaxFlags.MayHaveUserInfo | 132UriSyntaxFlags.MayHavePort | 133UriSyntaxFlags.MayHavePath | 134UriSyntaxFlags.MayHaveQuery | 135UriSyntaxFlags.MayHaveFragment | 136UriSyntaxFlags.AllowUncHost | 137UriSyntaxFlags.AllowAnInternetHost | 138UriSyntaxFlags.PathIsRooted | 139UriSyntaxFlags.ConvertPathSlashes | 140UriSyntaxFlags.CompressPath | 141UriSyntaxFlags.CanonicalizeAsFilePath | 142UriSyntaxFlags.UnEscapeDotsAndSlashes;
System\Uri.cs (72)
271return syntax is null || syntax.InFact(UriSyntaxFlags.AllowIriParsing); 954return syntax.InFact(UriSyntaxFlags.FileLikeUri); 1530if (_syntax.InFact(UriSyntaxFlags.MailToLikeUri)) 1826if (_syntax.InFact(UriSyntaxFlags.MailToLikeUri)) 1828if (!other._syntax.InFact(UriSyntaxFlags.MailToLikeUri)) 2016if (_syntax.IsAllSet(UriSyntaxFlags.AllowEmptyHost | UriSyntaxFlags.AllowDOSPath) 2030if (_syntax.InFact(UriSyntaxFlags.FileLikeUri) || i - idx <= 3) 2044if (_syntax.InFact(UriSyntaxFlags.FileLikeUri)) 2052if (_syntax.InFact(UriSyntaxFlags.MustHaveAuthority)) 2069else if (_syntax.InFact(UriSyntaxFlags.FileLikeUri) && (i - idx >= 2 && i - idx != 3 && 2077else if (!OperatingSystem.IsWindows() && _syntax.InFact(UriSyntaxFlags.FileLikeUri) && pUriString[i - 1] == '/' && i - idx == 3) 2096if (_syntax.InFact(UriSyntaxFlags.MustHaveAuthority)) 2109else if (_syntax.InFact(UriSyntaxFlags.OptionalAuthority) && (InFact(Flags.AuthorityFound) || 2117else if (_syntax.NotAny(UriSyntaxFlags.MailToLikeUri)) 2129else if (_syntax.InFact(UriSyntaxFlags.MustHaveAuthority)) 2135else if (_syntax.NotAny(UriSyntaxFlags.MailToLikeUri)) 2177if (hostTerminator == '\\' && NotAny(Flags.ImplicitFile) && _syntax.NotAny(UriSyntaxFlags.AllowDOSPath)) 3213UriSyntaxFlags syntaxFlags = _syntax.Flags; 3317if (IsImplicitFile || (syntaxFlags & UriSyntaxFlags.MayHaveQuery) == 0) 3345if (IsImplicitFile || ((syntaxFlags & (UriSyntaxFlags.MayHaveQuery | UriSyntaxFlags.MayHaveFragment)) == 0)) 3353if (_syntax.InFact(UriSyntaxFlags.MayHaveQuery)) 3355if (_syntax.InFact(UriSyntaxFlags.MayHaveFragment)) 3366Debug.Assert(_syntax.InFact(UriSyntaxFlags.MayHaveFragment)); 3390if (IsImplicitFile || ((syntaxFlags & (UriSyntaxFlags.MayHaveQuery | UriSyntaxFlags.MayHaveFragment)) == 0)) 3396result = CheckCanonical(str, ref idx, length, (((syntaxFlags & UriSyntaxFlags.MayHaveQuery) != 0) 3397? '?' : _syntax.InFact(UriSyntaxFlags.MayHaveFragment) ? '#' : c_EOL)); 3410if (((_flags & Flags.AuthorityFound) != 0) && ((syntaxFlags & UriSyntaxFlags.PathIsRooted) != 0) 3421(((syntaxFlags & (UriSyntaxFlags.CompressPath | UriSyntaxFlags.ConvertPathSlashes)) != 0) || 3422_syntax.InFact(UriSyntaxFlags.UnEscapeDotsAndSlashes)))) 3424if (((result & Check.DotSlashEscaped) != 0) && _syntax.InFact(UriSyntaxFlags.UnEscapeDotsAndSlashes)) 3430if (((syntaxFlags & (UriSyntaxFlags.ConvertPathSlashes)) != 0) && (result & Check.BackslashInPath) != 0) 3436if (((syntaxFlags & (UriSyntaxFlags.CompressPath)) != 0) && ((cF & Flags.E_PathNotCanonical) != 0 || 3497if ((syntaxFlags & (UriSyntaxFlags.MayHaveFragment)) != 0) 3532result = CheckCanonical(str, ref idx, length, ((syntaxFlags & (UriSyntaxFlags.MayHaveFragment)) != 0) 3795UriSyntaxFlags syntaxFlags = syntax.Flags; 3808if (syntax.InFact(UriSyntaxFlags.AllowEmptyHost)) 3824if ((syntaxFlags & UriSyntaxFlags.MayHaveUserInfo) != 0) 3857if (ch == '[' && syntax.InFact(UriSyntaxFlags.AllowIPv6Host) && 3867else if (char.IsAsciiDigit(ch) && syntax.InFact(UriSyntaxFlags.AllowIPv4Host) && 3868IPv4AddressHelper.IsValid(pString, start, ref end, false, StaticNotAny(flags, Flags.ImplicitFile), syntax.InFact(UriSyntaxFlags.V1_UnknownUri))) 3877else if (((syntaxFlags & UriSyntaxFlags.AllowDnsHost) != 0) && !IriParsingStatic(syntax) && 3891else if (((syntaxFlags & UriSyntaxFlags.AllowDnsHost) != 0) && 3892(hasUnicode || syntax.InFact(UriSyntaxFlags.AllowIdn)) && 3900else if ((syntaxFlags & UriSyntaxFlags.AllowUncHost) != 0) 3923if (syntax.InFact(UriSyntaxFlags.V1_UnknownUri)) 3936if (syntax.InFact(UriSyntaxFlags.MayHavePort)) 3955if (syntax.InFact(UriSyntaxFlags.AllowAnyOtherHost) 3956&& syntax.NotAny(UriSyntaxFlags.V1_UnknownUri)) 3971if (syntax.InFact(UriSyntaxFlags.AllowAnyOtherHost)) 4000if (syntax.InFact(UriSyntaxFlags.AllowAnyOtherHost)) 4031if (syntax.InFact(UriSyntaxFlags.V1_UnknownUri)) 4072else if (syntax.InFact(UriSyntaxFlags.MustHaveAuthority) || 4073(syntax.InFact(UriSyntaxFlags.MailToLikeUri))) 4184else if (delim == '?' && c == '#' && (_syntax != null && _syntax.InFact(UriSyntaxFlags.MayHaveFragment))) 4191if (IsImplicitFile || (_syntax != null && !_syntax.InFact(UriSyntaxFlags.MayHaveQuery) 4204if (IsImplicitFile || (_syntax != null && !_syntax.InFact(UriSyntaxFlags.MayHaveFragment))) 4318if (_syntax.InFact(UriSyntaxFlags.UnEscapeDotsAndSlashes) && InFact(Flags.PathNotCanonical) 4325_syntax.InFact(UriSyntaxFlags.ConvertPathSlashes) ? '\\' : c_DummyChar); 4356if (!OperatingSystem.IsWindows() && InFact(Flags.BackslashInPath) && _syntax.NotAny(UriSyntaxFlags.ConvertPathSlashes) && _syntax.InFact(UriSyntaxFlags.FileLikeUri) && !IsImplicitFile) 4379if (_syntax.InFact(UriSyntaxFlags.UnEscapeDotsAndSlashes) && InFact(Flags.PathNotCanonical) 4386_syntax.InFact(UriSyntaxFlags.ConvertPathSlashes) ? '\\' : c_DummyChar); 4556if (syntax.InFact(UriSyntaxFlags.ConvertPathSlashes)) 4592bool skipSegment = syntax.NotAny(UriSyntaxFlags.CanonicalizeAsFilePath) 4645if (span.Length != 0 && syntax.InFact(UriSyntaxFlags.CanonicalizeAsFilePath)) 4757bool convBackSlashes = basePart.Syntax.InFact(UriSyntaxFlags.ConvertPathSlashes); 4811c1 = basePart.Syntax.InFact(UriSyntaxFlags.MayHaveQuery) ? '?' : c_DummyChar; 4814char c2 = (!basePart.IsImplicitFile && basePart.Syntax.InFact(UriSyntaxFlags.MayHaveFragment)) ? '#' :
System\UriBuilder.cs (3)
328schemeDelimiter = syntax.InFact(UriSyntaxFlags.MustHaveAuthority) 329|| (host.Length != 0 && syntax.NotAny(UriSyntaxFlags.MailToLikeUri) && syntax.InFact(UriSyntaxFlags.OptionalAuthority))
System\UriExt.cs (5)
844if (relativeStr[0] == '#' && !baseUri.IsImplicitFile && baseUri.Syntax!.InFact(UriSyntaxFlags.MayHaveFragment)) 852if (relativeStr[0] == '?' && !baseUri.IsImplicitFile && baseUri.Syntax!.InFact(UriSyntaxFlags.MayHaveQuery)) 871else if (baseUri.Syntax!.InFact(UriSyntaxFlags.AllowDOSPath)) 876prefix = baseUri.Syntax.InFact(UriSyntaxFlags.PathIsRooted) ? ":///" : "://"; 878prefix = baseUri.Syntax.InFact(UriSyntaxFlags.PathIsRooted) ? ":/" : ":";
System\UriScheme.cs (3)
33private const UriSyntaxFlags SchemeOnlyFlags = UriSyntaxFlags.MayHavePath; 194return syntax != null && syntax.NotAny(UriSyntaxFlags.V1_UnknownUri);
System\UriSyntax.cs (172)
99private UriSyntaxFlags _flags; 112internal BuiltInUriParser(string lwrCaseScheme, int defaultPort, UriSyntaxFlags syntaxFlags) 113: base(syntaxFlags | UriSyntaxFlags.SimpleUserSyntax) 120internal UriSyntaxFlags Flags 128internal bool NotAny(UriSyntaxFlags flags) 131return IsFullMatch(flags, UriSyntaxFlags.None); 134internal bool InFact(UriSyntaxFlags flags) 137return !IsFullMatch(flags, UriSyntaxFlags.None); 140internal bool IsAllSet(UriSyntaxFlags flags) 146private bool IsFullMatch(UriSyntaxFlags flags, UriSyntaxFlags expected) 154internal UriParser(UriSyntaxFlags flags) 167syntax._flags &= ~UriSyntaxFlags.V1_UnknownUri; 226return InFact(UriSyntaxFlags.SimpleUserSyntax); 245_flags |= UriSyntaxFlags.SimpleUserSyntax; 298private const UriSyntaxFlags UnknownV1SyntaxFlags = 299UriSyntaxFlags.V1_UnknownUri | // This flag must be always set here 300UriSyntaxFlags.OptionalAuthority | 302UriSyntaxFlags.MayHaveUserInfo | 303UriSyntaxFlags.MayHavePort | 304UriSyntaxFlags.MayHavePath | 305UriSyntaxFlags.MayHaveQuery | 306UriSyntaxFlags.MayHaveFragment | 308UriSyntaxFlags.AllowEmptyHost | 309UriSyntaxFlags.AllowUncHost | // V1 compat 310UriSyntaxFlags.AllowAnInternetHost | 311UriSyntaxFlags.PathIsRooted | 312UriSyntaxFlags.AllowDOSPath | // V1 compat, actually we should not parse DOS file out of an unknown scheme 313UriSyntaxFlags.ConvertPathSlashes | // V1 compat, it will always convert backslashes 314UriSyntaxFlags.CompressPath | // V1 compat, it will always compress path even for non hierarchical Uris 315UriSyntaxFlags.AllowIdn | 316UriSyntaxFlags.AllowIriParsing; 318private const UriSyntaxFlags HttpSyntaxFlags = 319UriSyntaxFlags.MustHaveAuthority | 321UriSyntaxFlags.MayHaveUserInfo | 322UriSyntaxFlags.MayHavePort | 323UriSyntaxFlags.MayHavePath | 324UriSyntaxFlags.MayHaveQuery | 325UriSyntaxFlags.MayHaveFragment | 327UriSyntaxFlags.AllowUncHost | // V1 compat 328UriSyntaxFlags.AllowAnInternetHost | 330UriSyntaxFlags.PathIsRooted | 332UriSyntaxFlags.ConvertPathSlashes | 333UriSyntaxFlags.CompressPath | 334UriSyntaxFlags.CanonicalizeAsFilePath | 335UriSyntaxFlags.AllowIdn | 336UriSyntaxFlags.AllowIriParsing; 338private const UriSyntaxFlags FtpSyntaxFlags = 339UriSyntaxFlags.MustHaveAuthority | 341UriSyntaxFlags.MayHaveUserInfo | 342UriSyntaxFlags.MayHavePort | 343UriSyntaxFlags.MayHavePath | 344UriSyntaxFlags.MayHaveFragment | 346UriSyntaxFlags.AllowUncHost | // V1 compat 347UriSyntaxFlags.AllowAnInternetHost | 349UriSyntaxFlags.PathIsRooted | 351UriSyntaxFlags.ConvertPathSlashes | 352UriSyntaxFlags.CompressPath | 353UriSyntaxFlags.CanonicalizeAsFilePath | 354UriSyntaxFlags.AllowIdn | 355UriSyntaxFlags.AllowIriParsing; 357private const UriSyntaxFlags FileSyntaxFlags = 358UriSyntaxFlags.MustHaveAuthority | 360UriSyntaxFlags.AllowEmptyHost | 361UriSyntaxFlags.AllowUncHost | 362UriSyntaxFlags.AllowAnInternetHost | 364UriSyntaxFlags.MayHavePath | 365UriSyntaxFlags.MayHaveFragment | 366UriSyntaxFlags.MayHaveQuery | 368UriSyntaxFlags.FileLikeUri | 370UriSyntaxFlags.PathIsRooted | 371UriSyntaxFlags.AllowDOSPath | 373UriSyntaxFlags.ConvertPathSlashes | 374UriSyntaxFlags.CompressPath | 375UriSyntaxFlags.CanonicalizeAsFilePath | 376UriSyntaxFlags.UnEscapeDotsAndSlashes | 377UriSyntaxFlags.AllowIdn | 378UriSyntaxFlags.AllowIriParsing; 380private const UriSyntaxFlags UnixFileSyntaxFlags = 381FileSyntaxFlags & ~UriSyntaxFlags.ConvertPathSlashes; 383private const UriSyntaxFlags VsmacrosSyntaxFlags = 384UriSyntaxFlags.MustHaveAuthority | 386UriSyntaxFlags.AllowEmptyHost | 387UriSyntaxFlags.AllowUncHost | 388UriSyntaxFlags.AllowAnInternetHost | 390UriSyntaxFlags.MayHavePath | 391UriSyntaxFlags.MayHaveFragment | 393UriSyntaxFlags.FileLikeUri | 395UriSyntaxFlags.AllowDOSPath | 396UriSyntaxFlags.ConvertPathSlashes | 397UriSyntaxFlags.CompressPath | 398UriSyntaxFlags.CanonicalizeAsFilePath | 399UriSyntaxFlags.UnEscapeDotsAndSlashes | 400UriSyntaxFlags.AllowIdn | 401UriSyntaxFlags.AllowIriParsing; 403private const UriSyntaxFlags GopherSyntaxFlags = 404UriSyntaxFlags.MustHaveAuthority | 406UriSyntaxFlags.MayHaveUserInfo | 407UriSyntaxFlags.MayHavePort | 408UriSyntaxFlags.MayHavePath | 409UriSyntaxFlags.MayHaveFragment | 411UriSyntaxFlags.AllowUncHost | // V1 compat 412UriSyntaxFlags.AllowAnInternetHost | 414UriSyntaxFlags.PathIsRooted | 415UriSyntaxFlags.AllowIdn | 416UriSyntaxFlags.AllowIriParsing; 419private const UriSyntaxFlags NewsSyntaxFlags = 420UriSyntaxFlags.MayHavePath | 421UriSyntaxFlags.MayHaveFragment | 422UriSyntaxFlags.AllowIriParsing; 424private const UriSyntaxFlags NntpSyntaxFlags = 425UriSyntaxFlags.MustHaveAuthority | 427UriSyntaxFlags.MayHaveUserInfo | 428UriSyntaxFlags.MayHavePort | 429UriSyntaxFlags.MayHavePath | 430UriSyntaxFlags.MayHaveFragment | 432UriSyntaxFlags.AllowUncHost | // V1 compat 433UriSyntaxFlags.AllowAnInternetHost | 435UriSyntaxFlags.PathIsRooted | 436UriSyntaxFlags.AllowIdn | 437UriSyntaxFlags.AllowIriParsing; 440private const UriSyntaxFlags TelnetSyntaxFlags = 441UriSyntaxFlags.MustHaveAuthority | 443UriSyntaxFlags.MayHaveUserInfo | 444UriSyntaxFlags.MayHavePort | 445UriSyntaxFlags.MayHavePath | 446UriSyntaxFlags.MayHaveFragment | 448UriSyntaxFlags.AllowUncHost | // V1 compat 449UriSyntaxFlags.AllowAnInternetHost | 451UriSyntaxFlags.PathIsRooted | 452UriSyntaxFlags.AllowIdn | 453UriSyntaxFlags.AllowIriParsing; 456private const UriSyntaxFlags LdapSyntaxFlags = 457UriSyntaxFlags.MustHaveAuthority | 459UriSyntaxFlags.AllowEmptyHost | 460UriSyntaxFlags.AllowUncHost | // V1 compat 461UriSyntaxFlags.AllowAnInternetHost | 463UriSyntaxFlags.MayHaveUserInfo | 464UriSyntaxFlags.MayHavePort | 465UriSyntaxFlags.MayHavePath | 466UriSyntaxFlags.MayHaveQuery | 467UriSyntaxFlags.MayHaveFragment | 469UriSyntaxFlags.PathIsRooted | 470UriSyntaxFlags.AllowIdn | 471UriSyntaxFlags.AllowIriParsing; 474private const UriSyntaxFlags MailtoSyntaxFlags = 476UriSyntaxFlags.AllowEmptyHost | 477UriSyntaxFlags.AllowUncHost | // V1 compat 478UriSyntaxFlags.AllowAnInternetHost | 480UriSyntaxFlags.MayHaveUserInfo | 481UriSyntaxFlags.MayHavePort | 482UriSyntaxFlags.MayHavePath | 483UriSyntaxFlags.MayHaveFragment | 484UriSyntaxFlags.MayHaveQuery | //to maintain compat 486UriSyntaxFlags.MailToLikeUri | 487UriSyntaxFlags.AllowIdn | 488UriSyntaxFlags.AllowIriParsing; 492private const UriSyntaxFlags NetPipeSyntaxFlags = 493UriSyntaxFlags.MustHaveAuthority | 494UriSyntaxFlags.MayHavePath | 495UriSyntaxFlags.MayHaveQuery | 496UriSyntaxFlags.MayHaveFragment | 497UriSyntaxFlags.AllowAnInternetHost | 498UriSyntaxFlags.PathIsRooted | 499UriSyntaxFlags.ConvertPathSlashes | 500UriSyntaxFlags.CompressPath | 501UriSyntaxFlags.CanonicalizeAsFilePath | 502UriSyntaxFlags.UnEscapeDotsAndSlashes | 503UriSyntaxFlags.AllowIdn | 504UriSyntaxFlags.AllowIriParsing; 507private const UriSyntaxFlags NetTcpSyntaxFlags = NetPipeSyntaxFlags | UriSyntaxFlags.MayHavePort;