mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Qt/QML edition
This commit is contained in:
commit
d7b361ba44
2168 changed files with 721948 additions and 0 deletions
39
windows/winfile.h
Normal file
39
windows/winfile.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
#ifndef WINFILE_H
|
||||
#define WINFILE_H
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Copyright (C) 2020 Raspberry Pi (Trading) Limited
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QIODevice>
|
||||
#include <windows.h>
|
||||
|
||||
class WinFile : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WinFile(QObject *parent = nullptr);
|
||||
virtual ~WinFile();
|
||||
void setFileName(const QString &name);
|
||||
bool open(QIODevice::OpenMode mode);
|
||||
void close();
|
||||
bool isOpen();
|
||||
qint64 write(const char *data, qint64 maxSize);
|
||||
qint64 read(char *data, qint64 maxSize);
|
||||
HANDLE handle();
|
||||
QString errorString() const;
|
||||
bool flush();
|
||||
bool seek(qint64 pos);
|
||||
qint64 pos();
|
||||
bool lockVolume();
|
||||
bool unlockVolume();
|
||||
|
||||
protected:
|
||||
bool _locked;
|
||||
QString _name, _lasterror;
|
||||
HANDLE _h;
|
||||
};
|
||||
|
||||
#endif // WINFILE_H
|
Loading…
Add table
Add a link
Reference in a new issue