mirror of https://github.com/mgba-emu/mgba.git
Qt: Add creating a VFileDevice from a QByteArray
This commit is contained in:
parent
df082b46d9
commit
517aa353ca
|
@ -91,6 +91,13 @@ VFileDevice::VFileDevice(const QString& filename, QIODevice::OpenMode mode, QObj
|
|||
}
|
||||
}
|
||||
|
||||
VFileDevice::VFileDevice(const QByteArray& mem, QObject* parent)
|
||||
: QIODevice(parent)
|
||||
, m_vf(VFileMemChunk(mem.constData(), mem.size()))
|
||||
{
|
||||
setOpenMode(QIODevice::ReadWrite);
|
||||
}
|
||||
|
||||
VFileDevice::~VFileDevice() {
|
||||
close();
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ Q_OBJECT
|
|||
|
||||
public:
|
||||
VFileDevice(VFile* vf = nullptr, QObject* parent = nullptr);
|
||||
VFileDevice(const QByteArray& mem, QObject* parent = nullptr);
|
||||
VFileDevice(const QString&, QIODevice::OpenMode, QObject* parent = nullptr);
|
||||
virtual ~VFileDevice();
|
||||
|
||||
|
|
Loading…
Reference in New Issue