ScummVM API documentation
base_file.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * This file is based on WME Lite.
24  * http://dead-code.org/redir.php?target=wmelite
25  * Copyright (c) 2011 Jan Nedoma
26  */
27 
28 #ifndef WINTERMUTE_BASE_FILE_H
29 #define WINTERMUTE_BASE_FILE_H
30 
31 
32 #include "engines/wintermute/base/base.h"
33 #include "common/str.h"
34 #include "common/stream.h"
35 
36 namespace Common {
37 class SeekableReadStream;
38 }
39 
40 namespace Wintermute {
41 
42 class BaseFile {
43 protected:
44  uint32 _pos;
45  uint32 _size;
46 public:
47  virtual uint32 getSize() const {
48  return _size;
49  };
50  virtual uint32 getPos() const {
51  return _pos;
52  };
53  virtual bool seek(uint32 pos, int whence = SEEK_SET) = 0;
54  virtual bool read(void *buffer, uint32 size) = 0;
55  virtual bool close() = 0;
56  virtual bool open(const Common::String &filename) = 0;
57  virtual bool isEOF();
58  BaseFile();
59  virtual ~BaseFile();
60  // Temporary solution to allow usage in ScummVM-code:
61  virtual Common::SeekableReadStream *getMemStream();
62 };
63 
64 } // End of namespace Wintermute
65 
66 #endif
Definition: str.h:59
Definition: stream.h:745
Definition: base_file.h:42
Definition: algorithm.h:29
Definition: achievements_tables.h:27