Skip to content

Commit

Permalink
Let NormalizedPath.parentPath return NormalizedPath.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Jan 13, 2025
1 parent 4e36fd9 commit 84d4f45
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/vibe/core/path.d
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,8 @@ struct NormalizedPath(P) {

alias isSeparator = P.isSeparator;

@property NormalizedPath parentPath() const @nogc { return fromPreNormalized(m_path.parentPath); }

@property NormalizedPath normalized() nothrow @nogc { return this; }

/** Concatenates two paths.
Expand All @@ -1085,6 +1087,12 @@ struct NormalizedPath(P) {

/// Appends a relative path to this path.
void opOpAssign(string op : "~", T)(T op) { this = this ~ op; }

private static NormalizedPath fromPreNormalized(P path) {
NormalizedPath ret;
ret.m_path = path;
return ret;
}
}

///
Expand Down

0 comments on commit 84d4f45

Please sign in to comment.