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

◆ CreateHostStringHelper()

static string System.Uri.CreateHostStringHelper ( string str,
int idx,
int end,
ref Flags flags,
ref string scopeId )
inlinestaticprivate

Definition at line 1713 of file Uri.cs.

1714 {
1715 bool loopback = false;
1716 string text;
1717 switch (flags & Flags.HostTypeMask)
1718 {
1719 case Flags.DnsHostType:
1720 text = DomainNameHelper.ParseCanonicalName(str, idx, end, ref loopback);
1721 break;
1722 case Flags.IPv6HostType:
1723 text = IPv6AddressHelper.ParseCanonicalName(str, idx, ref loopback, ref scopeId);
1724 break;
1725 case Flags.IPv4HostType:
1726 text = IPv4AddressHelper.ParseCanonicalName(str, idx, end, ref loopback);
1727 break;
1728 case Flags.UncHostType:
1729 text = UncNameHelper.ParseCanonicalName(str, idx, end, ref loopback);
1730 break;
1731 case Flags.BasicHostType:
1732 text = ((!StaticInFact(flags, Flags.DosPath)) ? str.Substring(idx, end - idx) : string.Empty);
1733 if (text.Length == 0)
1734 {
1735 loopback = true;
1736 }
1737 break;
1738 case Flags.HostTypeMask:
1739 text = string.Empty;
1740 break;
1741 default:
1742 throw GetException(ParsingError.BadHostName);
1743 }
1744 if (loopback)
1745 {
1746 flags |= Flags.LoopbackHost;
1747 }
1748 return text;
1749 }
static bool StaticInFact(Flags allFlags, Flags checkFlags)
Definition Uri.cs:621
static UriFormatException GetException(ParsingError err)
Definition Uri.cs:873

References System.Uri.GetException(), System.IPv4AddressHelper.ParseCanonicalName(), System.DomainNameHelper.ParseCanonicalName(), System.UncNameHelper.ParseCanonicalName(), System.IPv6AddressHelper.ParseCanonicalName(), System.Uri.StaticInFact(), System.str, and System.text.

Referenced by System.Uri.CreateHostString(), and System.Uri.GetHostViaCustomSyntax().