DirectoryPath Class

Summary

Represents a directory path.
Namespace
Cake.Core.IO
Base Types
graph BT Type-->Base0["Path"] click Base0 "/api/Cake.Core.IO/Path" Base0-->Base1["object"] Type["DirectoryPath"] class Type type-node

Syntax

public sealed class DirectoryPath : Path

Constructors

Name Summary
DirectoryPath(string) Initializes a new instance of the DirectoryPath class.

Properties

Name Value Summary
FullPath string
Gets the full path.
Inherited from Path
IsRelative bool
Gets a value indicating whether or not this path is relative.
Inherited from Path
IsUNC bool
Gets a value indicating whether or not this path is an UNC path.
Inherited from Path
Segments string[]
Gets the segments making up the path.
Inherited from Path
Separator char
Gets the separator this path was normalized with.
Inherited from Path

Methods

Name Value Summary
Collapse() DirectoryPath
Collapses a DirectoryPath containing ellipses.
Combine(DirectoryPath) DirectoryPath
Combines the current path with another DirectoryPath. The provided DirectoryPath must be relative.
CombineWithFilePath(FilePath) FilePath
Combines the current path with a FilePath. The provided FilePath must be relative.
FromString(string) DirectoryPath
Performs a conversion from string to DirectoryPath.
static
GetDirectoryName() string
Gets the name of the directory.
GetFilePath(FilePath) FilePath
Combines the current path with the file name of a FilePath.
GetRelativePath(DirectoryPath) DirectoryPath
Get the relative path to another directory.
GetRelativePath(FilePath) FilePath
Get the relative path to another file.
MakeAbsolute(DirectoryPath) DirectoryPath
Makes the path absolute to another (absolute) path.
MakeAbsolute(ICakeEnvironment) DirectoryPath
Makes the path absolute (if relative) using the current working directory.
ToString() string
Returns a string that represents this path.
Inherited from Path

Operators

Name Value Summary
implicit operator DirectoryPath(string) DirectoryPath

Extension Methods

Name Value Summary
Dump<DirectoryPath>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
ExpandEnvironmentVariables(ICakeEnvironment) DirectoryPath
Expands all environment variables in the provided DirectoryPath.
IsIn<DirectoryPath>(DirectoryPath[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<DirectoryPath>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<DirectoryPath>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
ThrowIfNull<DirectoryPath>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<DirectoryPath>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin