Class PathHelper
- Namespace
- NominalSystems.Files
- Assembly
- NominalSystems.Files.dll
[Nominal] Static helper function for getting files and paths in a directory.
public static class PathHelper
- Inheritance
-
PathHelper
Properties
SolutionDirectory
Returns the full path to the solution directory
public static string? SolutionDirectory { get; }
Property Value
Methods
FileExists(string)
Returns true if the the file exists else false.
public static bool FileExists(string path)
Parameters
path
stringFile to check
Returns
- bool
Whether the file exists
ForceInitialise()
Forces the path helper to be initialised with some default paths without using the standard C# ones.
public static void ForceInitialise()
ForceReset()
Forces the path helper to be reset so that the default paths are reinitialised.
public static void ForceReset()
GetFilePath(string)
Returns the full system path for a particular file. Throws an exception if the file can't be found.
public static string GetFilePath(string path)
Parameters
path
stringThe local file name and suffix
Returns
- string
The full path to the file
Exceptions
- Exception
The file does not exist
GetFolderPath(string)
Returns the full system path for a folder. Returns an empty string if it cannot be found.
public static string GetFolderPath(string path)
Parameters
path
stringFolder to search or path to folder.
Returns
- string
The full path to the folder
SetDefaults()
Sets up the default paths in the search path list
public static void SetDefaults()