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

◆ GetCommonPathLength()

static int System.IO.PathInternal.GetCommonPathLength ( string first,
string second,
bool ignoreCase )
inlinestaticpackage

Definition at line 52 of file PathInternal.cs.

53 {
54 int num = EqualStartingCharacterCount(first, second, ignoreCase);
55 if (num == 0)
56 {
57 return num;
58 }
59 if (num == first.Length && (num == second.Length || IsDirectorySeparator(second[num])))
60 {
61 return num;
62 }
63 if (num == second.Length && IsDirectorySeparator(first[num]))
64 {
65 return num;
66 }
67 while (num > 0 && !IsDirectorySeparator(first[num - 1]))
68 {
69 num--;
70 }
71 return num;
72 }
static unsafe int EqualStartingCharacterCount(string first, string second, bool ignoreCase)
static bool IsDirectorySeparator(char c)

References System.IO.PathInternal.EqualStartingCharacterCount(), and System.IO.PathInternal.IsDirectorySeparator().

Referenced by System.IO.Path.GetRelativePath().