Table of Contents

Class PathHelpers

Namespace
NDepend.Path
Assembly
NDepend.API.dll

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

string

PathVariableEnd

Path variables are formatted this way $(VariableName). Hence this getter returns the string ")".

public static string PathVariableEnd { get; }

Property Value

string

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

path IPath

The first path.

pathOther IPath

The second path.

Returns

bool

IsNotNullAndExists(IAbsolutePath)

Returns true if path is not null, and path.Exists equals true.

public static bool IsNotNullAndExists(this IAbsolutePath path)

Parameters

path IAbsolutePath

The path reference.

Returns

bool

IsValidAbsoluteDirectoryPath(string)

Determine whether this string is a valid absolute directory path or not.

public static bool IsValidAbsoluteDirectoryPath(this string pathString)

Parameters

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathVariableName string

The string on which we test if it is a valid path variable name.

Returns

bool

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

pathVariableValue string

The string on which we test if it is a valid path variable value.

Returns

bool

IsValidRelativeDirectoryPath(string)

Determine whether this string is a valid relative directory path or not.

public static bool IsValidRelativeDirectoryPath(this string pathString)

Parameters

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathString string

This 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

pathString string

this string

failureReason string

If 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

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathString string

This 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

pathString string

This string from which is determined the path validity.

failureReason string

If 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

pathString string

Represents the path.

Returns

IAbsoluteDirectoryPath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

Returns

IAbsoluteFilePath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

Returns

IDirectoryPath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

Returns

IEnvVarDirectoryPath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

Returns

IEnvVarFilePath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

Returns

IFilePath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

Returns

IRelativeDirectoryPath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

Returns

IRelativeFilePath

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

pathString is null.

ArgumentException

pathString is 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

path IPath

The path reference.

Returns

string

ToVariableDirectoryPath(string)

Returns a new IVariableDirectoryPath object from this string.

public static IVariableDirectoryPath ToVariableDirectoryPath(this string pathString)

Parameters

pathString string

Represents the path.

Returns

IVariableDirectoryPath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

Returns

IVariableFilePath

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

pathString is null.

ArgumentException

pathString is 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

pathString string

Represents the path.

absoluteDirectoryPath IAbsoluteDirectoryPath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid absolute directory path and as a consequence, the returned absoluteDirectoryPath is 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

pathString string

Represents the path.

absoluteDirectoryPath IAbsoluteDirectoryPath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid absolute directory path and as a consequence, the returned absoluteDirectoryPath is 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

pathString string

Represents the path string.

absoluteFilePath IAbsoluteFilePath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid absolute file path and as a consequence, the returned absoluteFilePath is 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

pathString string

Represents the path string.

absoluteFilePath IAbsoluteFilePath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid absolute file path and as a consequence, the returned absoluteFilePath is 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

pathString string

Represents the path.

directoryPath IDirectoryPath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid directory path and as a consequence, the returned directoryPath is 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

pathString string

Represents the path.

directoryPath IDirectoryPath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid directory path and as a consequence, the returned directoryPath is 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

pathString string

Represents the path.

envVarDirectoryPath IEnvVarDirectoryPath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid directory path prefixed with an environment variable and as a consequence, the returned envVarDirectoryPath is 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

pathString string

Represents the path.

envVarDirectoryPath IEnvVarDirectoryPath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid directory path prefixed with an environment variable and as a consequence, the returned envVarDirectoryPath is 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

pathString string

Represents the path.

envVarFilePath IEnvVarFilePath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid file path prefixed with an environment variable and as a consequence, the returned envVarFilePath is 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

pathString string

Represents the path.

envVarFilePath IEnvVarFilePath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid file path prefixed with an environment variable and as a consequence, the returned envVarFilePath is 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

pathString string

Represents the path.

filePath IFilePath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid file path and as a consequence, the returned filePath is 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

pathString string

Represents the path.

filePath IFilePath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid file path and as a consequence, the returned filePath is 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

pathString string

Represents the path.

relativeDirectoryPath IRelativeDirectoryPath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid relative directory path and as a consequence, the returned relativeDirectoryPath is 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

pathString string

Represents the path.

relativeDirectoryPath IRelativeDirectoryPath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid relative directory path and as a consequence, the returned relativeDirectoryPath is 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

pathString string

Represents the path.

relativeFilePath IRelativeFilePath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid relative file path and as a consequence, the returned relativeFilePath is 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

pathString string

Represents the path.

relativeFilePath IRelativeFilePath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid relative file path and as a consequence, the returned relativeFilePath is 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

pathString string

Represents the path.

variableDirectoryPath IVariableDirectoryPath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid directory path that contains variables and as a consequence, the returned variableDirectoryPath is 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

pathString string

Represents the path.

variableDirectoryPath IVariableDirectoryPath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid directory path that contains variables and as a consequence, the returned variableDirectoryPath is 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

pathString string

Represents the path.

variableFilePath IVariableFilePath

If this method returns true, this is the returned path object.

Returns

bool

true if pathString is a valid file path that contains variables and as a consequence, the returned variableFilePath is 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

pathString string

Represents the path.

variableFilePath IVariableFilePath

If this method returns true, this is the returned path object.

failureReason string

If this method returns false, this is the plain english description of the failure.

Returns

bool

true if pathString is a valid file path that contains variables and as a consequence, the returned variableFilePath is not null.

Remarks

The path represented by this string doesn't need to exist for this operation to complete properly.