HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_AutoFileLock Class Reference

#include <UT_FileUtil.h>

Public Member Functions

 UT_AutoFileLock (UT_EmptyFileLock)
 Construct without lock. Use lock() with filename to acquire one. More...
 
 UT_AutoFileLock (const char *filename)
 Open and lock a file for exclusive reading and writing. More...
 
 UT_AutoFileLock (const char *filename, bool exclusive)
 
 ~UT_AutoFileLock ()
 
void lock (const char *filename, bool exclusive)
 
void unlock ()
 
FILE * getFile () const
 Get the file pointer for this locked file. More...
 
bool isLocked () const
 Return whether the file is actually locked. More...
 

Detailed Description

A class that allows you to create and lock a file for exclusive access. When instances of this class go out of scope, the locked file is automatically unlocked and closed.

Definition at line 206 of file UT_FileUtil.h.

Constructor & Destructor Documentation

UT_AutoFileLock::UT_AutoFileLock ( UT_EmptyFileLock  )
inlineexplicit

Construct without lock. Use lock() with filename to acquire one.

Definition at line 210 of file UT_FileUtil.h.

UT_AutoFileLock::UT_AutoFileLock ( const char *  filename)
inline

Open and lock a file for exclusive reading and writing.

Definition at line 215 of file UT_FileUtil.h.

UT_AutoFileLock::UT_AutoFileLock ( const char *  filename,
bool  exclusive 
)
inline

Open and lock a file for read-only (exclusive=false), or for read-write (exclusive=true). If filename does not exist, then it is opened as read-write.

Definition at line 223 of file UT_FileUtil.h.

UT_AutoFileLock::~UT_AutoFileLock ( )
inline

Definition at line 228 of file UT_FileUtil.h.

Member Function Documentation

FILE* UT_AutoFileLock::getFile ( ) const
inline

Get the file pointer for this locked file.

Definition at line 279 of file UT_FileUtil.h.

bool UT_AutoFileLock::isLocked ( ) const
inline

Return whether the file is actually locked.

Definition at line 285 of file UT_FileUtil.h.

void UT_AutoFileLock::lock ( const char *  filename,
bool  exclusive 
)
inline

Open and lock a file for read-only (exclusive=false), or for read-write (exclusive=true). If filename does not exist, then it is opened as read-write.

Definition at line 236 of file UT_FileUtil.h.

void UT_AutoFileLock::unlock ( )
inline

Definition at line 263 of file UT_FileUtil.h.


The documentation for this class was generated from the following file: