ScummVM API documentation
romfsstream.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 #ifndef BACKENDS_FS_ROMFSSTREAM_H
23 #define BACKENDS_FS_ROMFSSTREAM_H
24 
25 #include "common/scummsys.h"
26 #include "common/noncopyable.h"
27 #include "common/stream.h"
28 #include "common/str.h"
29 
31 protected:
33  void *_handle;
34 
35 public:
40  static RomfsStream *makeFromPath(const Common::String &path, bool writeMode);
41 
42  RomfsStream(void *handle);
43  ~RomfsStream() override;
44 
45  bool err() const override;
46  void clearErr() override;
47  bool eos() const override;
48 
49  uint32 write(const void *dataPtr, uint32 dataSize) override;
50  bool flush() override;
51 
52  int64 pos() const override;
53  int64 size() const override;
54  bool seek(int64 offs, int whence = SEEK_SET) override;
55  uint32 read(void *dataPtr, uint32 dataSize) override;
56 };
57 
58 #endif
bool flush() override
void clearErr() override
Definition: str.h:59
int64 size() const override
void * _handle
Definition: romfsstream.h:33
Definition: stream.h:745
bool seek(int64 offs, int whence=SEEK_SET) override
Definition: noncopyable.h:39
bool eos() const override
uint32 read(void *dataPtr, uint32 dataSize) override
static RomfsStream * makeFromPath(const Common::String &path, bool writeMode)
bool err() const override
int64 pos() const override
uint32 write(const void *dataPtr, uint32 dataSize) override
Definition: stream.h:351
Definition: romfsstream.h:30