cheshirekow
v0.1.0
|
Used for locking access to configuration files. Provides a safe way to update configuration files. More...
#include <cpp_fontconfig/Atomic.h>
Public Member Functions | |
void | deleteNew () |
delete new file More... | |
void | destroy () |
destroy an FcAtomic object More... | |
bool | lock () |
lock a file More... | |
Char8_t * | newFile () |
return new temporary file name More... | |
AtomicDelegate * | operator-> () |
const AtomicDelegate * | operator-> () const |
Char8_t * | origFile () |
return original file name More... | |
bool | replaceOrig () |
replace original with new More... | |
void | unlock () |
unlock a file More... | |
Private Member Functions | |
AtomicDelegate (FcAtomic *ptr) | |
wrap constructor More... | |
AtomicDelegate (const AtomicDelegate &other) | |
not copy-constructable More... | |
AtomicDelegate & | operator= (const AtomicDelegate &other) |
not assignable More... | |
Private Attributes | |
FcAtomic * | m_ptr |
Friends | |
class | RefPtr< Atomic > |
Used for locking access to configuration files. Provides a safe way to update configuration files.
These functions provide a safe way to update configuration files, allowing ongoing reading of the old configuration file while locked for writing and ensuring that a consistent and complete version of the configuration file is always available.
|
inlineexplicitprivate |
|
private |
not copy-constructable
void fontconfig::AtomicDelegate::deleteNew | ( | ) |
delete new file
Deletes the new file. Used in error recovery to back out changes.
void fontconfig::AtomicDelegate::destroy | ( | ) |
destroy an FcAtomic object
Destroys atomic.
bool fontconfig::AtomicDelegate::lock | ( | ) |
lock a file
Attempts to lock the file referenced by atomic. Returns FcFalse if the file is already locked, else returns FcTrue and leaves the file locked.
Char8_t* fontconfig::AtomicDelegate::newFile | ( | ) |
return new temporary file name
Returns the filename for writing a new version of the file referenced by atomic.
|
inline |
|
inline |
|
private |
not assignable
Char8_t* fontconfig::AtomicDelegate::origFile | ( | ) |
return original file name
Returns the file referenced by atomic.
bool fontconfig::AtomicDelegate::replaceOrig | ( | ) |
replace original with new
Replaces the original file referenced by atomic with the new file. Returns FcFalse if the file cannot be replaced due to permission issues in the filesystem. Otherwise returns FcTrue.
void fontconfig::AtomicDelegate::unlock | ( | ) |
unlock a file
Unlocks the file.