Interface IVariableFilePath
Represents a file path on file system, prefixed with an environment variable.
public interface IVariableFilePath : IFilePath, IVariablePath, IPath
- Inherited Members
- Extension Methods
Methods (6)
GetBrotherDirectoryWithName(string)
Returns a new directory path containing variables, representing a directory with name directoryName, located in the same directory as this file.
IVariableDirectoryPath GetBrotherDirectoryWithName(string directoryName)
Parameters
directoryNamestringThe brother directory name.
Returns
GetBrotherFileWithName(string)
Returns a new file path containing variables, refering to a file with name fileName, located in the same directory as this file.
IVariableFilePath GetBrotherFileWithName(string fileName)
Parameters
fileNamestringThe brother file name
Returns
TryResolve(IEnumerable<KeyValuePair<string, string>>, out IAbsoluteFilePath)
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 file path.
VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variablesValues, out IAbsoluteFilePath pathFileResolved)
Parameters
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathFileResolvedIAbsoluteFilePathIt is the absolute file path resolved obtained if this method returns VariablePathResolvingStatus.Success.
Returns
TryResolve(IEnumerable<KeyValuePair<string, string>>, out IAbsoluteFilePath, 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 file path.
VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variablesValues, out IAbsoluteFilePath pathFileResolved, out IReadOnlyList<string> unresolvedVariables)
Parameters
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathFileResolvedIAbsoluteFilePathIt is the absolute file 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 IAbsoluteFilePath, 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 file path.
bool TryResolve(IEnumerable<KeyValuePair<string, string>> variablesValues, out IAbsoluteFilePath pathFileResolved, out string failureReason)
Parameters
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathFileResolvedIAbsoluteFilePathIt is the absolute file path resolved obtained if this method returns true.
failureReasonstringIf false is returned,
failureReasoncontains the plain english description of the failure.
Returns
UpdateExtension(string)
Returns a new file path containing variables, representing this file with its file name extension updated to newExtension.
IVariableFilePath UpdateExtension(string newExtension)
Parameters
newExtensionstringThe new file extension. It must begin with a dot followed by one or many characters.