Table of Contents

Interface IPurePath

Namespace
Olve.Paths
Assembly
Olve.Paths.dll

Represents an immutable and pure file system path that is independent of the actual file system.

public interface IPurePath
Extension Methods

Properties

Name

Gets the name of the path component, or null if unavailable.

string? Name { get; }

Property Value

string

ParentPure

Gets the parent path.

IPurePath ParentPure { get; }

Property Value

IPurePath

Exceptions

InvalidOperationException

Thrown when the path has no parent.

Path

Gets the string representation of the path.

string Path { get; }

Property Value

string

Platform

Gets the platform of the path (e.g., Unix, Windows).

PathPlatform Platform { get; }

Property Value

PathPlatform

Type

Gets the type of the path (e.g., file, directory).

PathType Type { get; }

Property Value

PathType

Methods

Append(IPurePath)

Appends another pure path to the current path.

IPurePath Append(IPurePath right)

Parameters

right IPurePath

The path to append.

Returns

IPurePath

A new IPurePath instance representing the combined path.

Append(string)

Appends a string segment to the current path.

IPurePath Append(string right)

Parameters

right string

The segment to append.

Returns

IPurePath

A new IPurePath instance representing the combined path.

TryGetName(out string?)

Attempts to retrieve the name of the path component (e.g., filename or directory name).

bool TryGetName(out string? fileName)

Parameters

fileName string

When this method returns, contains the name of the path component if available; otherwise, null.

Returns

bool

true if the name was successfully retrieved; otherwise, false.

TryGetParentPure(out IPurePath?)

Attempts to retrieve the parent path.

bool TryGetParentPure(out IPurePath? parent)

Parameters

parent IPurePath

When this method returns, contains the parent path if available; otherwise, null.

Returns

bool

true if the parent path was successfully retrieved; otherwise, false.

Operators

operator /(IPurePath, IPurePath)

Concatenates two pure paths using the division operator.

public static IPurePath operator /(IPurePath left, IPurePath right)

Parameters

left IPurePath
right IPurePath

Returns

IPurePath

operator /(IPurePath, string)

Concatenates a path with a string segment using the division operator.

public static IPurePath operator /(IPurePath left, string right)

Parameters

left IPurePath
right string

Returns

IPurePath