diff options
author | Max Horn | 2010-10-25 23:19:39 +0000 |
---|---|---|
committer | Max Horn | 2010-10-25 23:19:39 +0000 |
commit | a7832856252828450a63fdd1d10c337cc8fb671e (patch) | |
tree | 265a3aae7e0d4dad340ce73194273e3a9800b299 /engines/sword25/kernel/filesystemutil.h | |
parent | e0d5db0bb822f4772d90cd404fb23e89524f7b3a (diff) | |
download | scummvm-rg350-a7832856252828450a63fdd1d10c337cc8fb671e.tar.gz scummvm-rg350-a7832856252828450a63fdd1d10c337cc8fb671e.tar.bz2 scummvm-rg350-a7832856252828450a63fdd1d10c337cc8fb671e.zip |
SWORD25: Simplify FS 'wrapper' code a bit, add FIXME comments
The save system of this engine currently partially bypasses the
SaveFileManager API, by (abusing) the fact that the Lua engine allows
creating files in arbitrary places (it exposes fopen, fread, fwrite
etc.). This is used to create a 'config.lua' configuration file. This makes it non-portable.
In addition, the filenames used for the savestates ("0.b25s") do not
comply with our naming conventions for engine savestates.
It should be possible to overcome all this, but it might require hacking
the Lua engine; or we could try to replace some of the BS2.5 script
functions with our own, dynamically.
svn-id: r53838
Diffstat (limited to 'engines/sword25/kernel/filesystemutil.h')
-rw-r--r-- | engines/sword25/kernel/filesystemutil.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/engines/sword25/kernel/filesystemutil.h b/engines/sword25/kernel/filesystemutil.h index 4c089e1049..38a3fdaa12 100644 --- a/engines/sword25/kernel/filesystemutil.h +++ b/engines/sword25/kernel/filesystemutil.h @@ -61,8 +61,6 @@ namespace Sword25 { class FileSystemUtil { public: - static FileSystemUtil &getInstance(); - virtual ~FileSystemUtil() {} /** * This function returns the name of the directory in which all user data is to be stored. @@ -70,37 +68,32 @@ public: * These are for example Screenshots, game saves, configuration files, log files, ... * @return Returns the name of the directory for user data. */ - virtual Common::String getUserdataDirectory() = 0; + static Common::String getUserdataDirectory(); + /** * @return Returns the path seperator */ - virtual Common::String getPathSeparator() = 0; + static Common::String getPathSeparator(); + /** * @param Filename The path to a file. * @return Returns the size of the specified file. If the size could not be * determined, or the file does not exist, returns -1 */ - virtual int32 getFileSize(const Common::String &filename) = 0; + static int32 getFileSize(const Common::String &filename); + /** * @param Filename The path to a file. * @return Returns true if the file exists. */ - virtual bool fileExists(const Common::String &filename) = 0; - /** - * This function creates a directory - * - * If the parameter is "\b\c\d\e" is passed, and "\b\c" already exists, then folder 'd' - * will be created, and subdirectory 'e' under it. - * @param DirectoryName The name of the directory to be created - * @return Returns true if the folder(s) could be created, otherwise false. - */ - virtual bool createDirectory(const Common::String &directoryName) = 0; + static bool fileExists(const Common::String &filename); + /** * Gets the filename from a path and filename * @param Filename The full path and filename * @return Returns just the filename */ - virtual Common::String getPathFilename(const Common::String &path) = 0; + static Common::String getPathFilename(const Common::String &path); }; } // End of namespace Sword25 |