diff options
author | David Robillard <d@drobilla.net> | 2010-01-28 04:05:45 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-01-28 04:05:45 +0000 |
commit | 918be9ff38a6c7a3cba07891491e61249ec237b5 (patch) | |
tree | 63aaf77abae39a0a2c612288c21cef19fc563b20 | |
parent | d75218498af8d21a01e330d047913be04ed95d71 (diff) | |
download | raul-918be9ff38a6c7a3cba07891491e61249ec237b5.tar.gz raul-918be9ff38a6c7a3cba07891491e61249ec237b5.tar.bz2 raul-918be9ff38a6c7a3cba07891491e61249ec237b5.zip |
Add Path::base_no_scheme for serialising paths without the ugly path: scheme for UIs and such.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2384 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | raul/Path.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/raul/Path.hpp b/raul/Path.hpp index 5119530..ffa8aa0 100644 --- a/raul/Path.hpp +++ b/raul/Path.hpp @@ -173,6 +173,15 @@ public: return str() + "/"; } + /** Return path with a trailing "/". + * + * Returned value is guaranteed to be a valid parent path, i.e. a valid + * child path can be made using parent.base() + child_name. + */ + inline const std::string base_no_scheme() const { + 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) { |