commit 9e29b10eab745fe842728cf1630c460db667655e
parent c6aeec6f2e3fc147e8a0dae4b2b2ca1a270480a0
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sun, 10 Sep 2017 20:11:58 -0400
path: prepend resource path to relative paths only
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/path.cpp b/src/path.cpp
@@ -194,6 +194,11 @@ bool Path::startsWith(const Path &o) const
return true;
}
+Path Path::prependRoot() const
+{
+ return m_absolute ? *this : s_root + *this;
+}
+
bool Path::operator==(const Path &o) const
{
return m_absolute == o.absolute() && m_parts == o.m_parts;
diff --git a/src/path.hpp b/src/path.hpp
@@ -50,7 +50,7 @@ public:
std::string first() const;
std::string last() const;
bool startsWith(const Path &) const;
- Path prependRoot() const { return s_root + *this; }
+ Path prependRoot() const;
std::list<std::string>::const_iterator begin() const { return m_parts.begin(); }
std::list<std::string>::const_iterator end() const { return m_parts.end(); }