Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ParseSchemeCheckImplicitFile()

static unsafe int System.Uri.ParseSchemeCheckImplicitFile ( char * uriString,
int length,
ref ParsingError err,
ref Flags flags,
ref UriParser syntax )
inlinestaticprivate

Definition at line 2480 of file Uri.cs.

2481 {
2482 int i;
2483 for (i = 0; i < length && UriHelper.IsLWS(uriString[i]); i++)
2484 {
2485 }
2486 int j;
2487 for (j = i; j < length && uriString[j] != ':'; j++)
2488 {
2489 }
2490 if (IntPtr.Size == 4)
2491 {
2492 }
2493 if (i + 2 >= length || j == i)
2494 {
2495 err = ParsingError.BadFormat;
2496 return 0;
2497 }
2498 char c;
2499 if ((c = uriString[i + 1]) == ':' || c == '|')
2500 {
2501 if (UriHelper.IsAsciiLetter(uriString[i]))
2502 {
2503 if ((c = uriString[i + 2]) == '\\' || c == '/')
2504 {
2505 flags |= Flags.AuthorityFound | Flags.DosPath | Flags.ImplicitFile;
2506 syntax = UriParser.FileUri;
2507 return i;
2508 }
2509 err = ParsingError.MustRootedPath;
2510 return 0;
2511 }
2512 if (c == ':')
2513 {
2514 err = ParsingError.BadScheme;
2515 }
2516 else
2517 {
2518 err = ParsingError.BadFormat;
2519 }
2520 return 0;
2521 }
2522 if ((c = uriString[i]) == '/' || c == '\\')
2523 {
2524 if ((c = uriString[i + 1]) == '\\' || c == '/')
2525 {
2526 flags |= Flags.AuthorityFound | Flags.UncPath | Flags.ImplicitFile;
2527 syntax = UriParser.FileUri;
2528 for (i += 2; i < length; i++)
2529 {
2530 if ((c = uriString[i]) != '/' && c != '\\')
2531 {
2532 break;
2533 }
2534 }
2535 return i;
2536 }
2537 err = ParsingError.BadFormat;
2538 return 0;
2539 }
2540 if (j == length)
2541 {
2542 err = ParsingError.BadFormat;
2543 return 0;
2544 }
2545 err = CheckSchemeSyntax(new ReadOnlySpan<char>(uriString + i, j - i), ref syntax);
2546 if (err != 0)
2547 {
2548 return 0;
2549 }
2550 return j + 1;
2551 }
static unsafe ParsingError CheckSchemeSyntax(ReadOnlySpan< char > span, ref UriParser syntax)
Definition Uri.cs:2553

References System.Uri.CheckSchemeSyntax(), System.Runtime.Serialization.Dictionary, System.UriParser.FileUri, System.UriHelper.IsAsciiLetter(), System.UriHelper.IsLWS(), System.length, and System.IntPtr.Size.

Referenced by System.Uri.ParseScheme().