Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SyntaxCheck.cs
Go to the documentation of this file.
1using System.IO;
2
4
5public static class SyntaxCheck
6{
7 public static bool CheckMachineName(string value)
8 {
9 if (value == null)
10 {
11 return false;
12 }
13 value = value.Trim();
14 if (value.Equals(string.Empty))
15 {
16 return false;
17 }
18 return !value.Contains('\\');
19 }
20
21 public static bool CheckPath(string value)
22 {
23 if (value == null)
24 {
25 return false;
26 }
27 value = value.TrimStart();
28 if (value.Equals(string.Empty))
29 {
30 return false;
31 }
32 return value.StartsWith("\\\\", StringComparison.Ordinal);
33 }
34
35 public static bool CheckRootedPath(string value)
36 {
37 if (value == null)
38 {
39 return false;
40 }
41 value = value.Trim();
42 if (value.Equals(string.Empty))
43 {
44 return false;
45 }
46 return Path.IsPathRooted(value);
47 }
48}
static bool CheckPath(string value)
static bool CheckMachineName(string value)
Definition SyntaxCheck.cs:7
static bool CheckRootedPath(string value)
static bool IsPathRooted([NotNullWhen(true)] string? path)
Definition Path.cs:985