FilePath Class

Summary

Represents a file 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<FilePath>"] Type-.->Interface1["IComparer<FilePath>"] Type-.->Interface2["IPath<FilePath>"] Type["FilePath"] class Type type-node

Syntax

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

Attributes

Type Description
TypeConverter

Constructors

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

Properties

Name Value Summary
FullPath string
Gets the full path.
Inherited from Path
HasExtension bool
Gets a value indicating whether this path has a file extension.
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
AppendExtension(string) FilePath
Appends a file extension to the path.
ChangeExtension(string) FilePath
Changes the file extension of the path.
Collapse() FilePath
Collapses a FilePath containing ellipses.
Compare(FilePath, FilePath) int
Compares two FilePath and returns an indication of their relative sort order.
Equals(FilePath) bool
Determines wheter two FilePath instances are equal.
Equals(object) bool
Determines wheter two FilePath instances are equal.
FromString(string) FilePath
Performs a conversion from string to FilePath.
static
GetDirectory() DirectoryPath
Gets the directory part of the path.
GetExtension() string
Gets the file extension.
GetFilename() FilePath
Gets the filename.
GetFilenameWithoutExtension() FilePath
Gets the filename without its extension.
GetHashCode() int
Returns the hash code for the FilePath.
GetRelativePath(DirectoryPath) DirectoryPath
Get the relative path to another directory.
GetRelativePath(FilePath) FilePath
Get the relative path to another file.
MakeAbsolute(DirectoryPath) FilePath
Makes the path absolute (if relative) using the specified directory path.
MakeAbsolute(ICakeEnvironment) FilePath
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 FilePath(string) FilePath
operator !=(FilePath, FilePath) bool
operator ==(FilePath, FilePath) bool

Extension Methods

Name Value Summary
Dump<FilePath>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
ExpandEnvironmentVariables(ICakeEnvironment) FilePath
Expands all environment variables in the provided FilePath.
IsIn<FilePath>(FilePath[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<FilePath>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<FilePath>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
ThrowIfNull<FilePath>(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<FilePath>(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
Returns the string value or a Not set> markup suitable for Spectre.Console.
Requires the Cake.Issues addin