FileGuardLocker Class | Qt Installer Framework Manual

- Qt Installer Framework Manual
- FileGuardLocker

# FileGuardLocker Class

class QInstaller::FileGuardLocker

The `FileGuardLocker` class locks a file path and releases it on destruction. More...

Header: | #include <FileGuardLocker>

- List of all members, including inherited members

## Public Functions

| FileGuardLocker(const QString &path, QInstaller::FileGuard *guard)
| ~FileGuardLocker()

## Detailed Description

A convenience class for locking a file path using the resource acquisition is initialization (RAII) programming idiom.

## Member Function Documentation

### `[explicit]` FileGuardLocker::FileGuardLocker(const QString &path, QInstaller::FileGuard *guard)

Constructs the object and attempts to lock path with guard. If the lock is already held by another thread, this method will wait for it to become available.

### `[noexcept]` FileGuardLocker::~FileGuardLocker()

Destructs the object and unlocks the locked file path.