Struct GenericPath
Provides a common interface to operate on paths of various kinds.
struct GenericPath(F)
;
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. |
bySegment [get]
|
GenericPath | Iterates over the path by Segment .
|
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). |
head [get]
|
GenericPath | Returns the trailing segment of the path. |
Methods
Name | Description |
---|---|
fromString
(p)
|
Constructs a path from its string representation. |
fromTrustedString
(p)
|
Constructs a path from its string representation, skipping the validation. |
hasParentPath
()
|
Determines if the parentPath property is valid.
|
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. |
parentPath
()
|
Returns a prefix of this path, where the last segment has been dropped. |
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 |
---|---|
PathRange
|
Represents a path as an forward range of Segment s.
|
Segment
|
A single path segment. |
Aliases
Name | Description |
---|---|
Format
|