Table of Contents

Interface IAbsoluteDirectoryPath

Namespace
NDepend.Path
Assembly
NDepend.API.dll

Represents an absolute path to a directory on file system.

public interface IAbsoluteDirectoryPath : IDirectoryPath, IAbsolutePath, IPath
Inherited Members
Extension Methods

Remarks

The path represented can exist or not. The extension method ToAbsoluteDirectoryPath(string) can be called to create a new IAbsoluteDirectoryPath object from a string.

Properties (3)

ChildrenDirectoriesPath

Returns a read-only list of directory paths absolute matching directories contained in this directory.

IReadOnlyList<IAbsoluteDirectoryPath> ChildrenDirectoriesPath { get; }

Property Value

IReadOnlyList<IAbsoluteDirectoryPath>

Exceptions

DirectoryNotFoundException

This absolute directory path doesn't refer to an existing directory.

See Also

ChildrenFilesPath

Returns a read-only list of file paths absolute matching files contained in this directory.

IReadOnlyList<IAbsoluteFilePath> ChildrenFilesPath { get; }

Property Value

IReadOnlyList<IAbsoluteFilePath>

Exceptions

DirectoryNotFoundException

This absolute directory path doesn't refer to an existing directory.

See Also

DirectoryInfo

Returns a DirectoryInfo object representing this absolute directory path.

DirectoryInfo DirectoryInfo { get; }

Property Value

DirectoryInfo

Exceptions

DirectoryNotFoundException

This absolute directory path doesn't refer to an existing directory.

See Also

Methods (9)

GetBrotherDirectoryWithName(string)

Returns a new absolute directory path representing a directory with name directoryName, located in the parent's directory of this directory.

IAbsoluteDirectoryPath GetBrotherDirectoryWithName(string directoryName)

Parameters

directoryName string

The brother directory name.

Returns

IAbsoluteDirectoryPath

Remarks

This directory nor the returned directory need to exist for this operation to complete properly.

Exceptions

InvalidOperationException

This absolute directory path doesn't have a parent directory.

GetBrotherFileWithName(string)

Returns a new absolute file path representing a file with name fileName, located in the parent's directory of this directory.

IAbsoluteFilePath GetBrotherFileWithName(string fileName)

Parameters

fileName string

The brother file name.

Returns

IAbsoluteFilePath

Remarks

This directory nor the returned file need to exist for this operation to complete properly.

Exceptions

InvalidOperationException

This absolute directory path doesn't have a parent directory.

GetChildDirectoryWithName(string)

Returns a new absolute directory path representing a directory with name directoryName, located in this directory.

IAbsoluteDirectoryPath GetChildDirectoryWithName(string directoryName)

Parameters

directoryName string

The child directory name.

Returns

IAbsoluteDirectoryPath

Remarks

This directory nor the returned directory need to exist for this operation to complete properly.

Exceptions

InvalidOperationException

This absolute directory path doesn't have a parent directory.

GetChildFileWithName(string)

Returns a new absolute file path representing a file with name fileName, located in this directory.

IAbsoluteFilePath GetChildFileWithName(string fileName)

Parameters

fileName string

The child file name.

Returns

IAbsoluteFilePath

Remarks

This directory nor the returned file need to exist for this operation to complete properly.

Exceptions

ArgumentException

fileName contains forbidden character in path.

TryGetBrotherDirectoryWithName(string, out IAbsoluteDirectoryPath, out string)

Returns true if directoryName doesn't contain forbidden character in path.

bool TryGetBrotherDirectoryWithName(string directoryName, out IAbsoluteDirectoryPath directoryPath, out string failureReason)

Parameters

directoryName string

The brother directory name.

directoryPath IAbsoluteDirectoryPath

The directory path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetBrotherFileWithName(string, out IAbsoluteFilePath, out string)

Returns true if fileName doesn't contain forbidden character in path.

bool TryGetBrotherFileWithName(string fileName, out IAbsoluteFilePath filePath, out string failureReason)

Parameters

fileName string

The brother file name.

filePath IAbsoluteFilePath

The file path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetChildDirectoryWithName(string, out IAbsoluteDirectoryPath, out string)

Returns true if directoryName doesn't contain forbidden character in path.

bool TryGetChildDirectoryWithName(string directoryName, out IAbsoluteDirectoryPath directoryPath, out string failureReason)

Parameters

directoryName string

The child directory name.

directoryPath IAbsoluteDirectoryPath

The directory path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetChildFileWithName(string, out IAbsoluteFilePath, out string)

Returns true if fileName doesn't contain forbidden character in path.

bool TryGetChildFileWithName(string fileName, out IAbsoluteFilePath filePath, out string failureReason)

Parameters

fileName string

The child file name.

filePath IAbsoluteFilePath

The file path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetRelativePathFrom(IAbsoluteDirectoryPath, out IRelativeDirectoryPath, out string)

Compute this directory as relative from pivotDirectory. If this directory is "C:\Dir1\Dir2" and pivotDirectory is "C:\Dir1\Dir3", the returned relative directory is "..\Dir2".

bool TryGetRelativePathFrom(IAbsoluteDirectoryPath pivotDirectory, out IRelativeDirectoryPath relativeDirectoryPath, out string failureReason)

Parameters

pivotDirectory IAbsoluteDirectoryPath

The pivot directory from which the relative path is computed.

relativeDirectoryPath IRelativeDirectoryPath

A new relative directory path representing this directory relative to pivotDirectory.

failureReason string

If this method returns false, contains a plain-english message explaining why it failed.

Returns

bool

true if the operation works, else returns false.