294 references to UriSyntaxFlags
System (294)
net\System\_UriSyntax.cs (179)
67
private
UriSyntaxFlags
m_Flags;
73
private volatile
UriSyntaxFlags
m_UpdatableFlags;
77
private const
UriSyntaxFlags
c_UpdatableFlags =
UriSyntaxFlags
.UnEscapeDotsAndSlashes;
205
internal BuiltInUriParser(string lwrCaseScheme, int defaultPort,
UriSyntaxFlags
syntaxFlags)
206
: base ((syntaxFlags |
UriSyntaxFlags
.SimpleUserSyntax |
UriSyntaxFlags
.BuiltInSyntax))
213
internal
UriSyntaxFlags
Flags {
219
internal bool NotAny(
UriSyntaxFlags
flags)
222
return IsFullMatch(flags,
UriSyntaxFlags
.None);
225
internal bool InFact(
UriSyntaxFlags
flags)
228
return !IsFullMatch(flags,
UriSyntaxFlags
.None);
231
internal bool IsAllSet(
UriSyntaxFlags
flags)
237
private bool IsFullMatch(
UriSyntaxFlags
flags,
UriSyntaxFlags
expected)
245
UriSyntaxFlags
mergedFlags;
264
internal UriParser(
UriSyntaxFlags
flags)
277
syntax.m_Flags &= ~
UriSyntaxFlags
.V1_UnknownUri;
339
return InFact(
UriSyntaxFlags
.SimpleUserSyntax);
358
m_Flags |=
UriSyntaxFlags
.SimpleUserSyntax;
366
internal void SetUpdatableFlags(
UriSyntaxFlags
flags) {
426
private const
UriSyntaxFlags
UnknownV1SyntaxFlags =
427
UriSyntaxFlags
.V1_UnknownUri | // This flag must be always set here
428
UriSyntaxFlags
.OptionalAuthority |
430
UriSyntaxFlags
.MayHaveUserInfo |
431
UriSyntaxFlags
.MayHavePort |
432
UriSyntaxFlags
.MayHavePath |
433
UriSyntaxFlags
.MayHaveQuery |
434
UriSyntaxFlags
.MayHaveFragment |
436
UriSyntaxFlags
.AllowEmptyHost |
437
UriSyntaxFlags
.AllowUncHost | //
438
UriSyntaxFlags
.AllowAnInternetHost |
441
UriSyntaxFlags
.PathIsRooted |
442
UriSyntaxFlags
.AllowDOSPath | //
443
UriSyntaxFlags
.ConvertPathSlashes | // V1 compat, it will always convert backslashes
444
UriSyntaxFlags
.CompressPath | // V1 compat, it will always compress path even for non hierarchical Uris
445
UriSyntaxFlags
.AllowIdn |
446
UriSyntaxFlags
.AllowIriParsing;
448
private static readonly
UriSyntaxFlags
HttpSyntaxFlags =
449
UriSyntaxFlags
.MustHaveAuthority |
451
UriSyntaxFlags
.MayHaveUserInfo |
452
UriSyntaxFlags
.MayHavePort |
453
UriSyntaxFlags
.MayHavePath |
454
UriSyntaxFlags
.MayHaveQuery |
455
UriSyntaxFlags
.MayHaveFragment |
457
UriSyntaxFlags
.AllowUncHost | //
458
UriSyntaxFlags
.AllowAnInternetHost |
460
UriSyntaxFlags
.PathIsRooted |
462
UriSyntaxFlags
.ConvertPathSlashes |
463
UriSyntaxFlags
.CompressPath |
464
UriSyntaxFlags
.CanonicalizeAsFilePath |
466
?
UriSyntaxFlags
.UnEscapeDotsAndSlashes :
UriSyntaxFlags
.None) |
467
UriSyntaxFlags
.AllowIdn |
468
UriSyntaxFlags
.AllowIriParsing;
470
private const
UriSyntaxFlags
FtpSyntaxFlags =
471
UriSyntaxFlags
.MustHaveAuthority |
473
UriSyntaxFlags
.MayHaveUserInfo |
474
UriSyntaxFlags
.MayHavePort |
475
UriSyntaxFlags
.MayHavePath |
476
UriSyntaxFlags
.MayHaveFragment |
478
UriSyntaxFlags
.AllowUncHost | //
479
UriSyntaxFlags
.AllowAnInternetHost |
481
UriSyntaxFlags
.PathIsRooted |
483
UriSyntaxFlags
.ConvertPathSlashes |
484
UriSyntaxFlags
.CompressPath |
485
UriSyntaxFlags
.CanonicalizeAsFilePath|
486
UriSyntaxFlags
.AllowIdn |
487
UriSyntaxFlags
.AllowIriParsing;
489
private static readonly
UriSyntaxFlags
FileSyntaxFlags =
490
UriSyntaxFlags
.MustHaveAuthority |
492
UriSyntaxFlags
.AllowEmptyHost |
493
UriSyntaxFlags
.AllowUncHost |
494
UriSyntaxFlags
.AllowAnInternetHost |
496
UriSyntaxFlags
.MayHavePath |
497
UriSyntaxFlags
.MayHaveFragment |
499
?
UriSyntaxFlags
.None :
UriSyntaxFlags
.MayHaveQuery) |
501
UriSyntaxFlags
.FileLikeUri |
503
UriSyntaxFlags
.PathIsRooted |
504
UriSyntaxFlags
.AllowDOSPath |
506
UriSyntaxFlags
.ConvertPathSlashes |
507
UriSyntaxFlags
.CompressPath |
508
UriSyntaxFlags
.CanonicalizeAsFilePath |
509
UriSyntaxFlags
.UnEscapeDotsAndSlashes |
510
UriSyntaxFlags
.AllowIdn |
511
UriSyntaxFlags
.AllowIriParsing;
515
private const
UriSyntaxFlags
VsmacrosSyntaxFlags =
516
UriSyntaxFlags
.MustHaveAuthority |
518
UriSyntaxFlags
.AllowEmptyHost |
519
UriSyntaxFlags
.AllowUncHost |
520
UriSyntaxFlags
.AllowAnInternetHost |
522
UriSyntaxFlags
.MayHavePath |
523
UriSyntaxFlags
.MayHaveFragment |
525
UriSyntaxFlags
.FileLikeUri |
527
UriSyntaxFlags
.AllowDOSPath |
528
UriSyntaxFlags
.ConvertPathSlashes |
529
UriSyntaxFlags
.CompressPath |
530
UriSyntaxFlags
.CanonicalizeAsFilePath |
531
UriSyntaxFlags
.UnEscapeDotsAndSlashes |
532
UriSyntaxFlags
.AllowIdn |
533
UriSyntaxFlags
.AllowIriParsing;
535
private const
UriSyntaxFlags
GopherSyntaxFlags =
536
UriSyntaxFlags
.MustHaveAuthority |
538
UriSyntaxFlags
.MayHaveUserInfo |
539
UriSyntaxFlags
.MayHavePort |
540
UriSyntaxFlags
.MayHavePath |
541
UriSyntaxFlags
.MayHaveFragment |
543
UriSyntaxFlags
.AllowUncHost | //
544
UriSyntaxFlags
.AllowAnInternetHost |
546
UriSyntaxFlags
.PathIsRooted |
547
UriSyntaxFlags
.AllowIdn |
548
UriSyntaxFlags
.AllowIriParsing;
553
private const
UriSyntaxFlags
NewsSyntaxFlags =
554
UriSyntaxFlags
.MayHavePath |
555
UriSyntaxFlags
.MayHaveFragment |
556
UriSyntaxFlags
.AllowIriParsing;
558
private const
UriSyntaxFlags
NntpSyntaxFlags =
559
UriSyntaxFlags
.MustHaveAuthority |
561
UriSyntaxFlags
.MayHaveUserInfo|
562
UriSyntaxFlags
.MayHavePort |
563
UriSyntaxFlags
.MayHavePath |
564
UriSyntaxFlags
.MayHaveFragment |
566
UriSyntaxFlags
.AllowUncHost | //
567
UriSyntaxFlags
.AllowAnInternetHost |
569
UriSyntaxFlags
.PathIsRooted |
570
UriSyntaxFlags
.AllowIdn |
571
UriSyntaxFlags
.AllowIriParsing;
574
private const
UriSyntaxFlags
TelnetSyntaxFlags =
575
UriSyntaxFlags
.MustHaveAuthority |
577
UriSyntaxFlags
.MayHaveUserInfo|
578
UriSyntaxFlags
.MayHavePort |
579
UriSyntaxFlags
.MayHavePath |
580
UriSyntaxFlags
.MayHaveFragment |
582
UriSyntaxFlags
.AllowUncHost | //
583
UriSyntaxFlags
.AllowAnInternetHost |
585
UriSyntaxFlags
.PathIsRooted |
586
UriSyntaxFlags
.AllowIdn |
587
UriSyntaxFlags
.AllowIriParsing;
590
private const
UriSyntaxFlags
LdapSyntaxFlags =
591
UriSyntaxFlags
.MustHaveAuthority |
593
UriSyntaxFlags
.AllowEmptyHost |
594
UriSyntaxFlags
.AllowUncHost | //
595
UriSyntaxFlags
.AllowAnInternetHost |
597
UriSyntaxFlags
.MayHaveUserInfo |
598
UriSyntaxFlags
.MayHavePort |
599
UriSyntaxFlags
.MayHavePath |
600
UriSyntaxFlags
.MayHaveQuery |
601
UriSyntaxFlags
.MayHaveFragment |
603
UriSyntaxFlags
.PathIsRooted |
604
UriSyntaxFlags
.AllowIdn |
605
UriSyntaxFlags
.AllowIriParsing;
608
private const
UriSyntaxFlags
MailtoSyntaxFlags =
610
UriSyntaxFlags
.AllowEmptyHost |
611
UriSyntaxFlags
.AllowUncHost | //
612
UriSyntaxFlags
.AllowAnInternetHost |
614
UriSyntaxFlags
.MayHaveUserInfo |
615
UriSyntaxFlags
.MayHavePort |
616
UriSyntaxFlags
.MayHavePath |
617
UriSyntaxFlags
.MayHaveFragment |
618
UriSyntaxFlags
.MayHaveQuery | //to maintain everett compat
620
UriSyntaxFlags
.MailToLikeUri |
621
UriSyntaxFlags
.AllowIdn |
622
UriSyntaxFlags
.AllowIriParsing;
626
private const
UriSyntaxFlags
NetPipeSyntaxFlags =
627
UriSyntaxFlags
.MustHaveAuthority |
628
UriSyntaxFlags
.MayHavePath |
629
UriSyntaxFlags
.MayHaveQuery |
630
UriSyntaxFlags
.MayHaveFragment |
631
UriSyntaxFlags
.AllowAnInternetHost |
632
UriSyntaxFlags
.PathIsRooted |
633
UriSyntaxFlags
.ConvertPathSlashes |
634
UriSyntaxFlags
.CompressPath |
635
UriSyntaxFlags
.CanonicalizeAsFilePath |
636
UriSyntaxFlags
.UnEscapeDotsAndSlashes |
637
UriSyntaxFlags
.AllowIdn |
638
UriSyntaxFlags
.AllowIriParsing;
641
private const
UriSyntaxFlags
NetTcpSyntaxFlags = NetPipeSyntaxFlags |
UriSyntaxFlags
.MayHavePort;
net\System\GenericUriParser.cs (32)
90
private static
UriSyntaxFlags
MapGenericParserOptions(GenericUriParserOptions options)
96
UriSyntaxFlags
flags = DefaultGenericUriParserFlags;
101
flags &= ~(
UriSyntaxFlags
.MayHaveUserInfo |
UriSyntaxFlags
.MayHavePort |
UriSyntaxFlags
.AllowUncHost |
UriSyntaxFlags
.AllowAnInternetHost);
102
flags |=
UriSyntaxFlags
.AllowAnyOtherHost;
107
flags |=
UriSyntaxFlags
.AllowEmptyHost;
112
flags &= ~
UriSyntaxFlags
.MayHaveUserInfo;
117
flags &= ~
UriSyntaxFlags
.MayHavePort;
122
flags &= ~
UriSyntaxFlags
.MayHaveQuery;
127
flags &= ~
UriSyntaxFlags
.MayHaveFragment;
132
flags &= ~
UriSyntaxFlags
.ConvertPathSlashes;
137
flags &= ~(
UriSyntaxFlags
.CompressPath |
UriSyntaxFlags
.CanonicalizeAsFilePath);
142
flags &= ~
UriSyntaxFlags
.UnEscapeDotsAndSlashes;
147
flags |=
UriSyntaxFlags
.AllowIdn;
152
flags |=
UriSyntaxFlags
.AllowIriParsing;
158
private const
UriSyntaxFlags
DefaultGenericUriParserFlags =
159
UriSyntaxFlags
.MustHaveAuthority |
161
UriSyntaxFlags
.MayHaveUserInfo |
162
UriSyntaxFlags
.MayHavePort |
163
UriSyntaxFlags
.MayHavePath |
164
UriSyntaxFlags
.MayHaveQuery |
165
UriSyntaxFlags
.MayHaveFragment |
167
UriSyntaxFlags
.AllowUncHost | //
168
UriSyntaxFlags
.AllowAnInternetHost |
170
UriSyntaxFlags
.PathIsRooted |
172
UriSyntaxFlags
.ConvertPathSlashes |
173
UriSyntaxFlags
.CompressPath |
174
UriSyntaxFlags
.CanonicalizeAsFilePath |
175
UriSyntaxFlags
.UnEscapeDotsAndSlashes;
net\System\URI.cs (71)
214
return (s_IriParsing && (((syntax != null) && syntax.InFact(
UriSyntaxFlags
.AllowIriParsing)) ||
223
get { return ((m_Syntax != null) && ((m_Syntax.Flags &
UriSyntaxFlags
.AllowIdn) != 0) &&
233
return ((syntax != null) && ((syntax.Flags &
UriSyntaxFlags
.AllowIdn) != 0) &&
948
return syntax.InFact(
UriSyntaxFlags
.FileLikeUri);
1031
parser.SetUpdatableFlags(
UriSyntaxFlags
.None);
2068
if (m_Syntax.IsAllSet(
UriSyntaxFlags
.AllowEmptyHost |
UriSyntaxFlags
.AllowDOSPath)
2081
if (m_Syntax.InFact(
UriSyntaxFlags
.FileLikeUri) || i-idx <= 3) {
2093
if (m_Syntax.InFact(
UriSyntaxFlags
.FileLikeUri))
2101
if (m_Syntax.InFact(
UriSyntaxFlags
.MustHaveAuthority)) {
2114
else if (m_Syntax.InFact(
UriSyntaxFlags
.FileLikeUri) && (i - idx >= 2 && i - idx != 3 &&
2140
if (m_Syntax.InFact(
UriSyntaxFlags
.MustHaveAuthority)) {
2155
else if (m_Syntax.InFact(
UriSyntaxFlags
.OptionalAuthority) && (InFact(Flags.AuthorityFound) ||
2161
else if (m_Syntax.NotAny(
UriSyntaxFlags
.MailToLikeUri)) {
2172
else if (m_Syntax.InFact(
UriSyntaxFlags
.MustHaveAuthority)) {
2176
else if (m_Syntax.NotAny(
UriSyntaxFlags
.MailToLikeUri)) {
2215
m_Syntax.NotAny(
UriSyntaxFlags
.AllowDOSPath)) {
3255
UriSyntaxFlags
syntaxFlags = m_Syntax.Flags; // perf
3347
if (IsImplicitFile || ((syntaxFlags & (
UriSyntaxFlags
.MayHaveQuery |
UriSyntaxFlags
.MayHaveFragment)) == 0)){
3352
(m_Syntax.InFact(
UriSyntaxFlags
.MayHaveQuery) ? '?' : m_Syntax.InFact(
UriSyntaxFlags
.MayHaveFragment) ? '#' : c_EOL));
3379
if (IsImplicitFile || ((syntaxFlags & (
UriSyntaxFlags
.MayHaveQuery |
UriSyntaxFlags
.MayHaveFragment)) == 0)){
3383
result = CheckCanonical(str, ref idx, length, (((syntaxFlags &
UriSyntaxFlags
.MayHaveQuery) != 0)
3384
? '?' : m_Syntax.InFact(
UriSyntaxFlags
.MayHaveFragment) ? '#' : c_EOL));
3398
if (((m_Flags & Flags.AuthorityFound) != 0) && ((syntaxFlags &
UriSyntaxFlags
.PathIsRooted) != 0)
3408
(((syntaxFlags & (
UriSyntaxFlags
.CompressPath |
UriSyntaxFlags
.ConvertPathSlashes)) != 0) ||
3409
m_Syntax.InFact(
UriSyntaxFlags
.UnEscapeDotsAndSlashes))))
3411
if (((result & Check.DotSlashEscaped) != 0) && m_Syntax.InFact(
UriSyntaxFlags
.UnEscapeDotsAndSlashes))
3417
if (((syntaxFlags & (
UriSyntaxFlags
.ConvertPathSlashes)) != 0) && (result & Check.BackslashInPath) != 0){
3422
if (((syntaxFlags & (
UriSyntaxFlags
.CompressPath)) != 0) && ((cF & Flags.E_PathNotCanonical) != 0 ||
3475
FindEndOfComponent(m_originalUnicodeString, ref origIdx, (ushort)m_originalUnicodeString.Length, ((syntaxFlags &(
UriSyntaxFlags
.MayHaveFragment)) != 0) ? '#' : c_EOL);
3506
result = CheckCanonical(str, ref idx, length, ((syntaxFlags & (
UriSyntaxFlags
.MayHaveFragment)) != 0)
3917
UriSyntaxFlags
syntaxFlags = syntax.Flags;
3927
if (syntax.InFact(
UriSyntaxFlags
.AllowEmptyHost))
3956
if ((syntaxFlags &
UriSyntaxFlags
.MayHaveUserInfo) != 0)
4004
bool dnsNotCanonical = ((syntaxFlags &
UriSyntaxFlags
.SimpleUserSyntax) == 0);
4006
if (ch == '[' && syntax.InFact(
UriSyntaxFlags
.AllowIPv6Host)
4024
else if ( ch <= '9' && ch >= '0' && syntax.InFact(
UriSyntaxFlags
.AllowIPv4Host) &&
4025
IPv4AddressHelper.IsValid(pString, (int) start, ref end, false, StaticNotAny(flags, Flags.ImplicitFile), syntax.InFact(
UriSyntaxFlags
.V1_UnknownUri)))
4035
else if (((syntaxFlags &
UriSyntaxFlags
.AllowDnsHost)!= 0) && !iriParsing &&
4075
else if (((syntaxFlags &
UriSyntaxFlags
.AllowDnsHost) != 0)
4076
&& ((syntax.InFact(
UriSyntaxFlags
.AllowIriParsing) && hostNotUnicodeNormalized)
4077
|| syntax.InFact(
UriSyntaxFlags
.AllowIdn))
4085
else if ((syntaxFlags &
UriSyntaxFlags
.AllowUncHost) != 0)
4111
if (syntax.InFact(
UriSyntaxFlags
.V1_UnknownUri))
4124
if (syntax.InFact(
UriSyntaxFlags
.MayHavePort))
4143
if(syntax.InFact(
UriSyntaxFlags
.AllowAnyOtherHost)
4144
&& syntax.NotAny(
UriSyntaxFlags
.V1_UnknownUri))
4159
if (syntax.InFact(
UriSyntaxFlags
.AllowAnyOtherHost))
4188
if(syntax.InFact(
UriSyntaxFlags
.AllowAnyOtherHost))
4204
if (syntax.InFact(
UriSyntaxFlags
.V1_UnknownUri))
4246
else if (syntax.InFact(
UriSyntaxFlags
.MustHaveAuthority) ||
4247
(syntax.InFact(
UriSyntaxFlags
.MailToLikeUri) && !UriParser.ShouldUseLegacyV2Quirks))
4440
else if (delim == '?' && c == '#' && (m_Syntax != null && m_Syntax.InFact(
UriSyntaxFlags
.MayHaveFragment)))
4491
else if (delim == '?' && c == '#' && (m_Syntax != null && m_Syntax.InFact(
UriSyntaxFlags
.MayHaveFragment))) {
4496
if (IsImplicitFile || (m_Syntax != null && !m_Syntax.InFact(
UriSyntaxFlags
.MayHaveQuery)
4509
if (IsImplicitFile || (m_Syntax != null && !m_Syntax.InFact(
UriSyntaxFlags
.MayHaveFragment))) {
4599
if (m_Syntax.InFact(
UriSyntaxFlags
.UnEscapeDotsAndSlashes) && InFact(Flags.PathNotCanonical)
4605
m_Syntax.InFact(
UriSyntaxFlags
.ConvertPathSlashes) ? '\\' : c_DummyChar);
4640
if (m_Syntax.InFact(
UriSyntaxFlags
.UnEscapeDotsAndSlashes) && InFact(Flags.PathNotCanonical)
4646
m_Syntax.InFact(
UriSyntaxFlags
.ConvertPathSlashes) ? '\\' : c_DummyChar);
4679
else if (m_Syntax.InFact(
UriSyntaxFlags
.ConvertPathSlashes) && InFact(Flags.BackslashInPath))
4816
if (ch == '\\' && syntax.InFact(
UriSyntaxFlags
.ConvertPathSlashes)) {
4857
bool skipSegment = syntax.NotAny(
UriSyntaxFlags
.CanonicalizeAsFilePath)
4938
if ((ushort)destLength > start && syntax.InFact(
UriSyntaxFlags
.CanonicalizeAsFilePath))
5066
bool convBackSlashes = basePart.Syntax.InFact(
UriSyntaxFlags
.ConvertPathSlashes);
5116
c1 = basePart.Syntax.InFact(
UriSyntaxFlags
.MayHaveQuery)? '?': c_DummyChar;
5120
char c2 = (!basePart.IsImplicitFile && basePart.Syntax.InFact(
UriSyntaxFlags
.MayHaveFragment)) ? '#' :
net\System\uribuilder.cs (3)
416
m_schemeDelimiter = syntax.InFact(
UriSyntaxFlags
.MustHaveAuthority) ||
417
(m_host.Length != 0 && syntax.NotAny(
UriSyntaxFlags
.MailToLikeUri) && syntax.InFact(
UriSyntaxFlags
.OptionalAuthority ))
net\System\UriExt.cs (6)
110
m_iriParsing = (s_IriParsing && ((m_Syntax == null) || m_Syntax.InFact(
UriSyntaxFlags
.AllowIriParsing)));
774
if (relativeStr[0] == '#' && !baseUri.IsImplicitFile && baseUri.Syntax.InFact(
UriSyntaxFlags
.MayHaveFragment))
782
if (relativeStr[0] == '?' && !baseUri.IsImplicitFile && baseUri.Syntax.InFact(
UriSyntaxFlags
.MayHaveQuery))
802
else if (baseUri.Syntax.InFact(
UriSyntaxFlags
.AllowDOSPath))
807
prefix = baseUri.Syntax.InFact(
UriSyntaxFlags
.PathIsRooted) ? ":///" : "://";
809
prefix = baseUri.Syntax.InFact(
UriSyntaxFlags
.PathIsRooted) ? ":/" : ":";
net\System\UriScheme.cs (3)
50
private const
UriSyntaxFlags
SchemeOnlyFlags =
UriSyntaxFlags
.MayHavePath;
201
return syntax != null && syntax.NotAny(
UriSyntaxFlags
.V1_UnknownUri);