Nuke.Cola
Loading...
Searching...
No Matches
Nuke.Cola.PathExtensions Class Reference

Static Public Member Functions

static AbsolutePath AsPath (this string input)
 A more comfortable way to make a string into an absolute path.
 
static ? AbsolutePath TryAsPath (this string? input)
 A safer version of AsPath, use it when input may not be a valid absolute path.
 
static ? AbsolutePath TryAsRelativePath (this string? input, AbsolutePath? root=null)
 A safer version of AsPath, use it when input may not be a valid string. Input can be a relative folder to root
 
static void Delete (this AbsolutePath path)
 Shorthand for deleting both file or folder, we don't care.
 
static ? FileSystemInfo AsInfo (this AbsolutePath path)
 Shorthand for getting a FileSystemInfo both of a file or folder, we don't care.
 
static ? FileSystemInfo AsLinkInfo (this AbsolutePath link)
 If the given path happens to be a symlink then return its info, return null otherwise.
 
static FileSystemInfo LinksFile (this AbsolutePath link, AbsolutePath real)
 Create a new symlink at this location referring to another file.
 
static FileSystemInfo LinkedByFile (this AbsolutePath real, AbsolutePath link)
 Create a new symlink referring to this file at given location.
 
static FileSystemInfo LinksDirectory (this AbsolutePath link, AbsolutePath real)
 Create a new symlink at this location referring to another folder.
 
static FileSystemInfo LinkedByDirectory (this AbsolutePath real, AbsolutePath link)
 Create a new symlink referring to this folder at given location.
 
static FileSystemInfo Links (this AbsolutePath link, AbsolutePath real)
 Create a new symlink at this location referring to given item.
 
static FileSystemInfo LinkedBy (this AbsolutePath real, AbsolutePath link)
 Create a new symlink referring to this item at given location.
 
static Attempt LinkedByOrCopyTo (this AbsolutePath real, AbsolutePath link, ExistsPolicy policy=ExistsPolicy.Fail)
 Create a new symlink referring to this item at given location, or if that fails for any reason attempt to copy this item to given location.
 
static IEnumerable< AbsolutePath > SubTree (this AbsolutePath origin, Func< AbsolutePath, bool >? filter=null)
 
static AbsolutePath GetRoot (this AbsolutePath path)
 Get the root of input AbsolutePath. On Windows this may be getting the "drive-letter" of input path.
 
static bool LookAroundFor (Func< string, bool > predicate, out AbsolutePath? result, Func< AbsolutePath, bool >? directoryFilter=null, AbsolutePath? rootDirectory=null)
 
static ? AbsolutePath GetVersionSubfolder (this AbsolutePath root, string version)
 

Static Private Member Functions

static FileSystemInfo LinkBoilerplate (AbsolutePath link, AbsolutePath real, Action assertRealExists, Func< string, string, FileSystemInfo > createLink)
 

Detailed Description

Definition at line 16 of file PathExtensions.cs.

Member Function Documentation

◆ AsInfo()

static ? FileSystemInfo Nuke.Cola.PathExtensions.AsInfo ( this AbsolutePath path)
static

Shorthand for getting a FileSystemInfo both of a file or folder, we don't care.

Definition at line 54 of file PathExtensions.cs.

◆ AsLinkInfo()

static ? FileSystemInfo Nuke.Cola.PathExtensions.AsLinkInfo ( this AbsolutePath link)
static

If the given path happens to be a symlink then return its info, return null otherwise.

Parameters
link
Returns

Definition at line 68 of file PathExtensions.cs.

◆ AsPath()

static AbsolutePath Nuke.Cola.PathExtensions.AsPath ( this string input)
static

A more comfortable way to make a string into an absolute path.

◆ Delete()

static void Nuke.Cola.PathExtensions.Delete ( this AbsolutePath path)
static

Shorthand for deleting both file or folder, we don't care.

Definition at line 45 of file PathExtensions.cs.

◆ GetRoot()

static AbsolutePath Nuke.Cola.PathExtensions.GetRoot ( this AbsolutePath path)
static

Get the root of input AbsolutePath. On Windows this may be getting the "drive-letter" of input path.

◆ GetVersionSubfolder()

static ? AbsolutePath Nuke.Cola.PathExtensions.GetVersionSubfolder ( this AbsolutePath root,
string version )
static

Definition at line 220 of file PathExtensions.cs.

◆ LinkBoilerplate()

static FileSystemInfo Nuke.Cola.PathExtensions.LinkBoilerplate ( AbsolutePath link,
AbsolutePath real,
Action assertRealExists,
Func< string, string, FileSystemInfo > createLink )
staticprivate

Definition at line 74 of file PathExtensions.cs.

◆ LinkedBy()

static FileSystemInfo Nuke.Cola.PathExtensions.LinkedBy ( this AbsolutePath real,
AbsolutePath link )
static

Create a new symlink referring to this item at given location.

Parameters
realThe location of the real item
linkThe location of the link

◆ LinkedByDirectory()

static FileSystemInfo Nuke.Cola.PathExtensions.LinkedByDirectory ( this AbsolutePath real,
AbsolutePath link )
static

Create a new symlink referring to this folder at given location.

Parameters
realThe location of the real item
linkThe location of the link

◆ LinkedByFile()

static FileSystemInfo Nuke.Cola.PathExtensions.LinkedByFile ( this AbsolutePath real,
AbsolutePath link )
static

Create a new symlink referring to this file at given location.

Parameters
realThe location of the real item
linkThe location of the link

◆ LinkedByOrCopyTo()

static Attempt Nuke.Cola.PathExtensions.LinkedByOrCopyTo ( this AbsolutePath real,
AbsolutePath link,
ExistsPolicy policy = ExistsPolicy.Fail )
static

Create a new symlink referring to this item at given location, or if that fails for any reason attempt to copy this item to given location.

Parameters
real
link
policy

◆ Links()

static FileSystemInfo Nuke.Cola.PathExtensions.Links ( this AbsolutePath link,
AbsolutePath real )
static

Create a new symlink at this location referring to given item.

Parameters
linkThe location of the link
realThe location of the real item

Definition at line 151 of file PathExtensions.cs.

◆ LinksDirectory()

static FileSystemInfo Nuke.Cola.PathExtensions.LinksDirectory ( this AbsolutePath link,
AbsolutePath real )
static

Create a new symlink at this location referring to another folder.

Parameters
linkThe location of the link
realThe location of the real item

◆ LinksFile()

static FileSystemInfo Nuke.Cola.PathExtensions.LinksFile ( this AbsolutePath link,
AbsolutePath real )
static

Create a new symlink at this location referring to another file.

Parameters
linkThe location of the link
realThe location of the real item

◆ LookAroundFor()

static bool Nuke.Cola.PathExtensions.LookAroundFor ( Func< string, bool > predicate,
out AbsolutePath? result,
Func< AbsolutePath, bool >? directoryFilter = null,
AbsolutePath? rootDirectory = null )
static

Definition at line 190 of file PathExtensions.cs.

◆ TryAsPath()

static ? AbsolutePath Nuke.Cola.PathExtensions.TryAsPath ( this string? input)
static

A safer version of AsPath, use it when input may not be a valid absolute path.

◆ TryAsRelativePath()

static ? AbsolutePath Nuke.Cola.PathExtensions.TryAsRelativePath ( this string? input,
AbsolutePath? root = null )
static

A safer version of AsPath, use it when input may not be a valid string. Input can be a relative folder to root


The documentation for this class was generated from the following file: