From cb21c25e417bb546f6678ab9da7440c6e1b4b2fd Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 27 Aug 2008 20:31:22 +0000 Subject: FSNode code: Merged most versions of lastPathComponent() into one new AbstractFilesystemNode::lastPathComponent() method, with customizable path separator character svn-id: r34197 --- backends/fs/ds/ds-fs.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'backends/fs/ds') diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp index cffe4c118d..d206941ab9 100644 --- a/backends/fs/ds/ds-fs.cpp +++ b/backends/fs/ds/ds-fs.cpp @@ -798,25 +798,3 @@ int std_ferror(FILE* handle) { } } // namespace DS - -/** - * 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. - * @return Pointer to the first char of the last component inside str. - */ -const char *lastPathComponent(const Common::String &str) { - const char *start = str.c_str(); - const char *cur = start + str.size() - 2; - - while (cur >= start && *cur != '/' && *cur != '\\') { - --cur; - } - - return cur + 1; -} - -- cgit v1.2.3