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

◆ IsBaseOfHelper()

unsafe bool System.Uri.IsBaseOfHelper ( Uri uriLink)
inlinepackage

Definition at line 4295 of file Uri.cs.

4296 {
4297 //The blocks IL_00a5, IL_00bf, IL_00c7, IL_00c8 are reachable both inside and outside the pinned region starting at IL_00a0. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
4299 {
4300 return false;
4301 }
4302 if (!uriLink.IsAbsoluteUri)
4303 {
4304 string newUriString = null;
4305 bool userEscaped = false;
4307 if ((object)uriLink == null)
4308 {
4309 UriFormatException e = null;
4310 string uriString = newUriString;
4311 bool dontEscape = userEscaped;
4312 UriCreationOptions creationOptions = default(UriCreationOptions);
4313 uriLink = CreateHelper(uriString, dontEscape, UriKind.Absolute, ref e, in creationOptions);
4314 if (e != null)
4315 {
4316 return false;
4317 }
4318 }
4319 }
4320 if (Syntax.SchemeName != uriLink.Syntax.SchemeName)
4321 {
4322 return false;
4323 }
4324 string parts = GetParts(UriComponents.HttpRequestUrl | UriComponents.UserInfo, UriFormat.SafeUnescaped);
4325 string parts2 = uriLink.GetParts(UriComponents.HttpRequestUrl | UriComponents.UserInfo, UriFormat.SafeUnescaped);
4326 fixed (char* ptr3 = parts)
4327 {
4328 char* intPtr;
4329 char* selfPtr;
4330 int length;
4331 char* otherPtr;
4332 int length2;
4333 int ignoreCase;
4334 char* ptr2;
4335 if (parts2 != null)
4336 {
4337 fixed (char* ptr = &parts2.GetPinnableReference())
4338 {
4339 intPtr = (ptr2 = ptr);
4340 selfPtr = ptr3;
4341 length = parts.Length;
4342 otherPtr = ptr2;
4343 length2 = parts2.Length;
4344 ignoreCase = ((IsUncOrDosPath || uriLink.IsUncOrDosPath) ? 1 : 0);
4345 return UriHelper.TestForSubPath(selfPtr, length, otherPtr, length2, (byte)ignoreCase != 0);
4346 }
4347 }
4348 intPtr = (ptr2 = null);
4349 selfPtr = ptr3;
4350 length = parts.Length;
4351 otherPtr = ptr2;
4352 length2 = parts2.Length;
4353 ignoreCase = ((IsUncOrDosPath || uriLink.IsUncOrDosPath) ? 1 : 0);
4354 return UriHelper.TestForSubPath(selfPtr, length, otherPtr, length2, (byte)ignoreCase != 0);
4355 }
4356 }
string SchemeName
Definition UriParser.cs:81
bool IsUncOrDosPath
Definition Uri.cs:203
UriParser Syntax
Definition Uri.cs:211
static Uri CreateHelper(string uriString, bool dontEscape, UriKind uriKind, ref UriFormatException e, in UriCreationOptions creationOptions=default(UriCreationOptions))
Definition Uri.cs:4107
bool UserDrivenParsing
Definition Uri.cs:219
bool IsAbsoluteUri
Definition Uri.cs:572
string GetParts(UriComponents uriParts, UriFormat formatAs)
Definition Uri.cs:1828
static Uri ResolveHelper(Uri baseUri, Uri relativeUri, ref string newUriString, ref bool userEscaped)
Definition Uri.cs:4149
UriKind
Definition UriKind.cs:4
UriFormat
Definition UriFormat.cs:4

References System.Uri.CreateHelper(), System.creationOptions, System.Runtime.Serialization.Dictionary, System.Uri.GetParts(), System.Uri.IsAbsoluteUri, System.Uri.IsUncOrDosPath, System.length, System.length2, System.Uri.ResolveHelper(), System.UriParser.SchemeName, System.Uri.Syntax, System.UriHelper.TestForSubPath(), and System.Uri.UserDrivenParsing.

Referenced by System.UriParser.IsBaseOf(), and System.Uri.IsBaseOf().