all repos — mgba @ 2d02719fa57d4e4a33168955a8e0c34dfabc301a

mGBA Game Boy Advance Emulator

src/platform/qt/VFileDevice.h (view raw)

 1/* Copyright (c) 2013-2014 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef QGBA_VFILE_DEVICE
 7#define QGBA_VFILE_DEVICE
 8
 9#include <QFileDevice>
10
11#include "util/vfs.h"
12
13namespace QGBA {
14
15class VFileDevice : public QIODevice {
16Q_OBJECT
17
18public:
19	VFileDevice(VFile* vf, QObject* parent = nullptr);
20
21	static VFile* open(const QString& path, int mode);
22	static VDir* openDir(const QString& path);
23	static VDir* openArchive(const QString& path);
24
25protected:
26	virtual qint64 readData(char* data, qint64 maxSize) override;
27	virtual qint64 writeData(const char* data, qint64 maxSize) override;
28	virtual qint64 size() const override;
29
30private:
31	VFile* m_vf;
32};
33
34}
35
36#endif