00001 /* ScummVM - Graphic Adventure Engine00002 *00003 * ScummVM is the legal property of its developers, whose names00004 * are too numerous to list here. Please refer to the COPYRIGHT00005 * file distributed with this source distribution.00006 *00007 * This program is free software; you can redistribute it and/or00008 * modify it under the terms of the GNU General Public License00009 * as published by the Free Software Foundation; either version 200010 * of the License, or (at your option) any later version.00011 *00012 * This program is distributed in the hope that it will be useful,00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the00015 * GNU General Public License for more details.00016 *00017 * You should have received a copy of the GNU General Public License00018 * along with this program; if not, write to the Free Software00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.00020 *00021 */00022
00023 #ifndef COMMON_FILE_H00024 #define COMMON_FILE_H00025
00026 #include "common/scummsys.h"00027 #include "common/fs.h"00028 #include "common/noncopyable.h"00029 #include "common/str.h"00030 #include "common/stream.h"00031
00032 namespace Common {
00033
00034 class Archive;
00035
00039class File : publicSeekableReadStream, publicNonCopyable {
00040 protected:
00042SeekableReadStream *_handle;
00043
00045String_name;
00046
00047 public:
00048 File();
00049 virtual~File();
00050
00058 staticboolexists(constString &filename);
00059
00067 virtualboolopen(constString &filename);
00068
00077 virtualboolopen(constString &filename, Archive &archive);
00078
00088 virtualboolopen(constFSNode &node);
00089
00099 virtualboolopen(SeekableReadStream *stream, constString &name);
00100
00104 virtualvoidclose();
00105
00111 boolisOpen() const;
00112
00118constchar *getName() const { return_name.c_str(); }
00119
00120 boolerr() const; // implement abstract Stream method00121 voidclearErr(); // implement abstract Stream method00122 booleos() const; // implement abstract SeekableReadStream method00123
00124 int32pos() const; // implement abstract SeekableReadStream method00125 int32size() const; // implement abstract SeekableReadStream method00126 boolseek(int32 offs, int whence = SEEK_SET); // implement abstract SeekableReadStream method00127 uint32read(void *dataPtr, uint32 dataSize); // implement abstract SeekableReadStream method00128 };
00129
00130
00137class DumpFile : publicSeekableWriteStream, publicNonCopyable {
00138 protected:
00140WriteStream *_handle;
00141
00142 public:
00143 DumpFile();
00144 virtual~DumpFile();
00145
00146 virtualboolopen(constString &filename, bool createPath = false);
00147 virtualboolopen(constFSNode &node);
00148
00149 virtualvoidclose();
00150
00156 boolisOpen() const;
00157
00158 boolerr() const;
00159 voidclearErr();
00160
00161 virtualuint32write(constvoid *dataPtr, uint32 dataSize) override;
00162
00163 virtualboolflush() override;
00164
00165 virtualint32pos() const override;
00166
00167 virtualboolseek(int32offset, int whence = SEEK_SET) override;
00168 virtualint32size() const override;
00169 };
00170
00171 } // End of namespace Common00172
00173 #endif
Generated on Sat Dec 7 2019 05:00:28 for ResidualVM by 1.7.1