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

◆ InitializeUri()

void System.Uri.InitializeUri ( ParsingError err,
UriKind uriKind,
out UriFormatException e )
inlineprivate

Definition at line 3642 of file Uri.cs.

3643 {
3644 if (err == ParsingError.None)
3645 {
3646 if (IsImplicitFile)
3647 {
3648 if (NotAny(Flags.DosPath) && uriKind != UriKind.Absolute && (uriKind == UriKind.Relative || (_string.Length >= 2 && (_string[0] != '\\' || _string[1] != '\\'))))
3649 {
3650 _syntax = null;
3651 _flags &= Flags.UserEscaped;
3652 e = null;
3653 return;
3654 }
3655 if (uriKind == UriKind.Relative && InFact(Flags.DosPath))
3656 {
3657 _syntax = null;
3658 _flags &= Flags.UserEscaped;
3659 e = null;
3660 return;
3661 }
3662 }
3663 }
3664 else if (err > ParsingError.EmptyUriString)
3665 {
3666 _string = null;
3667 e = GetException(err);
3668 return;
3669 }
3670 bool flag = false;
3672 {
3673 _flags |= Flags.HasUnicode;
3674 flag = true;
3676 }
3677 if (_syntax != null)
3678 {
3679 if (_syntax.IsSimple)
3680 {
3681 if ((err = PrivateParseMinimal()) != 0)
3682 {
3683 if (uriKind != UriKind.Absolute && err <= ParsingError.EmptyUriString)
3684 {
3685 _syntax = null;
3686 e = null;
3687 _flags &= Flags.UserEscaped;
3688 return;
3689 }
3690 e = GetException(err);
3691 }
3692 else if (uriKind == UriKind.Relative)
3693 {
3694 e = GetException(ParsingError.CannotCreateRelative);
3695 }
3696 else
3697 {
3698 e = null;
3699 }
3700 if (flag)
3701 {
3702 try
3703 {
3705 return;
3706 }
3707 catch (UriFormatException ex)
3708 {
3709 e = ex;
3710 return;
3711 }
3712 }
3713 return;
3714 }
3716 _flags |= Flags.UserDrivenParsing;
3717 _syntax.InternalValidate(this, out e);
3718 if (e != null)
3719 {
3720 if (uriKind != UriKind.Absolute && err != 0 && err <= ParsingError.EmptyUriString)
3721 {
3722 _syntax = null;
3723 e = null;
3724 _flags &= Flags.UserEscaped;
3725 }
3726 return;
3727 }
3728 if (err != 0 || InFact(Flags.ErrorOrParsingRecursion))
3729 {
3730 _flags = Flags.UserDrivenParsing | (_flags & Flags.UserEscaped);
3731 }
3732 else if (uriKind == UriKind.Relative)
3733 {
3734 e = GetException(ParsingError.CannotCreateRelative);
3735 }
3736 if (flag)
3737 {
3738 try
3739 {
3741 }
3742 catch (UriFormatException ex2)
3743 {
3744 e = ex2;
3745 }
3746 }
3747 }
3748 else if (err != 0 && uriKind != UriKind.Absolute && err <= ParsingError.EmptyUriString)
3749 {
3750 e = null;
3751 _flags &= Flags.UserEscaped | Flags.HasUnicode;
3752 if (flag)
3753 {
3755 if (_string.Length > 65535)
3756 {
3757 err = ParsingError.SizeLimit;
3758 }
3759 }
3760 }
3761 else
3762 {
3763 _string = null;
3764 e = GetException(err);
3765 }
3766 }
UriParser InternalOnNewUri()
Definition UriParser.cs:308
void InternalValidate(Uri thisUri, out UriFormatException parsingError)
Definition UriParser.cs:320
UriParser _syntax
Definition Uri.cs:193
bool IriParsing
Definition Uri.cs:215
unsafe string EscapeUnescapeIri(string input, int start, int end, UriComponents component)
Definition Uri.cs:4092
void EnsureParseRemaining()
Definition Uri.cs:636
string _originalUnicodeString
Definition Uri.cs:191
Flags _flags
Definition Uri.cs:195
static bool CheckForUnicodeOrEscapedUnreserved(string data)
Definition Uri.cs:3768
bool NotAny(Flags flags)
Definition Uri.cs:606
bool InFact(Flags flags)
Definition Uri.cs:611
unsafe ParsingError PrivateParseMinimal()
Definition Uri.cs:1354
static UriFormatException GetException(ParsingError err)
Definition Uri.cs:873
string _string
Definition Uri.cs:189
bool IsImplicitFile
Definition Uri.cs:201
UriKind
Definition UriKind.cs:4

References System.Uri._flags, System.Uri._originalUnicodeString, System.Uri._string, System.Uri._syntax, System.Uri.CheckForUnicodeOrEscapedUnreserved(), System.Runtime.Serialization.Dictionary, System.Uri.EnsureParseRemaining(), System.Uri.EscapeUnescapeIri(), System.Uri.GetException(), System.Uri.InFact(), System.UriParser.InternalOnNewUri(), System.UriParser.InternalValidate(), System.Uri.IriParsing, System.Uri.IsImplicitFile, System.UriParser.IsSimple, System.Uri.NotAny(), and System.Uri.PrivateParseMinimal().

Referenced by System.Uri.CreateHelper(), and System.Uri.CreateThis().