aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_mortdat/create_mortdat.h
diff options
context:
space:
mode:
authorPaul Gilbert2013-07-18 09:27:55 -0400
committerPaul Gilbert2013-07-18 09:27:55 -0400
commit73bb5c5fbe66329f9074c2661a2035435e6756a4 (patch)
treebefe383329bbabfae30416652d5f7b5985a30d20 /devtools/create_mortdat/create_mortdat.h
parent5f2465466e6dd99fc17e7bd8dad3cb54b1ee4387 (diff)
downloadscummvm-rg350-73bb5c5fbe66329f9074c2661a2035435e6756a4.tar.gz
scummvm-rg350-73bb5c5fbe66329f9074c2661a2035435e6756a4.tar.bz2
scummvm-rg350-73bb5c5fbe66329f9074c2661a2035435e6756a4.zip
DEVTOOLS: Moved implementation of create_mortdat File class from the header file
Diffstat (limited to 'devtools/create_mortdat/create_mortdat.h')
-rw-r--r--devtools/create_mortdat/create_mortdat.h63
1 files changed, 14 insertions, 49 deletions
diff --git a/devtools/create_mortdat/create_mortdat.h b/devtools/create_mortdat/create_mortdat.h
index 908cb61951..8c210d32d9 100644
--- a/devtools/create_mortdat/create_mortdat.h
+++ b/devtools/create_mortdat/create_mortdat.h
@@ -43,55 +43,20 @@ class File {
private:
FILE *f;
public:
- bool open(const char *filename, AccessMode mode = kFileReadMode) {
- f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
- return (f != NULL);
- }
- void close() {
- fclose(f);
- f = NULL;
- }
- int seek(int32 offset, int whence = SEEK_SET) {
- return fseek(f, offset, whence);
- }
- long read(void *buffer, int len) {
- return fread(buffer, 1, len, f);
- }
- void write(const void *buffer, int len) {
- fwrite(buffer, 1, len, f);
- }
- byte readByte() {
- byte v;
- read(&v, sizeof(byte));
- return v;
- }
- uint16 readWord() {
- uint16 v;
- read(&v, sizeof(uint16));
- return FROM_LE_16(v);
- }
- uint32 readLong() {
- uint32 v;
- read(&v, sizeof(uint32));
- return FROM_LE_32(v);
- }
- void writeByte(byte v) {
- write(&v, sizeof(byte));
- }
- void writeWord(uint16 v) {
- uint16 vTemp = TO_LE_16(v);
- write(&vTemp, sizeof(uint16));
- }
- void writeLong(uint32 v) {
- uint32 vTemp = TO_LE_32(v);
- write(&vTemp, sizeof(uint32));
- }
- void writeString(const char *s) {
- write(s, strlen(s) + 1);
- }
- uint32 pos() {
- return ftell(f);
- }
+ bool open(const char *filename, AccessMode mode = kFileReadMode);
+ void close();
+ int seek(int32 offset, int whence = SEEK_SET);
+ uint32 pos();
+ long read(void *buffer, int len);
+ void write(const void *buffer, int len);
+
+ byte readByte();
+ uint16 readWord();
+ uint32 readLong();
+ void writeByte(byte v);
+ void writeWord(uint16 v);
+ void writeLong(uint32 v);
+ void writeString(const char *s);
};
File outputFile, mortCom;