diff options
Diffstat (limited to 'backends/fs')
-rw-r--r-- | backends/fs/amigaos4/amigaos4-fs.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp index 4ad02e0655..b30b5c6eeb 100644 --- a/backends/fs/amigaos4/amigaos4-fs.cpp +++ b/backends/fs/amigaos4/amigaos4-fs.cpp @@ -106,6 +106,28 @@ public: virtual AbstractFSList listVolumes() const; }; +// TODO: this is ripped of +// AmigaOSFilesystemNode::AmigaOSFilesystemNode(const String &p) +// maybe change it to use this function instead? +/** + * Returns the last component of a given path. + * + * @param str String containing the path. + * @return Pointer to the first char of the last component inside str. + */ +const char *lastPathComponent(const Common::String &str) { + int offset = p.size(); + const char *str = p.c_str(); + + while (offset > 0 && (str[offset-1] == '/' || str[offset-1] == ':')) + offset--; + + while (offset > 0 && (str[offset-1] != '/' && str[offset-1] != ':')) + offset--; + + return str.c_str() + offset; +} + AmigaOSFilesystemNode::AmigaOSFilesystemNode() { ENTER(); _sDisplayName = "Available Disks"; |