Interface IVariableDirectoryPath
Represents a directory path on file system, prefixed with an environment variable.
public interface IVariableDirectoryPath : IDirectoryPath, IVariablePath, IPath
- Inherited Members
- Extension Methods
Methods (11)
GetBrotherDirectoryWithName(string)
Returns a new directory path containing variables, representing a directory with name directoryName, located in the parent's directory of this directory.
IVariableDirectoryPath GetBrotherDirectoryWithName(string directoryName)
Parameters
directoryNamestringThe brother directory name.
Returns
Exceptions
- InvalidOperationException
This relative directory path doesn't have a parent directory.
GetBrotherFileWithName(string)
Returns a new file path containing variables, representing a file with name fileName, located in the parent's directory of this directory.
IVariableFilePath GetBrotherFileWithName(string fileName)
Parameters
fileNamestringThe brother file name.
Returns
Exceptions
- InvalidOperationException
This relative directory path doesn't have a parent directory.
GetChildDirectoryWithName(string)
Returns a new directory path containing variables, representing a directory with name directoryName, located in this directory.
IVariableDirectoryPath GetChildDirectoryWithName(string directoryName)
Parameters
directoryNamestringThe child directory name.
Returns
GetChildFileWithName(string)
Returns a new file path containing variables, representing a file with name fileName, located in this directory.
IVariableFilePath GetChildFileWithName(string fileName)
Parameters
fileNamestringThe child file name.
Returns
TryGetBrotherDirectoryWithName(string, out IVariableDirectoryPath, out string)
Returns true if directoryName doesn't contain forbidden character in path.
bool TryGetBrotherDirectoryWithName(string directoryName, out IVariableDirectoryPath directoryPath, out string failureReason)
Parameters
directoryNamestringThe brother directory name.
directoryPathIVariableDirectoryPathThe directory path obtained.
failureReasonstringThe explanation in case this call returns false.
Returns
TryGetBrotherFileWithName(string, out IVariableFilePath, out string)
Returns true if fileName doesn't contain forbidden character in path.
bool TryGetBrotherFileWithName(string fileName, out IVariableFilePath filePath, out string failureReason)
Parameters
fileNamestringThe brother file name.
filePathIVariableFilePathThe file path obtained.
failureReasonstringThe explanation in case this call returns false.
Returns
TryGetChildDirectoryWithName(string, out IVariableDirectoryPath, out string)
Returns true if directoryName doesn't contain forbidden character in path.
bool TryGetChildDirectoryWithName(string directoryName, out IVariableDirectoryPath directoryPath, out string failureReason)
Parameters
directoryNamestringThe child directory name.
directoryPathIVariableDirectoryPathThe directory path obtained.
failureReasonstringThe explanation in case this call returns false.
Returns
TryGetChildFileWithName(string, out IVariableFilePath, out string)
Returns true if fileName doesn't contain forbidden character in path.
bool TryGetChildFileWithName(string fileName, out IVariableFilePath filePath, out string failureReason)
Parameters
fileNamestringThe child file name.
filePathIVariableFilePathThe file path obtained.
failureReasonstringThe explanation in case this call returns false.
Returns
TryResolve(IEnumerable<KeyValuePair<string, string>>, out IAbsoluteDirectoryPath)
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 directory path.
VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variablesValues, out IAbsoluteDirectoryPath pathDirectoryResolved)
Parameters
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathDirectoryResolvedIAbsoluteDirectoryPathIt is the absolute directory path resolved obtained if this method returns VariablePathResolvingStatus.Success.
Returns
TryResolve(IEnumerable<KeyValuePair<string, string>>, out IAbsoluteDirectoryPath, 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 IAbsoluteDirectoryPath pathDirectoryResolved, out IReadOnlyList<string> unresolvedVariables)
Parameters
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathDirectoryResolvedIAbsoluteDirectoryPathIt is the absolute directory 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 IAbsoluteDirectoryPath, 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 directory path.
bool TryResolve(IEnumerable<KeyValuePair<string, string>> variablesValues, out IAbsoluteDirectoryPath pathDirectoryResolved, out string failureReason)
Parameters
variablesValuesIEnumerable<KeyValuePair<string, string>>It is the sequence of pairs [variable name/variable value] used to resolve the path.
pathDirectoryResolvedIAbsoluteDirectoryPathIt is the absolute directory path resolved obtained if this method returns true.
failureReasonstringIf false is returned,
failureReasoncontains the plain english description of the failure.