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