41 #ifndef QTLOCKEDFILE_H 42 #define QTLOCKEDFILE_H 50 # if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT) 51 # define QT_QTLOCKEDFILE_EXPORT 52 # elif defined(QT_QTLOCKEDFILE_IMPORT) 53 # if defined(QT_QTLOCKEDFILE_EXPORT) 54 # undef QT_QTLOCKEDFILE_EXPORT 56 # define QT_QTLOCKEDFILE_EXPORT __declspec(dllimport) 57 # elif defined(QT_QTLOCKEDFILE_EXPORT) 58 # undef QT_QTLOCKEDFILE_EXPORT 59 # define QT_QTLOCKEDFILE_EXPORT __declspec(dllexport) 62 # define QT_QTLOCKEDFILE_EXPORT 70 enum LockMode { NoLock = 0, ReadLock, WriteLock };
76 bool open(OpenMode mode);
78 bool lock(
LockMode mode,
bool block =
true);
80 bool isLocked()
const;
87 QVector<Qt::HANDLE> rmutexes;
90 Qt::HANDLE getMutexHandle(
int idx,
bool doCreate);
91 bool waitMutex(Qt::HANDLE mutex,
bool doBlock);
The QtLockedFile class extends QFile with advisory locking functions.