aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/abstract-fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'backends/fs/abstract-fs.h')
-rw-r--r--backends/fs/abstract-fs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/backends/fs/abstract-fs.h b/backends/fs/abstract-fs.h
index 97de40a2fc..d81e7f36b0 100644
--- a/backends/fs/abstract-fs.h
+++ b/backends/fs/abstract-fs.h
@@ -72,6 +72,19 @@ protected:
*/
virtual AbstractFilesystemNode *getParent() const = 0;
+ /**
+ * Returns the last component of a given path.
+ *
+ * Examples:
+ * /foo/bar.txt would return /bar.txt
+ * /foo/bar/ would return /bar/
+ *
+ * @param str String containing the path.
+ * @param sep character used to separate path components
+ * @return Pointer to the first char of the last component inside str.
+ */
+ static const char *lastPathComponent(const Common::String &str, const char sep);
+
public:
/**
* Destructor.
@@ -154,4 +167,6 @@ public:
*/
};
+
+
#endif //BACKENDS_ABSTRACT_FS_H