Table of Contents

Interface IPath

Namespace
Olve.Paths
Assembly
Olve.Paths.dll

Represents a path that includes contextual information about its environment, such as its element type and resolved state.

public interface IPath : IPurePath
Inherited Members
Extension Methods

Properties

Absolute

Gets the absolute version of the current path.

IPath Absolute { get; }

Property Value

IPath

Exceptions

InvalidOperationException

Thrown when the absolute path is not available.

Children

Gets the child elements of the current path.

IEnumerable<IPath> Children { get; }

Property Value

IEnumerable<IPath>

Exceptions

InvalidOperationException

Thrown when the path has no children.

ElementType

Gets the type of the element represented by the path.

ElementType ElementType { get; }

Property Value

ElementType

Exceptions

InvalidOperationException

Thrown when the element type cannot be determined.

Parent

Gets the parent path.

IPath Parent { get; }

Property Value

IPath

Exceptions

InvalidOperationException

Thrown when the path has no parent.

Methods

AppendPath(IPurePath)

Appends the specified path to the current path.

IPath AppendPath(IPurePath right)

Parameters

right IPurePath

The path to append.

Returns

IPath

A new IPath representing the combined path.

AppendPath(string)

Appends the specified string segment to the current path.

IPath AppendPath(string right)

Parameters

right string

The string segment to append.

Returns

IPath

A new IPath representing the combined path.

Exists()

Determines whether the path exists in the file system.

bool Exists()

Returns

bool

true if the path exists; otherwise, false.

GetLinkString(int?, int?)

Returns a string representation of the path as a clickable link, optionally including line and column information.

string GetLinkString(int? lineNumber = null, int? columnNumber = null)

Parameters

lineNumber int?

Optional line number to include in the link.

columnNumber int?

Optional column number to include in the link.

Returns

string

A formatted link string.

TryGetAbsolute(out IPath?)

Attempts to retrieve the absolute version of the current path.

bool TryGetAbsolute(out IPath? absolute)

Parameters

absolute IPath

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

Returns

bool

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

TryGetChildren(out IEnumerable<IPath>?)

Attempts to retrieve the child elements of the current path.

bool TryGetChildren(out IEnumerable<IPath>? children)

Parameters

children IEnumerable<IPath>

When this method returns, contains the child paths if available; otherwise, null.

Returns

bool

true if children were successfully retrieved; otherwise, false.

TryGetElementType(out ElementType)

Attempts to retrieve the type of the element represented by the path.

bool TryGetElementType(out ElementType type)

Parameters

type ElementType

When this method returns, contains the type of the element if available; otherwise, ElementType.None.

Returns

bool

true if the element type was successfully retrieved; otherwise, false.

TryGetParent(out IPath?)

Attempts to retrieve the parent path.

bool TryGetParent(out IPath? parent)

Parameters

parent IPath

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 /(IPath, IPurePath)

Concatenates two paths using the division operator.

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

Parameters

left IPath
right IPurePath

Returns

IPath

operator /(IPath, string)

Concatenates the current path with the specified string segment using the division operator.

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

Parameters

left IPath
right string

Returns

IPath