diff options
Diffstat (limited to 'raul')
-rw-r--r-- | raul/Path.hpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/raul/Path.hpp b/raul/Path.hpp index e59da60..c399767 100644 --- a/raul/Path.hpp +++ b/raul/Path.hpp @@ -113,7 +113,9 @@ public: static std::string pathify(const std::basic_string<char>& str); static std::string nameify(const std::basic_string<char>& str); - static void replace_invalid_chars(std::string& str, size_t start, bool replace_slash = false); + static void replace_invalid_chars(std::string& str, + size_t start, + bool replace_slash = false); bool is_root() const { return (*this) == root(); } @@ -164,26 +166,23 @@ public: } } - /** Return the path's child with the given name (symbol) */ inline Path child(const Raul::Symbol& symbol) const { return base() + symbol.c_str(); } - /** Return path relative to some base path (chop prefix) */ inline Path relative_to_base(const Path& base) const { if ((*this) == base) { return "/"; } else { - assert(length() > base.length()); - return substr(base.length() - 1); + assert(length() > base.base().length()); + return substr(base.base().length() - 1); } } - /** Return path with a trailing "/". * * Returned value is guaranteed to be a valid parent path, i.e. a valid @@ -206,7 +205,6 @@ public: return base().substr(find(":") + 1); } - /** Return true if \a child is equal to, or a descendant of \a parent */ static bool descendant_comparator(const Path& parent, const Path& child) { return ( child == parent || (child.length() > parent.length() && |