Commit of patch #1804861. It implements a static lastPathComponent() function in each backend, used to extract the last path component of a given path, returned by getName().

svn-id: r29159
This commit is contained in:
David Corrales 2007-10-07 00:28:38 +00:00
parent 0fab64817f
commit aba30d7ea8
13 changed files with 144 additions and 99 deletions

View file

@ -62,7 +62,6 @@ public:
virtual String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return true; } //FIXME: this is just a stub
virtual bool isValid() const { return _isValid; }
virtual bool isWritable() const { return true; } //FIXME: this is just a stub
virtual AbstractFilesystemNode *getChild(const String &n) const;
@ -81,6 +80,9 @@ public:
* @return Pointer to the first char of the last component inside str.
*/
const char *lastPathComponent(const Common::String &str) {
if(str.empty())
return "";
const char *start = str.c_str();
const char *cur = start + str.size() - 2;