Table of Contents

Class Path

Namespace
Olve.Paths
Assembly
Olve.Paths.dll

Represents a utility class for creating and managing platform-specific path abstractions.

public static class Path
Inheritance
Path
Inherited Members

Methods

Create(string, IPathEnvironment?)

Creates a platform-specific full path from the given string.

public static IPath Create(string path, IPathEnvironment? pathEnvironment = null)

Parameters

path string

The string path to convert.

pathEnvironment IPathEnvironment

Optional environment to use for path resolution.

Returns

IPath

An instance of IPath.

Create(string, PathPlatform, IPathEnvironment?)

Creates a platform-specific full path from the given string and platform.

public static IPath Create(string path, PathPlatform platform, IPathEnvironment? pathEnvironment = null)

Parameters

path string

The string path to convert.

platform PathPlatform

The platform type to use for path interpretation.

pathEnvironment IPathEnvironment

Optional environment to use for path resolution.

Returns

IPath

An instance of IPath.

Exceptions

ArgumentNullException

Thrown when the platform is None.

CreatePure(string)

Creates a platform-specific pure path from the given string.

public static IPurePath CreatePure(string path)

Parameters

path string

The string path to convert.

Returns

IPurePath

An instance of IPurePath representing the input path.

CreatePure(string, PathPlatform)

Creates a platform-specific pure path from the given string and platform.

public static IPurePath CreatePure(string path, PathPlatform platform)

Parameters

path string

The string path to convert.

platform PathPlatform

The platform type to use for path interpretation.

Returns

IPurePath

An instance of IPurePath.

Exceptions

ArgumentNullException

Thrown when the platform is None.

CreateTempDirectory(string?)

Creates a uniquely named, empty directory in the current user's temporary directory.

public static IPath CreateTempDirectory(string? prefix = null)

Parameters

prefix string

An optional prefix for the subdirectory name.

Returns

IPath

An instance of IPath representing the created temporary directory.

CreateTempFile()

Creates a uniquely named, zero-byte temporary file on disk and returns its path.

public static IPath CreateTempFile()

Returns

IPath

An instance of IPath representing the created temporary file.

GetCurrentDirectory()

Gets the current working directory as a pure path.

public static IPath GetCurrentDirectory()

Returns

IPath

An instance of IPath representing the current directory.

GetCurrentDirectoryPure()

Gets the current working directory as a pure path.

public static IPurePath GetCurrentDirectoryPure()

Returns

IPurePath

An instance of IPurePath representing the current directory.

GetHomeDirectory()

Gets the current user's home directory as a pure path.

public static IPath GetHomeDirectory()

Returns

IPath

An instance of IPath representing the home directory.

GetHomeDirectoryPure()

Gets the current user's home directory as a pure path.

public static IPurePath GetHomeDirectoryPure()

Returns

IPurePath

An instance of IPurePath representing the home directory.

GetTempDirectory()

Gets the current user's temporary directory as a path.

public static IPath GetTempDirectory()

Returns

IPath

An instance of IPath representing the temporary directory.

TryGetAssemblyExecutable(out IPath?, IPathEnvironment?)

Attempts to retrieve the current assembly's executable as an IPath.

public static bool TryGetAssemblyExecutable(out IPath? path, IPathEnvironment? pathEnvironment = null)

Parameters

path IPath

When this method returns, contains the path to the executable, if successful.

pathEnvironment IPathEnvironment

Optional path environment for path resolution.

Returns

bool

true if successful; otherwise, false.

TryGetAssemblyExecutablePure(out IPurePath?, IPathEnvironment?)

Attempts to retrieve the current assembly's executable as a pure path.

public static bool TryGetAssemblyExecutablePure(out IPurePath? purePath, IPathEnvironment? pathEnvironment = null)

Parameters

purePath IPurePath

When this method returns, contains the pure path to the executable, if successful.

pathEnvironment IPathEnvironment

Optional path environment for path resolution.

Returns

bool

true if successful; otherwise, false.