diff options
author | David Robillard <d@drobilla.net> | 2008-08-18 19:02:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-18 19:02:13 +0000 |
commit | d9d81d15397c8ad1d503777025008489a60760c9 (patch) | |
tree | 574c5acdc27ffe5c02ea1521b195cadd39d213e9 /raul/Path.hpp | |
parent | e57c15bf111fec06a231c8e2cf5b6165cf722d10 (diff) | |
download | raul-d9d81d15397c8ad1d503777025008489a60760c9.tar.gz raul-d9d81d15397c8ad1d503777025008489a60760c9.tar.bz2 raul-d9d81d15397c8ad1d503777025008489a60760c9.zip |
Fix copy/paste between different patches.
Barf less serialisation stuff to the console.
git-svn-id: http://svn.drobilla.net/lad/raul@1431 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul/Path.hpp')
-rw-r--r-- | raul/Path.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/raul/Path.hpp b/raul/Path.hpp index 092b337..704cead 100644 --- a/raul/Path.hpp +++ b/raul/Path.hpp @@ -109,6 +109,18 @@ public: } + /** Return path relative to soe 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()); + } + } + + /** Return path with a trailing "/". * * Returned value is guaranteed to be a valid parent path, i.e. a valid |