tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
ResolvingIOManager.cs
Go to the documentation of this file.
1using System;
2using System.IO;
3
5{
10 {
14 readonly string subdirectory;
15
22 {
23 ArgumentNullException.ThrowIfNull(parent);
24 ArgumentNullException.ThrowIfNull(subdirectory);
25
26 this.subdirectory = ConcatPath(parent.ResolvePath(), subdirectory);
27 }
28
30 public override string ResolvePath(string path)
31 {
32 if (!Path.IsPathRooted(path))
33 return base.ResolvePath(ConcatPath(subdirectory, path));
34 return path;
35 }
36 }
37}
IIOManager that resolves paths to Environment.CurrentDirectory.
string ConcatPath(params string[] paths)
Combines an array of strings into a path.The combined path.
An IIOManager that resolve relative paths from another IIOManager to a subdirectory of that.
readonly string subdirectory
Path to the subdirectory attached to path resolutions.
ResolvingIOManager(IIOManager parent, string subdirectory)
Initializes a new instance of the ResolvingIOManager class.
override string ResolvePath(string path)
Retrieve the full path of some path given a relative path. Must be used before passing relative path...
Interface for using filesystems.
Definition IIOManager.cs:13
string ResolvePath()
Retrieve the full path of the current working directory.