DirectoryPath Class

Summary

Represents a directory path.
Namespace
Cake.Core.IO
Interfaces
Base Types
graph BT Type-->Base0["Path"] click Base0 "/api/Cake.Core.IO/Path" Base0-->Base1["object"] Type-.->Interface0["IEquatable<DirectoryPath>"] Type-.->Interface1["IComparer<DirectoryPath>"] Type-.->Interface2["IPath<DirectoryPath>"] Type["DirectoryPath"] class Type type-node

Syntax

[TypeConverter(typeof(DirectoryPathConverter))]
public sealed class DirectoryPath : Path, IEquatable<DirectoryPath>, IComparer<DirectoryPath>, 
    IPath<DirectoryPath>

Attributes

Type Description
TypeConverter

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.
Compare(DirectoryPath, DirectoryPath) int
Compares two DirectoryPath and returns an indication of their relative sort order.
Equals(DirectoryPath) bool
Determines whether two DirectoryPath instances are equal.
Equals(object) bool
Determines whether two DirectoryPath instances are equal.
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.
GetHashCode() int
Returns the hash code for the FilePath.
GetParent() DirectoryPath
Gets the directory path of a DirectoryPath.
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
operator !=(DirectoryPath, DirectoryPath) bool
operator ==(DirectoryPath, DirectoryPath) bool

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.Ftp addin
NotNull<DirectoryPath>(string) void
Requires the Cake.Issues 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
ThrowIfNull<DirectoryPath>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Requires the Cake.Issues addin