Table of Contents

Interface IVariablePath

Namespace
NDepend.Path
Assembly
NDepend.API.dll

Represents a path containing variable(s) defined with the syntax (case-insensitive) $(VariableName). Such path must be prefixed with a variable and can then contain more variables.

public interface IVariablePath : IPath
Inherited Members
Extension Methods

Properties (3)

AllVariables

Gets all variables contained in this path, ordered from first one (the prefix variable) to the last one.

IReadOnlyList<string> AllVariables { get; }

Property Value

IReadOnlyList<string>

Remarks

For example, for the path $(Variable1Name)$(Variable2Name) this property getter returns ["Variable1Name","Variable2Name"].

ParentDirectoryPath

Returns a new path containing variables, representing the parent directory of this path containing variables.

IVariableDirectoryPath ParentDirectoryPath { get; }

Property Value

IVariableDirectoryPath

Exceptions

InvalidOperationException

This path containing variables has no parent directory.

PrefixVariable

Gets the prefix variable name of this path.

string PrefixVariable { get; }

Property Value

string

Remarks

For example, for the path $(VariableName)\Dir this property getter returns "VariableName".

Methods (3)

TryResolve(IEnumerable<KeyValuePair<string, string>>, out IAbsolutePath)

Returns VariablePathResolvingStatus.Success if AllVariables of this path can be resolved from variablesValues cref="variablesValues" /> and the path can be resolved into a drive letter or a UNC absolute path.

VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variablesValues, out IAbsolutePath pathResolved)

Parameters

variablesValues IEnumerable<KeyValuePair<string, string>>

It is the sequence of pairs [variable name/variable value] used to resolve the path.

pathResolved IAbsolutePath

It is the absolute path resolved obtained if this method returns VariablePathResolvingStatus.Success.

Returns

VariablePathResolvingStatus

TryResolve(IEnumerable<KeyValuePair<string, string>>, out IAbsolutePath, out IReadOnlyList<string>)

Returns VariablePathResolvingStatus.Success if AllVariables of this path can be resolved from variablesValues and the path can be resolved into a drive letter or a UNC absolute path.

VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variablesValues, out IAbsolutePath pathResolved, out IReadOnlyList<string> unresolvedVariables)

Parameters

variablesValues IEnumerable<KeyValuePair<string, string>>

It is the sequence of pairs [variable name/variable value] used to resolve the path.

pathResolved IAbsolutePath

It is the absolute path resolved obtained if this method returns VariablePathResolvingStatus.Success.

unresolvedVariables IReadOnlyList<string>

This list contains one or several variables names unresolved, if this method returns VariablePathResolvingStatus.ErrorUnresolvedVariable.

Returns

VariablePathResolvingStatus

TryResolve(IEnumerable<KeyValuePair<string, string>>, out IAbsolutePath, out string)

Returns true if AllVariables of this path can be resolved from variablesValues and the path can be resolved into a drive letter or a UNC absolute path.

bool TryResolve(IEnumerable<KeyValuePair<string, string>> variablesValues, out IAbsolutePath pathResolved, out string failureReason)

Parameters

variablesValues IEnumerable<KeyValuePair<string, string>>

It is the sequence of pairs [variable name/variable value] used to resolve the path.

pathResolved IAbsolutePath

It is the absolute path resolved obtained if this method returns true.

failureReason string

If false is returned, failureReason contains the plain english description of the failure.

Returns

bool