Table of Contents

Interface IRelativeDirectoryPath

Namespace
NDepend.Path
Assembly
NDepend.API.dll

Represents a relative directory path.

public interface IRelativeDirectoryPath : IDirectoryPath, IRelativePath, IPath
Inherited Members
Extension Methods

Remarks

The extension method ToRelativeDirectoryPath(string) can be called to create a new IRelativeDirectoryPath object from a string.

Methods (9)

GetBrotherDirectoryWithName(string)

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

IRelativeDirectoryPath GetBrotherDirectoryWithName(string directoryName)

Parameters

directoryName string

The brother directory name.

Returns

IRelativeDirectoryPath

Exceptions

InvalidOperationException

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

GetBrotherFileWithName(string)

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

IRelativeFilePath GetBrotherFileWithName(string fileName)

Parameters

fileName string

The brother file name.

Returns

IRelativeFilePath

Exceptions

InvalidOperationException

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

GetChildDirectoryWithName(string)

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

IRelativeDirectoryPath GetChildDirectoryWithName(string directoryName)

Parameters

directoryName string

The child directory name.

Returns

IRelativeDirectoryPath

GetChildFileWithName(string)

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

IRelativeFilePath GetChildFileWithName(string fileName)

Parameters

fileName string

The child file name.

Returns

IRelativeFilePath

TryGetAbsolutePathFrom(IAbsoluteDirectoryPath, out IAbsoluteDirectoryPath, out string)

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

bool TryGetAbsolutePathFrom(IAbsoluteDirectoryPath pivotDirectory, out IAbsoluteDirectoryPath absoluteDirectoryPath, out string failureReason)

Parameters

pivotDirectory IAbsoluteDirectoryPath

The pivot directory from which the absolute path is computed.

absoluteDirectoryPath IAbsoluteDirectoryPath

A new absolute directory path representing this relative directory resolved from 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.

Remarks

The returned file nor pivotDirectory need to exist for this operation to complete properly.

TryGetBrotherDirectoryWithName(string, out IRelativeDirectoryPath, out string)

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

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

Parameters

directoryName string

The brother directory name.

directoryPath IRelativeDirectoryPath

The directory path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetBrotherFileWithName(string, out IRelativeFilePath, out string)

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

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

Parameters

fileName string

The brother file name.

filePath IRelativeFilePath

The file path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetChildDirectoryWithName(string, out IRelativeDirectoryPath, out string)

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

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

Parameters

directoryName string

The child directory name.

directoryPath IRelativeDirectoryPath

The directory path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool

TryGetChildFileWithName(string, out IRelativeFilePath, out string)

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

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

Parameters

fileName string

The child file name.

filePath IRelativeFilePath

The file path obtained.

failureReason string

The explanation in case this call returns false.

Returns

bool