Class PathHelpers
Contains extensions methods to obtain a path object from a string and to check that a string indeed represents a valid path.
public static class PathHelpers
- Inheritance
-
PathHelpers
- Inherited Members
Properties (3)
ForbiddenCharInPath
An array of char forbidden in string representing path.
public static char[] ForbiddenCharInPath { get; }
Property Value
- char[]
Remarks
Use this string.IndexOfAny(char[]) method to detect the presence of any of this char in a string.
The char ':' is not included in this array. The only proper position for this character in a path, is the second position, just after a letter.
PathVariableBegin
Path variables are formatted this way \((VariableName). Hence this getter returns the string "\)(".
public static string PathVariableBegin { get; }
Property Value
PathVariableEnd
Path variables are formatted this way $(VariableName). Hence this getter returns the string ")".
public static string PathVariableEnd { get; }
Property Value
Methods (55)
EqualsNullSupported(IPath, IPath)
Returns true if path and pathOther are both null, or if path.Equals(pathOther).
public static bool EqualsNullSupported(this IPath path, IPath pathOther)
Parameters
Returns
IsNotNullAndExists(IAbsolutePath)
Returns true if path is not null, and path.Exists equals true.
public static bool IsNotNullAndExists(this IAbsolutePath path)
Parameters
pathIAbsolutePathThe path reference.
Returns
IsValidAbsoluteDirectoryPath(string)
Determine whether this string is a valid absolute directory path or not.
public static bool IsValidAbsoluteDirectoryPath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid absolute path, otherwise false.
Remarks
If this method returns true, the extension method ToAbsoluteDirectoryPath(string) can be safely invoked on this string to obtain a IAbsoluteDirectoryPath. Notice that this method can return true even if the path represented by this string doesn't exist.
IsValidAbsoluteDirectoryPath(string, out string)
Determine whether this string is a valid absolute directory path or not.
public static bool IsValidAbsoluteDirectoryPath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid absolute path, otherwise false.
Remarks
If this method returns true, the extension method ToAbsoluteDirectoryPath(string) can be safely invoked on this string to obtain a IAbsoluteDirectoryPath. Notice that this method can return true even if the path represented by this string doesn't exist.
IsValidAbsoluteFilePath(string)
Determine whether this string is a valid file absolute path or not.
public static bool IsValidAbsoluteFilePath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid absolute file path, otherwise false.
Remarks
If this method returns true, the extension method ToAbsoluteFilePath(string) can be safely invoked on this string to obtain a IAbsoluteFilePath. Notice that this method can return true even if the path represented by this string doesn't exist.
IsValidAbsoluteFilePath(string, out string)
Determine whether this string is a valid file absolute path or not.
public static bool IsValidAbsoluteFilePath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid absolute file path, otherwise false.
Remarks
If this method returns true, the extension method ToAbsoluteFilePath(string) can be safely invoked on this string to obtain a IAbsoluteFilePath. Notice that this method can return true even if the path represented by this string doesn't exist.
IsValidDirectoryPath(string)
Determine whether this string is a valid directory path or not.
public static bool IsValidDirectoryPath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid relative or absolute directory path, otherwise false.
Remarks
If this method returns true, the extension method ToDirectoryPath(string) can be safely invoked on this string to obtain a IDirectoryPath. Notice that this method can return true even if the path represented by this string doesn't exist.
IsValidDirectoryPath(string, out string)
Determine whether this string is a valid directory path or not.
public static bool IsValidDirectoryPath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid relative or absolute directory path, otherwise false.
Remarks
If this method returns true, the extension method ToDirectoryPath(string) can be safely invoked on this string to obtain a IDirectoryPath. Notice that this method can return true even if the path represented by this string doesn't exist.
IsValidEnvVarDirectoryPath(string)
Determine whether this string is a valid directory path prefixed with an environment variable or not.
public static bool IsValidEnvVarDirectoryPath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid path prefixed with an environment variable, otherwise false.
Remarks
If this method returns true, the extension method ToEnvVarDirectoryPath(string) can be safely invoked on this string to obtain a IEnvVarDirectoryPath.
In addition to the the letters and digits, the following characters are accepted in the environment variable name _(){}[]$+-#',;.@!
IsValidEnvVarDirectoryPath(string, out string)
Determine whether this string is a valid directory path prefixed with an environment variable or not.
public static bool IsValidEnvVarDirectoryPath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid path prefixed with an environment variable, otherwise false.
Remarks
If this method returns true, the extension method ToEnvVarDirectoryPath(string) can be safely invoked on this string to obtain a IEnvVarDirectoryPath.
In addition to the the letters and digits, the following characters are accepted in the environment variable name _(){}[]$+-#',;.@!
IsValidEnvVarFilePath(string)
Determine whether this string is a valid file path prefixed with an environment variable or not.
public static bool IsValidEnvVarFilePath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid file path prefixed with an environment variable, otherwise false.
Remarks
If this method returns true, the extension method ToEnvVarFilePath(string) can be safely invoked on this string to obtain a IEnvVarFilePath.
In addition to the the letters and digits, the following characters are accepted in the environment variable name _(){}[]$+-#',;.@!
IsValidEnvVarFilePath(string, out string)
Determine whether this string is a valid file path prefixed with an environment variable or not.
public static bool IsValidEnvVarFilePath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid file path prefixed with an environment variable, otherwise false.
Remarks
If this method returns true, the extension method ToEnvVarFilePath(string) can be safely invoked on this string to obtain a IEnvVarFilePath.
In addition to the the letters and digits, the following characters are accepted in the environment variable name _(){}[]$+-#',;.@!
IsValidFilePath(string)
Determine whether this string is a valid file path or not.
public static bool IsValidFilePath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid relative or absolute file path, otherwise false.
Remarks
If this method returns true, the extension method ToFilePath(string) can be safely invoked on this string to obtain a IFilePath. Notice that this method can return true even if the path represented by this string doesn't exist.
IsValidFilePath(string, out string)
Determine whether this string is a valid file path or not.
public static bool IsValidFilePath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid relative or absolute file path, otherwise false.
Remarks
If this method returns true, the extension method ToFilePath(string) can be safely invoked on this string to obtain a IFilePath. Notice that this method can return true even if the path represented by this string doesn't exist.
IsValidPathVariableName(string)
Returns true if pathVariableName contains only upper/lower case letters, digits and underscore and has less than 1024 characters. In such case pathVariableName is a valid path variable name.
public static bool IsValidPathVariableName(this string pathVariableName)
Parameters
pathVariableNamestringThe string on which we test if it is a valid path variable name.
Returns
IsValidPathVariableValue(string)
Returns true if pathVariableValue has less than 1024 characters and has no character in ForbiddenCharInPath. In such case pathVariableValue is a valid path variable name.
public static bool IsValidPathVariableValue(this string pathVariableValue)
Parameters
pathVariableValuestringThe string on which we test if it is a valid path variable value.
Returns
IsValidRelativeDirectoryPath(string)
Determine whether this string is a valid relative directory path or not.
public static bool IsValidRelativeDirectoryPath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid relative path, otherwise false.
Remarks
If this method returns true, the extension method ToRelativeDirectoryPath(string) can be safely invoked on this string to obtain a IRelativeDirectoryPath.
IsValidRelativeDirectoryPath(string, out string)
Determine whether this string is a valid relative directory path or not.
public static bool IsValidRelativeDirectoryPath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid relative path, otherwise false.
Remarks
If this method returns true, the extension method ToRelativeDirectoryPath(string) can be safely invoked on this string to obtain a IRelativeDirectoryPath.
IsValidRelativeFilePath(string)
Determine whether this string is a valid relative file path or not.
public static bool IsValidRelativeFilePath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid relative file path, otherwise false.
Remarks
If this method returns true, the extension method ToRelativeFilePath(string) can be safely invoked on this string to obtain a IRelativeFilePath.
IsValidRelativeFilePath(string, out string)
Determine whether this string is a valid relative file path or not.
public static bool IsValidRelativeFilePath(this string pathString, out string failureReason)
Parameters
pathStringstringthis string
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid relative file path, otherwise false.
Remarks
If this method returns true ToRelativeFilePath(string) can be safely invoked on this string to obtain a IRelativeFilePath.
IsValidVariableDirectoryPath(string)
Determine whether this string is a valid directory path that contains variables.
public static bool IsValidVariableDirectoryPath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid path that contains variables, otherwise false.
Remarks
If this method returns true, the extension method ToVariableDirectoryPath(string) can be safely invoked on this string to obtain a IVariableDirectoryPath.
IsValidVariableDirectoryPath(string, out string)
Determine whether this string is a valid directory path that contains variables.
public static bool IsValidVariableDirectoryPath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid path that contains variables, otherwise false.
Remarks
If this method returns true, the extension method ToVariableDirectoryPath(string) can be safely invoked on this string to obtain a IVariableDirectoryPath.
IsValidVariableFilePath(string)
Determine whether this string is a valid file that contains variables, or not.
public static bool IsValidVariableFilePath(this string pathString)
Parameters
pathStringstringThis string from which is determined the path validity.
Returns
- bool
true if this string represents a valid file path that contains variables, otherwise false.
Remarks
If this method returns true, the extension method ToVariableFilePath(string) can be safely invoked on this string to obtain a IVariableFilePath.
IsValidVariableFilePath(string, out string)
Determine whether this string is a valid file that contains variables, or not.
public static bool IsValidVariableFilePath(this string pathString, out string failureReason)
Parameters
pathStringstringThis string from which is determined the path validity.
failureReasonstringIf false is returned, failureReason contains the plain english description of the failure.
Returns
- bool
true if this string represents a valid file path that contains variables, otherwise false.
Remarks
If this method returns true, the extension method ToVariableFilePath(string) can be safely invoked on this string to obtain a IVariableFilePath.
ToAbsoluteDirectoryPath(string)
Returns a new IAbsoluteDirectoryPath object from this string.
public static IAbsoluteDirectoryPath ToAbsoluteDirectoryPath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The method IsValidAbsoluteDirectoryPath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid absolute directory path.
ToAbsoluteFilePath(string)
Returns a new IAbsoluteFilePath object from this string.
public static IAbsoluteFilePath ToAbsoluteFilePath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The method IsValidAbsoluteFilePath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid absolute file path.
ToDirectoryPath(string)
Returns a new IDirectoryPath object from this string.
public static IDirectoryPath ToDirectoryPath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The method IsValidDirectoryPath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid relative or absolute directory path or a valid directory path prefixed with an environment variable.
ToEnvVarDirectoryPath(string)
Returns a new IEnvVarDirectoryPath object from this string.
public static IEnvVarDirectoryPath ToEnvVarDirectoryPath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The environment variable prefixing the path doesn't need to exist for this operation to complete properly.
The method IsValidEnvVarDirectoryPath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid directory path prefixed with an environment variable.
ToEnvVarFilePath(string)
Returns a new IEnvVarFilePath object from this string.
public static IEnvVarFilePath ToEnvVarFilePath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The environment variable prefixing the path doesn't need to exist for this operation to complete properly.
The method IsValidEnvVarFilePath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid file path prefixed with an environment variable.
ToFilePath(string)
Returns a new IFilePath object object from this string.
public static IFilePath ToFilePath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The method IsValidFilePath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid relative or absolute file path or a valid file path prefixed with an environment variable.
ToRelativeDirectoryPath(string)
Returns a new IRelativeDirectoryPath object from this string.
public static IRelativeDirectoryPath ToRelativeDirectoryPath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The method IsValidRelativeDirectoryPath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid relative directory path.
ToRelativeFilePath(string)
Returns a new IRelativeFilePath object from this string.
public static IRelativeFilePath ToRelativeFilePath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The method IsValidRelativeFilePath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid relative file path.
ToStringOrIfNullToEmptyString(IPath)
Returns path.ToString() is path is null, else returns the empty string.
public static string ToStringOrIfNullToEmptyString(this IPath path)
Parameters
pathIPathThe path reference.
Returns
ToVariableDirectoryPath(string)
Returns a new IVariableDirectoryPath object from this string.
public static IVariableDirectoryPath ToVariableDirectoryPath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The method IsValidVariableDirectoryPath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid directory path that contains variables.
ToVariableFilePath(string)
Returns a new IVariableFilePath object from this string.
public static IVariableFilePath ToVariableFilePath(this string pathString)
Parameters
pathStringstringRepresents the path.
Returns
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
The method IsValidVariableFilePath(string) can be called to enfore pathString validity before calling this method, and avoid any exception.
Exceptions
- ArgumentNullException
pathStringis null.- ArgumentException
pathStringis empty or doesn't represents a valid file path that contains variables.
TryGetAbsoluteDirectoryPath(string, out IAbsoluteDirectoryPath)
Try get a new IAbsoluteDirectoryPath object from this string.
public static bool TryGetAbsoluteDirectoryPath(this string pathString, out IAbsoluteDirectoryPath absoluteDirectoryPath)
Parameters
pathStringstringRepresents the path.
absoluteDirectoryPathIAbsoluteDirectoryPathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid absolute directory path and as a consequence, the returnedabsoluteDirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetAbsoluteDirectoryPath(string, out IAbsoluteDirectoryPath, out string)
Try get a new IAbsoluteDirectoryPath object from this string.
public static bool TryGetAbsoluteDirectoryPath(this string pathString, out IAbsoluteDirectoryPath absoluteDirectoryPath, out string failureReason)
Parameters
pathStringstringRepresents the path.
absoluteDirectoryPathIAbsoluteDirectoryPathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid absolute directory path and as a consequence, the returnedabsoluteDirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetAbsoluteFilePath(string, out IAbsoluteFilePath)
Try get a new IAbsoluteFilePath object from this string.
public static bool TryGetAbsoluteFilePath(this string pathString, out IAbsoluteFilePath absoluteFilePath)
Parameters
pathStringstringRepresents the path string.
absoluteFilePathIAbsoluteFilePathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid absolute file path and as a consequence, the returnedabsoluteFilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetAbsoluteFilePath(string, out IAbsoluteFilePath, out string)
Try get a new IAbsoluteFilePath object from this string.
public static bool TryGetAbsoluteFilePath(this string pathString, out IAbsoluteFilePath absoluteFilePath, out string failureReason)
Parameters
pathStringstringRepresents the path string.
absoluteFilePathIAbsoluteFilePathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid absolute file path and as a consequence, the returnedabsoluteFilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetDirectoryPath(string, out IDirectoryPath)
Try get a new IDirectoryPath object from this string.
public static bool TryGetDirectoryPath(this string pathString, out IDirectoryPath directoryPath)
Parameters
pathStringstringRepresents the path.
directoryPathIDirectoryPathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid directory path and as a consequence, the returneddirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetDirectoryPath(string, out IDirectoryPath, out string)
Try get a new IDirectoryPath object from this string.
public static bool TryGetDirectoryPath(this string pathString, out IDirectoryPath directoryPath, out string failureReason)
Parameters
pathStringstringRepresents the path.
directoryPathIDirectoryPathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid directory path and as a consequence, the returneddirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetEnvVarDirectoryPath(string, out IEnvVarDirectoryPath)
Try get a new IEnvVarDirectoryPath object from this string.
public static bool TryGetEnvVarDirectoryPath(this string pathString, out IEnvVarDirectoryPath envVarDirectoryPath)
Parameters
pathStringstringRepresents the path.
envVarDirectoryPathIEnvVarDirectoryPathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid directory path prefixed with an environment variable and as a consequence, the returnedenvVarDirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly. The environment variable prefixing the path doesn't need to exist for this operation to complete properly.
TryGetEnvVarDirectoryPath(string, out IEnvVarDirectoryPath, out string)
Try get a new IEnvVarDirectoryPath object from this string.
public static bool TryGetEnvVarDirectoryPath(this string pathString, out IEnvVarDirectoryPath envVarDirectoryPath, out string failureReason)
Parameters
pathStringstringRepresents the path.
envVarDirectoryPathIEnvVarDirectoryPathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid directory path prefixed with an environment variable and as a consequence, the returnedenvVarDirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly. The environment variable prefixing the path doesn't need to exist for this operation to complete properly.
TryGetEnvVarFilePath(string, out IEnvVarFilePath)
Try get a new IEnvVarFilePath object from this string.
public static bool TryGetEnvVarFilePath(this string pathString, out IEnvVarFilePath envVarFilePath)
Parameters
pathStringstringRepresents the path.
envVarFilePathIEnvVarFilePathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid file path prefixed with an environment variable and as a consequence, the returnedenvVarFilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly. The environment variable prefixing the path doesn't need to exist for this operation to complete properly.
TryGetEnvVarFilePath(string, out IEnvVarFilePath, out string)
Try get a new IEnvVarFilePath object from this string.
public static bool TryGetEnvVarFilePath(this string pathString, out IEnvVarFilePath envVarFilePath, out string failureReason)
Parameters
pathStringstringRepresents the path.
envVarFilePathIEnvVarFilePathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid file path prefixed with an environment variable and as a consequence, the returnedenvVarFilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly. The environment variable prefixing the path doesn't need to exist for this operation to complete properly.
TryGetFilePath(string, out IFilePath)
Try get a new IFilePath object object from this string.
public static bool TryGetFilePath(this string pathString, out IFilePath filePath)
Parameters
pathStringstringRepresents the path.
filePathIFilePathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid file path and as a consequence, the returnedfilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetFilePath(string, out IFilePath, out string)
Try get a new IFilePath object object from this string.
public static bool TryGetFilePath(this string pathString, out IFilePath filePath, out string failureReason)
Parameters
pathStringstringRepresents the path.
filePathIFilePathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid file path and as a consequence, the returnedfilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetRelativeDirectoryPath(string, out IRelativeDirectoryPath)
Try get a new IAbsoluteDirectoryPath object from this string.
public static bool TryGetRelativeDirectoryPath(this string pathString, out IRelativeDirectoryPath relativeDirectoryPath)
Parameters
pathStringstringRepresents the path.
relativeDirectoryPathIRelativeDirectoryPathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid relative directory path and as a consequence, the returnedrelativeDirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetRelativeDirectoryPath(string, out IRelativeDirectoryPath, out string)
Try get a new IAbsoluteDirectoryPath object from this string.
public static bool TryGetRelativeDirectoryPath(this string pathString, out IRelativeDirectoryPath relativeDirectoryPath, out string failureReason)
Parameters
pathStringstringRepresents the path.
relativeDirectoryPathIRelativeDirectoryPathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid relative directory path and as a consequence, the returnedrelativeDirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetRelativeFilePath(string, out IRelativeFilePath)
Try get a new IRelativeFilePath object from this string.
public static bool TryGetRelativeFilePath(this string pathString, out IRelativeFilePath relativeFilePath)
Parameters
pathStringstringRepresents the path.
relativeFilePathIRelativeFilePathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid relative file path and as a consequence, the returnedrelativeFilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetRelativeFilePath(string, out IRelativeFilePath, out string)
Try get a new IRelativeFilePath object from this string.
public static bool TryGetRelativeFilePath(this string pathString, out IRelativeFilePath relativeFilePath, out string failureReason)
Parameters
pathStringstringRepresents the path.
relativeFilePathIRelativeFilePathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid relative file path and as a consequence, the returnedrelativeFilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetVariableDirectoryPath(string, out IVariableDirectoryPath)
Try get a new IVariableDirectoryPath object from this string.
public static bool TryGetVariableDirectoryPath(this string pathString, out IVariableDirectoryPath variableDirectoryPath)
Parameters
pathStringstringRepresents the path.
variableDirectoryPathIVariableDirectoryPathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid directory path that contains variables and as a consequence, the returnedvariableDirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetVariableDirectoryPath(string, out IVariableDirectoryPath, out string)
Try get a new IVariableDirectoryPath object from this string.
public static bool TryGetVariableDirectoryPath(this string pathString, out IVariableDirectoryPath variableDirectoryPath, out string failureReason)
Parameters
pathStringstringRepresents the path.
variableDirectoryPathIVariableDirectoryPathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid directory path that contains variables and as a consequence, the returnedvariableDirectoryPathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetVariableFilePath(string, out IVariableFilePath)
Try get a new IVariableFilePath object from this string.
public static bool TryGetVariableFilePath(this string pathString, out IVariableFilePath variableFilePath)
Parameters
pathStringstringRepresents the path.
variableFilePathIVariableFilePathIf this method returns true, this is the returned path object.
Returns
- bool
true if
pathStringis a valid file path that contains variables and as a consequence, the returnedvariableFilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.
TryGetVariableFilePath(string, out IVariableFilePath, out string)
Try get a new IVariableFilePath object from this string.
public static bool TryGetVariableFilePath(this string pathString, out IVariableFilePath variableFilePath, out string failureReason)
Parameters
pathStringstringRepresents the path.
variableFilePathIVariableFilePathIf this method returns true, this is the returned path object.
failureReasonstringIf this method returns false, this is the plain english description of the failure.
Returns
- bool
true if
pathStringis a valid file path that contains variables and as a consequence, the returnedvariableFilePathis not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly.