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
11struct VFile;
12
13namespace QGBA {
14
15class VFileDevice : public QIODevice {
16Q_OBJECT
17
18public:
19 VFileDevice(VFile* vf, QObject* parent = nullptr);
20
21protected:
22 virtual qint64 readData(char* data, qint64 maxSize) override;
23 virtual qint64 writeData(const char* data, qint64 maxSize) override;
24 virtual qint64 size() const override;
25
26private:
27 mutable VFile* m_vf;
28};
29
30}
31
32#endif