diff options
author | Einar Johan Trøan Sømåen | 2012-07-22 07:24:48 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-22 07:24:48 +0200 |
commit | 742521c20db68e965761ba9309bb0a3dea379217 (patch) | |
tree | b11b0da21b95260657f5bf13c1501d145266c24d /engines/wintermute/base/base_file_manager.h | |
parent | f54f262bb56d251d131109a81cad7811e240ff4f (diff) | |
download | scummvm-rg350-742521c20db68e965761ba9309bb0a3dea379217.tar.gz scummvm-rg350-742521c20db68e965761ba9309bb0a3dea379217.tar.bz2 scummvm-rg350-742521c20db68e965761ba9309bb0a3dea379217.zip |
WINTERMUTE: Redo base_file_manager, to use FSLists for registering/opening packages.
This is helpfull for consistency between registering and lookup, and allows for explicit removal/adding
of sub_paths for the engine. But most importantly it keeps the loading consistent and non-duplicated
for detection.
Diffstat (limited to 'engines/wintermute/base/base_file_manager.h')
-rw-r--r-- | engines/wintermute/base/base_file_manager.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/wintermute/base/base_file_manager.h b/engines/wintermute/base/base_file_manager.h index 469108bee8..78e6cb737f 100644 --- a/engines/wintermute/base/base_file_manager.h +++ b/engines/wintermute/base/base_file_manager.h @@ -32,6 +32,7 @@ #include "engines/wintermute/base/file/base_file_entry.h"
#include "common/archive.h"
#include "common/str.h"
+#include "common/fs.h"
namespace Common {
class File;
@@ -41,39 +42,38 @@ namespace WinterMute { class BaseFile;
class BaseFileManager: BaseClass {
public:
- bool findPackageSignature(Common::File *f, uint32 *offset);
+ bool findPackageSignature(Common::SeekableReadStream *f, uint32 *offset);
bool cleanup();
bool setBasePath(const Common::String &path);
bool restoreCurrentDir();
char *_basePath;
- bool getFullPath(const Common::String &filename, char *fullname);
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);
BaseFileEntry *getPackageEntry(const Common::String &filename);
- Common::File *openSingleFile(const Common::String &name);
Common::File *openPackage(const Common::String &name);
+ bool registerPackages(const Common::FSList &fslist);
bool registerPackages();
bool initPaths();
bool reloadPaths();
typedef enum {
PATH_PACKAGE, PATH_SINGLE
} TPathType;
- bool addPath(TPathType type, const Common::String &path);
+ 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::Array<char *> _singlePaths;
- Common::Array<char * > _packagePaths;
+// Common::FSList _singlePaths;
+ Common::FSList _packagePaths;
Common::Array<BasePackage *> _packages;
Common::Array<Common::SeekableReadStream *> _openFiles;
-
Common::HashMap<Common::String, BaseFileEntry *> _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<Common::String, BaseFileEntry *>::iterator _filesIter;
bool isValidPackage(const AnsiString &fileName) const;
|