aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/resource.h
diff options
context:
space:
mode:
authorJohannes Schickel2006-06-03 18:30:07 +0000
committerJohannes Schickel2006-06-03 18:30:07 +0000
commit35e7eacc3f5b9cae731e1edc97d5d9babfe4beb1 (patch)
treecf72a03aa22ca2986720605964b857880b042ccc /engines/kyra/resource.h
parent2c01a4c9013a92ba340dee6864c7c767da1c699c (diff)
downloadscummvm-rg350-35e7eacc3f5b9cae731e1edc97d5d9babfe4beb1.tar.gz
scummvm-rg350-35e7eacc3f5b9cae731e1edc97d5d9babfe4beb1.tar.bz2
scummvm-rg350-35e7eacc3f5b9cae731e1edc97d5d9babfe4beb1.zip
Changes some char* usage to Common::String.
svn-id: r22902
Diffstat (limited to 'engines/kyra/resource.h')
-rw-r--r--engines/kyra/resource.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index d8fca843bb..5306201922 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -36,28 +36,26 @@ namespace Kyra {
// standard Package format for Kyrandia games
class PAKFile {
struct PakChunk {
- char _name[32];
+ Common::String _name;
uint32 _start;
uint32 _size;
};
public:
-
- PAKFile(const Common::String &file, bool isAmiga = false);
+ PAKFile(const char *file, bool isAmiga = false);
~PAKFile();
- uint8* getFile(const char *file);
+ uint8 *getFile(const char *file);
bool getFileHandle(const char *file, Common::File &filehandle);
uint32 getFileSize(const char *file);
- bool isValid(void) const { return (_filename != 0); }
+ bool isValid(void) const { return !(_filename.empty()); }
bool isOpen(void) const { return _open; }
private:
-
bool _open;
bool _isAmiga;
- char *_filename;
+ Common::String _filename;
Common::List<PakChunk> _files; // the entries
};
@@ -66,9 +64,9 @@ public:
Resource(KyraEngine *engine);
~Resource();
- bool loadPakFile(const char *filename);
- void unloadPakFile(const char *filename);
- bool isInPakList(const char *filename);
+ bool loadPakFile(const Common::String &filename);
+ void unloadPakFile(const Common::String &filename);
+ bool isInPakList(const Common::String &filename);
uint8* fileData(const char *file, uint32 *size);
// it gives back a file handle (used for the speech player)
@@ -77,12 +75,18 @@ public:
bool fileHandle(const char *file, uint32 *size, Common::File &filehandle);
protected:
- struct PakFileEntry {
+ class PakFileEntry {
+ public:
+ PakFileEntry(PAKFile *file, const Common::String str) : _file(file), _filename(str) {}
+ PakFileEntry(const PakFileEntry &c) : _file(c._file), _filename(c._filename) {}
+
PAKFile *_file;
- char _filename[32];
+ const Common::String _filename;
+ private:
+ PakFileEntry &operator =(const PakFileEntry &c) { return *this; }
};
- KyraEngine* _engine;
+ KyraEngine *_engine;
Common::List<PakFileEntry> _pakfiles;
};