Interface IVariablePath
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
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
Exceptions
- InvalidOperationException
This path containing variables has no parent directory.
PrefixVariable
Gets the prefix variable name of this path.
string PrefixVariable { get; }
Property Value
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
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathResolvedIAbsolutePathIt is the absolute path resolved obtained if this method returns VariablePathResolvingStatus.Success.
Returns
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
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathResolvedIAbsolutePathIt is the absolute path resolved obtained if this method returns VariablePathResolvingStatus.Success.
unresolvedVariablesIReadOnlyList<string>This list contains one or several variables names unresolved, if this method returns VariablePathResolvingStatus.ErrorUnresolvedVariable.
Returns
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
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathResolvedIAbsolutePathIt is the absolute path resolved obtained if this method returns true.
failureReasonstringIf false is returned,
failureReasoncontains the plain english description of the failure.