Photon Quantum 3.0.0

Static Public Member Functions | List of all members
Quantum.PathUtils Class Reference

Utility methods to work with folder and file paths. More...

Static Public Member Functions

static String Combine (Char separator, params String[] paths)
 Obsolete More...
 
static String Combine (params String[] paths)
 Combine multiple paths. Internally calls Path.Combine(string, string). More...
 
static string GetPathWithoutExtension (string path)
 Return the path without the file extension. More...
 
static bool IsRelativeToFolder (String path, String folder)
 Check if a path is relative to a folder. More...
 
static bool MakeRelativeToFolder (String path, String folder, out String result)
 Tries to make an input path relative to a folder. More...
 
static bool MakeRelativeToFolderFast (string path, string folderWithSlashes, out string result)
 Tries to make an input path relative to a folder. More...
 
static string MakeSane (String path)
 Unify path separators and replacing all different amounts of slashes to one forward slash. More...
 

Detailed Description

Utility methods to work with folder and file paths.

Member Function Documentation

◆ Combine() [1/2]

static String Quantum.PathUtils.Combine ( Char  separator,
params String[]  paths 
)
inlinestatic

Obsolete

◆ Combine() [2/2]

static String Quantum.PathUtils.Combine ( params String[]  paths)
inlinestatic

Combine multiple paths. Internally calls Path.Combine(string, string).

Parameters
pathsPath to combine.
Returns

◆ MakeRelativeToFolder()

static bool Quantum.PathUtils.MakeRelativeToFolder ( String  path,
String  folder,
out String  result 
)
inlinestatic

Tries to make an input path relative to a folder.

Parameters
pathInput path to make relative
folderFolder to make the input path relative against
resultResulting relative path
Returns
true if a relative path could be constructed

◆ MakeRelativeToFolderFast()

static bool Quantum.PathUtils.MakeRelativeToFolderFast ( string  path,
string  folderWithSlashes,
out string  result 
)
inlinestatic

Tries to make an input path relative to a folder.

Parameters
pathInput path to make relative
folderWithSlashesFolder to make the input path relative against, is correctly formatted with forward slashes
resultResulting relative path
Returns
true if a relative path could be constructed

◆ GetPathWithoutExtension()

static string Quantum.PathUtils.GetPathWithoutExtension ( string  path)
inlinestatic

Return the path without the file extension.

Parameters
pathPath
Returns
New path string

◆ IsRelativeToFolder()

static bool Quantum.PathUtils.IsRelativeToFolder ( String  path,
String  folder 
)
static

Check if a path is relative to a folder.

Parameters
pathPath to check
folderPath to folder
Returns
true if the path is relative to the folder

◆ MakeSane()

static string Quantum.PathUtils.MakeSane ( String  path)
static

Unify path separators and replacing all different amounts of slashes to one forward slash.

Parameters
pathPath to normalize
Returns
Normalized path