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

◆ TestForSubPath()

static unsafe bool System.UriHelper.TestForSubPath ( char * selfPtr,
int selfLength,
char * otherPtr,
int otherLength,
bool ignoreCase )
inlinestaticpackage

Definition at line 46 of file UriHelper.cs.

47 {
48 int i = 0;
49 bool flag = true;
50 for (; i < selfLength && i < otherLength; i++)
51 {
52 char c = selfPtr[i];
53 char c2 = otherPtr[i];
54 switch (c)
55 {
56 case '#':
57 case '?':
58 return true;
59 case '/':
60 if (c2 != '/')
61 {
62 return false;
63 }
64 if (!flag)
65 {
66 return false;
67 }
68 flag = true;
69 continue;
70 default:
71 if (c2 == '?' || c2 == '#')
72 {
73 break;
74 }
75 if (!ignoreCase)
76 {
77 if (c != c2)
78 {
79 flag = false;
80 }
81 }
82 else if (char.ToLowerInvariant(c) != char.ToLowerInvariant(c2))
83 {
84 flag = false;
85 }
86 continue;
87 }
88 break;
89 }
90 for (; i < selfLength; i++)
91 {
92 char c;
93 if ((c = selfPtr[i]) != '?')
94 {
95 switch (c)
96 {
97 case '#':
98 break;
99 case '/':
100 return false;
101 default:
102 continue;
103 }
104 }
105 return true;
106 }
107 return true;
108 }

Referenced by System.Uri.IsBaseOfHelper().