Qt/QML edition

This commit is contained in:
Floris Bos 2020-03-04 16:55:40 +01:00
commit d7b361ba44
2168 changed files with 721948 additions and 0 deletions

39
windows/winfile.h Normal file
View 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