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

◆ EntryFromPath()

static string System.IO.Compression.ZipFileUtils.EntryFromPath ( string entry,
int offset,
int length,
ref char[] buffer,
bool appendPathSeparator = false )
inlinestatic

Definition at line 8 of file ZipFileUtils.cs.

9 {
10 while (length > 0 && (entry[offset] == Path.DirectorySeparatorChar || entry[offset] == Path.AltDirectorySeparatorChar))
11 {
12 offset++;
13 length--;
14 }
15 if (length == 0)
16 {
18 {
19 return string.Empty;
20 }
21 return "/";
22 }
23 int num = (appendPathSeparator ? (length + 1) : length);
26 for (int i = 0; i < length; i++)
27 {
28 char c = buffer[i];
29 if (c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar)
30 {
31 buffer[i] = '/';
32 }
33 }
35 {
36 buffer[length] = '/';
37 }
38 return new string(buffer, 0, num);
39 }
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
static void EnsureCapacity(ref char[] buffer, int min)

References System.IO.Path.AltDirectorySeparatorChar, System.buffer, System.Collections.Generic.Dictionary< TKey, TValue >.CopyTo(), System.IO.Path.DirectorySeparatorChar, System.IO.Compression.ZipFileUtils.EnsureCapacity(), System.length, and System.offset.

Referenced by System.IO.Compression.ZipFile.DoCreateFromDirectory().