Interface IPath
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
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
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
Exceptions
- InvalidOperationException
Thrown when the element type cannot be determined.
Parent
Gets the parent path.
IPath Parent { get; }
Property Value
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
rightIPurePathThe path to append.
Returns
AppendPath(string)
Appends the specified string segment to the current path.
IPath AppendPath(string right)
Parameters
rightstringThe string segment to append.
Returns
Exists()
Determines whether the path exists in the file system.
bool Exists()
Returns
- bool
trueif 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
lineNumberint?Optional line number to include in the link.
columnNumberint?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
absoluteIPathWhen this method returns, contains the absolute path if available; otherwise,
null.
Returns
- bool
trueif 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
childrenIEnumerable<IPath>When this method returns, contains the child paths if available; otherwise,
null.
Returns
- bool
trueif 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
typeElementTypeWhen this method returns, contains the type of the element if available; otherwise,
ElementType.None.
Returns
- bool
trueif the element type was successfully retrieved; otherwise,false.
TryGetParent(out IPath?)
Attempts to retrieve the parent path.
bool TryGetParent(out IPath? parent)
Parameters
parentIPathWhen this method returns, contains the parent path if available; otherwise,
null.
Returns
- bool
trueif 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
Returns
operator /(IPath, string)
Concatenates the current path with the specified string segment using the division operator.
public static IPath operator /(IPath left, string right)