DirectoryPath Class

Summary

Represents a directory path.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.IO
Interfaces
Base Types
graph BT Type-->Base0["NormalizedPath"] click Base0 "/api/Wyam.Common.IO/NormalizedPath" Base0-->Base1["Object"] Type-.->Interface0["IComparable<NormalizedPath>"] Type-.->Interface1["IComparable"] Type-.->Interface2["IEquatable<NormalizedPath>"] Type["DirectoryPath"] class Type type-node

Syntax

public sealed class DirectoryPath : NormalizedPath, IComparable<NormalizedPath>, IComparable, 
    IEquatable<NormalizedPath>

Constructors

Name Summary
DirectoryPath(string) Initializes a new instance of the Wyam.Common.IO.DirectoryPath class. The path will be considered absolute if the underlying OS file system considers it absolute.
DirectoryPath(string, PathKind) Initializes a new instance of the Wyam.Common.IO.DirectoryPath class.
DirectoryPath(string, string) Initializes a new instance of the Wyam.Common.IO.DirectoryPath class with the specified file provider. The path will be considered absolute if the underlying OS file system considers it absolute.
DirectoryPath(string, string, PathKind) Initializes a new instance of the Wyam.Common.IO.DirectoryPath class with the specified file provider.
DirectoryPath(Uri) Initializes a new instance of the Wyam.Common.IO.DirectoryPath class with the specified file provider and/or path.
DirectoryPath(Uri, string) Initializes a new instance of the Wyam.Common.IO.DirectoryPath class with the specified file provider. The path will be considered absolute if the underlying OS file system considers it absolute.
DirectoryPath(Uri, string, PathKind) Initializes a new instance of the Wyam.Common.IO.DirectoryPath class with the specified file provider.

Fields

Name Constant Value Summary
DefaultFileProvider
The default file provider.
Inherited from NormalizedPath
static

Properties

Name Value Summary
FileProvider Uri
Gets the file provider for this path. If this is a relative path, the file provider will always be null. If this is an absolute path and the file provider is null it indicates the path is not intended for use with an actual file provider.
Inherited from NormalizedPath
FullPath string
Gets the full path.
Inherited from NormalizedPath
IsAbsolute bool
Gets or sets a value indicating whether this path is absolute.
Inherited from NormalizedPath
IsRelative bool
Gets a value indicating whether this path is relative.
Inherited from NormalizedPath
Name string
Gets the name of the directory.
Parent DirectoryPath
Gets the parent path or null if this is a root path.
Root DirectoryPath
Gets the root of this path or "." if this is a relative path or there is no root.
Inherited from NormalizedPath
RootRelative DirectoryPath
Gets current path relative to it's root. If this is already a relative path or there is no root path, this just returns the current path.
Segments string[]
Gets the segments making up the path.
Inherited from NormalizedPath

Methods

Name Value Summary
Collapse() DirectoryPath
Collapses a Wyam.Common.IO.DirectoryPath containing ellipses.
Combine(DirectoryPath) DirectoryPath
Combines the current path with another Wyam.Common.IO.DirectoryPath. If the provided Wyam.Common.IO.DirectoryPath is not relative, then it is returned.
CombineFile(FilePath) FilePath
Combines the current path with a Wyam.Common.IO.FilePath. If the provided Wyam.Common.IO.FilePath is not relative, then it is returned.
CompareTo(NormalizedPath) int
Inherited from NormalizedPath
CompareTo(Object) int
Inherited from NormalizedPath
Equals(Object) bool
Inherited from NormalizedPath
FromString(string) DirectoryPath
Performs a conversion from string to Wyam.Common.IO.DirectoryPath.
static
FromUri(Uri) DirectoryPath
Performs a conversion from System.Uri to Wyam.Common.IO.DirectoryPath.
static
GetFilePath(FilePath) FilePath
Combines the current path with the file name of a Wyam.Common.IO.FilePath. The current file provider is maintained.
GetHashCode() int
Inherited from NormalizedPath
GetRelativePath(DirectoryPath) DirectoryPath
Get the relative path to another directory. If this path and the target path do not share the same file provider, the target path is returned.
GetRelativePath(FilePath) FilePath
Get the relative path to another file. If this path and the target path do not share the same file provider, the target path is returned.
ToString() string
Returns a string that represents this path.
Inherited from NormalizedPath

Operators

Name Value Summary
implicit operator DirectoryPath(string) DirectoryPath
implicit operator DirectoryPath(Uri) DirectoryPath
GitHub