[Scummvm-cvs-logs] SF.net SVN: scummvm:[41823] scummvm/trunk/engines/gob
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Wed Jun 24 01:55:48 CEST 2009
Revision: 41823
http://scummvm.svn.sourceforge.net/scummvm/?rev=41823&view=rev
Author: drmccoy
Date: 2009-06-23 23:55:48 +0000 (Tue, 23 Jun 2009)
Log Message:
-----------
Added methods to get the file base from a filename
Modified Paths:
--------------
scummvm/trunk/engines/gob/totfile.cpp
scummvm/trunk/engines/gob/totfile.h
Modified: scummvm/trunk/engines/gob/totfile.cpp
===================================================================
--- scummvm/trunk/engines/gob/totfile.cpp 2009-06-23 23:55:35 UTC (rev 41822)
+++ scummvm/trunk/engines/gob/totfile.cpp 2009-06-23 23:55:48 UTC (rev 41823)
@@ -114,4 +114,14 @@
return base + ".tot";
}
+Common::String TOTFile::getFileBase(const Common::String &fileName) {
+ const char *dot;
+ if ((dot = strrchr(fileName.c_str(), '.'))) {
+ // fileName includes an extension
+ return Common::String(fileName.c_str(), dot);
+ }
+
+ return fileName;
+}
+
} // End of namespace Gob
Modified: scummvm/trunk/engines/gob/totfile.h
===================================================================
--- scummvm/trunk/engines/gob/totfile.h 2009-06-23 23:55:35 UTC (rev 41822)
+++ scummvm/trunk/engines/gob/totfile.h 2009-06-23 23:55:48 UTC (rev 41823)
@@ -64,6 +64,7 @@
bool getProperties(Properties &props) const;
static Common::String createFileName(const Common::String &base, bool &isLOM);
+ static Common::String getFileBase(const Common::String &fileName);
private:
GobEngine *_vm;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list