FileGuard Class | Qt Installer Framework Manual

- Qt Installer Framework Manual
- FileGuard

# FileGuard Class

class QInstaller::FileGuard

The `FileGuard` class provides basic access serialization for file paths. More...

Header: | #include <FileGuard>

- List of all members, including inherited members

## Public Functions

void | release(const QString &path)
bool | tryLock(const QString &path)

## Static Public Members

QInstaller::FileGuard * | globalObject()

## Detailed Description

This class keeps a list of file paths that are locked from mutual access. Attempting to lock them from another thread will fail until the the locked path name is released.

## Member Function Documentation

### `[static]` QInstaller::FileGuard *FileGuard::globalObject()

Returns the application global instance.

### void FileGuard::release(const QString &path)

Unlocks path.

### bool FileGuard::tryLock(const QString &path)

Attempts to lock path. Returns `true` if the lock could be acquired, `false` if another thread has already locked the path.