From 918be9ff38a6c7a3cba07891491e61249ec237b5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 28 Jan 2010 04:05:45 +0000 Subject: 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 --- raul/Path.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'raul/Path.hpp') 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) { -- cgit v1.2.1