From 8b6e4fc7527eb5c56755c068d8c5b75951298fe5 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 23 Jul 2012 00:14:34 +0200 Subject: WINTERMUTE: Privatize/remove unused/internal functions in BaseFileManager --- engines/wintermute/base/base_file_manager.h | 49 +++++++++++++++-------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'engines/wintermute/base/base_file_manager.h') diff --git a/engines/wintermute/base/base_file_manager.h b/engines/wintermute/base/base_file_manager.h index 7799f5193a..b91609bc45 100644 --- a/engines/wintermute/base/base_file_manager.h +++ b/engines/wintermute/base/base_file_manager.h @@ -29,8 +29,8 @@ #ifndef WINTERMUTE_BFILEMANAGER_H #define WINTERMUTE_BFILEMANAGER_H -#include "engines/wintermute/base/file/base_file_entry.h" #include "engines/wintermute/base/base.h" +#include "engines/wintermute/base/file/base_package.h" #include "common/archive.h" #include "common/str.h" #include "common/fs.h" @@ -41,44 +41,47 @@ class File; namespace WinterMute { class BaseFile; +class BaseFileEntry; class BaseFileManager: BaseClass { public: - bool findPackageSignature(Common::SeekableReadStream *f, uint32 *offset); bool cleanup(); - bool setBasePath(const Common::String &path); - bool restoreCurrentDir(); - char *_basePath; - Common::SeekableReadStream *openFileRaw(const Common::String &filename); + bool closeFile(Common::SeekableReadStream *File); bool hasFile(const Common::String &filename); Common::SeekableReadStream *openFile(const Common::String &filename, bool absPathWarning = true, bool keepTrackOf = true); + Common::SeekableReadStream *loadSaveGame(const Common::String &filename); + byte *readWholeFile(const Common::String &filename, uint32 *size = NULL, bool mustExist = true); + + BaseFileManager(BaseGame *inGame = NULL); + virtual ~BaseFileManager(); + // Used only by BasePersistenceManager + bool saveFile(const Common::String &filename, byte *buffer, uint32 bufferSize, bool compressed = false, byte *prefixBuffer = NULL, uint32 prefixSize = 0); + // Used only for detection + bool registerPackages(const Common::FSList &fslist); + // Used by BasePackage only BaseFileEntry *getPackageEntry(const Common::String &filename); Common::File *openPackage(const Common::String &name); - bool registerPackages(const Common::FSList &fslist); - bool registerPackages(); - bool initPaths(); - bool reloadPaths(); + bool requestCD(int cd, char *packageFile, const char *filename); +private: typedef enum { - PATH_PACKAGE, PATH_SINGLE + PATH_PACKAGE, + PATH_SINGLE } TPathType; + bool reloadPaths(); + bool initPaths(); bool addPath(TPathType type, const Common::FSNode &path); - bool requestCD(int cd, char *packageFile, const char *filename); - Common::SeekableReadStream *loadSaveGame(const Common::String &filename); - bool saveFile(const Common::String &filename, byte *buffer, uint32 bufferSize, bool compressed = false, byte *prefixBuffer = NULL, uint32 prefixSize = 0); - byte *readWholeFile(const Common::String &filename, uint32 *size = NULL, bool mustExist = true); - BaseFileManager(BaseGame *inGame = NULL); - virtual ~BaseFileManager(); -// Common::FSList _singlePaths; + bool registerPackages(); + Common::SeekableReadStream *openFileRaw(const Common::String &filename); Common::FSList _packagePaths; +// Common::FSList _singlePaths; + bool findPackageSignature(Common::SeekableReadStream *f, uint32 *offset); + bool registerPackage(Common::SeekableReadStream *stream, const Common::String &filename = "", bool searchSignature = false); + bool registerPackage(const Common::String &filename, bool searchSignature = false); + bool isValidPackage(const AnsiString &fileName) const; Common::Array _packages; Common::Array _openFiles; Common::HashMap _files; -private: - bool registerPackage(Common::SeekableReadStream *stream, const Common::String &filename = "", bool searchSignature = false); - bool registerPackage(const Common::String &filename, bool searchSignature = false); Common::HashMap::iterator _filesIter; - bool isValidPackage(const AnsiString &fileName) const; - }; } // end of namespace WinterMute -- cgit v1.2.3