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

#include <UT_FileUtil.h>

Public Member Functions

 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 ()
 
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 179 of file UT_FileUtil.h.

Constructor & Destructor Documentation

UT_AutoFileLock::UT_AutoFileLock ( const char *  filename)
inline

Open and lock a file for exclusive reading and writing.

Definition at line 183 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 198 of file UT_FileUtil.h.

UT_AutoFileLock::~UT_AutoFileLock ( )
inline

Definition at line 219 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 231 of file UT_FileUtil.h.

bool UT_AutoFileLock::isLocked ( ) const
inline

Return whether the file is actually locked.

Definition at line 237 of file UT_FileUtil.h.


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