summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--raul/Path.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/raul/Path.hpp b/raul/Path.hpp
index 5994ef3..ea5b4b2 100644
--- a/raul/Path.hpp
+++ b/raul/Path.hpp
@@ -89,8 +89,9 @@ public:
/** Return the name of this object (everything after the last '/').
* This is the "method name" for OSC paths.
+ * The empty string may be returned (if the path is "/").
*/
- inline Symbol name() const {
+ inline std::string name() const {
if ((*this) == "/")
return "";
else
@@ -98,6 +99,15 @@ public:
}
+ /** Return the name of this object (everything after the last '/').
+ * This is the "method name" for OSC paths.
+ * Note it is illegal to call this method on the path "/".
+ */
+ inline Symbol symbol() const {
+ return substr(find_last_of("/")+1);
+ }
+
+
/** Return the parent's path.
*
* Calling this on the path "/" will return "/".