From 12daa5c5758b1de604411a8f7665d4248a3239a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 25 Oct 2016 08:56:05 +0200 Subject: [PATCH] Add Path concatenation operators. --- source/vibe/core/path.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/vibe/core/path.d b/source/vibe/core/path.d index bcc7151..21198dd 100644 --- a/source/vibe/core/path.d +++ b/source/vibe/core/path.d @@ -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 {