Table of Contents

Interface IDirectoryPath

Namespace
NDepend.Path
Assembly
NDepend.API.dll

Represents a path to a directory on file system.

public interface IDirectoryPath : IPath
Inherited Members
Extension Methods

Remarks

The path can be relative or absolute. The extension method ToDirectoryPath(string) can be called to create a new IDirectoryPath object from a string.

Property (1)

DirectoryName

Gets a string representing the directory name.

string DirectoryName { get; }

Property Value

string

The directory name.

Remarks

If the directory is a root volume, like "C:", returns an empty string.

Methods (8)

GetBrotherDirectoryWithName(string)

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

IDirectoryPath GetBrotherDirectoryWithName(string directoryName)

Parameters

directoryName string

The brother directory name.

Returns

IDirectoryPath

Remarks

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

Exceptions

InvalidOperationException

This directory path doesn't have a parent directory.

GetBrotherFileWithName(string)

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

IFilePath GetBrotherFileWithName(string fileName)

Parameters

fileName string

The brother file name.

Returns

IFilePath

Remarks

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

Exceptions

InvalidOperationException

This directory path doesn't have a parent directory.

GetChildDirectoryWithName(string)

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

IDirectoryPath GetChildDirectoryWithName(string directoryName)

Parameters

directoryName string

The child directory name.

Returns

IDirectoryPath

Remarks

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

Exceptions

InvalidOperationException

This directory path doesn't have a parent directory.

GetChildFileWithName(string)

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

IFilePath GetChildFileWithName(string fileName)

Parameters

fileName string

The child file name.

Returns

IFilePath

Remarks

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

TryGetBrotherDirectoryWithName(string, out IDirectoryPath, out string)

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

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

Parameters

directoryName string

The brother directory name.

directoryPath IDirectoryPath

The directory path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetBrotherFileWithName(string, out IFilePath, out string)

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

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

Parameters

fileName string

The brother file name.

filePath IFilePath

The file path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetChildDirectoryWithName(string, out IDirectoryPath, out string)

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

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

Parameters

directoryName string

The child directory name.

directoryPath IDirectoryPath

The directory path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetChildFileWithName(string, out IFilePath, out string)

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

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

Parameters

fileName string

The child file name.

filePath IFilePath

The file path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool