Add Path concatenation operators.

This commit is contained in:
Sönke Ludwig 2016-10-25 08:56:05 +02:00
parent 1eb06c4b1a
commit 12daa5c575

View file

@ -1,5 +1,7 @@
module vibe.core.path;
static import std.path;
struct Path {
nothrow: @safe:
private string m_path;
@ -12,6 +14,9 @@ struct Path {
string toString() const { return m_path; }
string toNativeString() const { return m_path; }
Path opBinary(string op : "~")(string subpath) { return this ~ Path(subpath); }
Path opBinary(string op : "~")(Path subpath) { return Path(std.path.buildPath(m_path, subpath.toString())); }
}
struct PathEntry {