ScummVM API documentation
FileStream.h
1 /* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher
2  * Copyright (C) 2011-2022 Dean Beeler, Jerome Fisher, Sergey V. Mikayev
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 2.1 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef MT32EMU_FILE_STREAM_H
19 #define MT32EMU_FILE_STREAM_H
20 
21 #include <fstream>
22 
23 #include "globals.h"
24 #include "Types.h"
25 #include "File.h"
26 
27 namespace MT32Emu {
28 
29 class FileStream : public AbstractFile {
30 public:
31  MT32EMU_EXPORT FileStream();
32  MT32EMU_EXPORT ~FileStream();
33  MT32EMU_EXPORT size_t getSize();
34  MT32EMU_EXPORT const Bit8u *getData();
35  MT32EMU_EXPORT bool open(const char *filename);
36  MT32EMU_EXPORT void close();
37 
38 private:
39  std::ifstream &ifsp;
40  const Bit8u *data;
41  size_t size;
42 };
43 
44 } // namespace MT32Emu
45 
46 #endif // #ifndef MT32EMU_FILE_STREAM_H
Definition: Analog.h:26
Definition: FileStream.h:29
Definition: File.h:41