9 private static char[]
badCharacters =
new char[7] {
':',
'*',
'?',
'"',
'<',
'>',
'|' };
13 if (
string.IsNullOrEmpty(name))
54 path = path.Replace(
'/',
'\\');
55 path = path.Replace(
"\\.\\",
"\\");
56 while (path.StartsWith(
".\\"))
58 path = path.Substring(
".\\".Length);
60 while (path.EndsWith(
"\\."))
62 path = ((path.Length <=
"\\.".Length) ?
"\\" : path.Substring(0, path.Length -
"\\.".Length));
67 num = path.IndexOf(
"\\..\\", num);
73 if (path.EndsWith(
"\\.."))
75 num = path.Length -
"\\..".Length;
90 int num = path.LastIndexOf(
'\\', position - 1) + 1;
91 path = path.Remove(num, position - num + removeLength);
101 if (path.StartsWith(
"\\"))
105 if (path.StartsWith(
"..\\") || path.Contains(
"\\..\\") || path.EndsWith(
"\\..") || path ==
"..")
static string OpenStreamError
static string OpenStreamNotFound
static string InvalidTitleContainerName
static Stream OpenStream(string name)
static string GetCleanPath(string path)
static char[] badCharacters
static bool IsPathAbsolute(string path)
static bool IsCleanPathAbsolute(string path)
static int CollapseParentDirectory(ref string path, int position, int removeLength)
static CultureInfo CurrentCulture
static FileStream OpenRead(string path)
static string Combine(string path1, string path2)
static readonly char AltDirectorySeparatorChar
static readonly char DirectorySeparatorChar
static byte Max(byte val1, byte val2)