Struct GenericPath
Provides a common interface to operate on paths of various kinds.
Constructors
Name | Description |
this
(p)
|
Constructs a path from its string representation.
|
this
(segment)
|
Constructs a path from a single path segment.
|
this
(segments)
|
Constructs a path from an input range of Segment s.
|
Fields
Name | Type | Description |
m_path
|
string | |
Properties
Name | Type | Description |
absolute [get]
|
bool | Tests if the path is absolute.
|
byPrefix [get]
|
auto | Iterates over the path by segment, each time returning the sub path
leading to that segment.
|
bySegment [get]
|
auto | Iterates over the individual segments of the path.
|
empty [get]
|
bool | Tests if the path is represented by an empty string.
|
endsWithSlash [get, set]
|
bool | Determines whether the path ends with a path separator (i.e. represents a folder specifically).
|
fileExtension [get]
|
auto | The extension part of the file name pointed to by the path.
|
hasParentPath [get]
|
bool | Determines if the parentPath property is valid.
|
head [get]
|
GenericPath.Segment | Returns the trailing segment of the path.
|
normalized [get]
|
GenericPath | Returns the normalized form of the path.
|
parentPath [get]
|
GenericPath | Returns a prefix of this path, where the last segment has been dropped.
|
Methods
Name | Description |
fromString
(p)
|
Constructs a path from its string representation.
|
fromTrustedString
(p)
|
Constructs a path from its string representation, skipping the
validation.
|
isSeparator
(ch)
|
Tests if a certain character is a path segment separator.
|
normalize
()
|
Removes any redundant path segments and replaces all separators by the
default one.
|
opBinary
(subpath)
|
Concatenates two paths.
|
opCast
()
|
Converts the path to a different path format.
|
opEquals
(other)
|
Compares two path objects.
|
opOpAssign
(op)
|
Appends a relative path to this path.
|
startsWith
(prefix)
|
Tests whether the given path is a prefix of this path.
|
toHash
()
|
Computes a hash sum, enabling storage within associative arrays.
|
toString
()
|
Returns the string representation of the path.
|
Inner structs
Name | Description |
Segment
|
A single path segment.
|