#include <OW_File.hpp>
Public Types | |
typedef FileHandle File::* | safe_bool |
Public Member Functions | |
File () | |
Create a NULL File object. | |
File (const File &x) | |
Copy constructor. | |
~File () | |
File & | operator= (const File &x) |
Assignment operator. | |
void | swap (File &x) |
size_t | read (void *bfr, size_t numberOfBytes, off_t offset=-1L) const |
Read from the underlying file. | |
size_t | write (const void *bfr, size_t numberOfBytes, off_t offset=-1L) |
Write to the underlying file. | |
int | seek (off_t offset, int whence) const |
Seek to a given offset within the file. | |
off_t | tell () const |
void | rewind () const |
Position the file pointer to the beginning of the file. | |
int | close () |
Close the underlying file object. | |
int | flush () |
Flush any buffered data to the file. | |
int | getLock () |
Acquire a kernel lock on the file. | |
int | tryLock () |
Acquire a kernel lock on the file. | |
int | unlock () |
Release a lock on the file. | |
operator safe_bool () const | |
bool | operator! () const |
bool | operator== (const File &rhs) |
Equality operator. | |
File (FileHandle hdl) | |
Private Attributes | |
FileHandle | m_hdl |
Definition at line 50 of file OW_File.hpp.
|
Definition at line 190 of file OW_File.hpp. |
|
Create a NULL File object.
Definition at line 56 of file OW_File.hpp. |
|
Copy constructor.
Definition at line 129 of file OW_PosixFile.cpp. |
|
Definition at line 64 of file OW_File.hpp. References OW_NAMESPACE::FileSystem::close(). |
|
Definition at line 208 of file OW_File.hpp. |
|
Close the underlying file object.
Definition at line 142 of file OW_File.hpp. References OW_NAMESPACE::FileSystem::close(), m_hdl, and OW_INVALID_FILEHANDLE. Referenced by OW_NAMESPACE::HDB::checkFile(), OW_NAMESPACE::AssocDb::checkFile(), OW_NAMESPACE::ServerSocketImpl::close(), OW_NAMESPACE::HDB::close(), OW_NAMESPACE::HDB::createFile(), OW_NAMESPACE::AssocDb::createFile(), OW_NAMESPACE::TempFileEnumerationImplBase::readSize(), OW_NAMESPACE::AssocDbHandle::AssocDbHandleData::~AssocDbHandleData(), and OW_NAMESPACE::HDBHandle::HDBHandleData::~HDBHandleData(). |
|
Flush any buffered data to the file.
Definition at line 156 of file OW_File.hpp. References OW_NAMESPACE::FileSystem::flush(), and m_hdl. |
|
Acquire a kernel lock on the file. This call may block. The lock may be released by calling unlock(). The lock will also be released when the the file is closed or when locking application exits. This is only an advisory lock and will not prevent non-coordinated access to the file.
Definition at line 150 of file OW_PosixFile.cpp. References OW_NAMESPACE::doLock(), and m_hdl. |
|
Definition at line 194 of file OW_File.hpp. References m_hdl, m_hdl, and OW_INVALID_FILEHANDLE. |
|
Definition at line 196 of file OW_File.hpp. References m_hdl, and OW_INVALID_FILEHANDLE. |
|
Assignment operator.
Definition at line 73 of file OW_File.hpp. |
|
Equality operator.
Definition at line 203 of file OW_File.hpp. |
|
Read from the underlying file.
Definition at line 92 of file OW_File.hpp. References m_hdl, and OW_NAMESPACE::BinarySerialization::read(). Referenced by OW_NAMESPACE::HDB::checkFile(), OW_NAMESPACE::AssocDb::checkFile(), OW_NAMESPACE::dlSharedLibrary::isFakeLibrary(), OW_NAMESPACE::HDBNode::read(), OW_NAMESPACE::HDB::readBlock(), OW_NAMESPACE::readRecHeader(), OW_NAMESPACE::TempFileEnumerationImplBase::readSize(), and OW_NAMESPACE::HDBNode::removeBlock(). |
|
Position the file pointer to the beginning of the file.
Definition at line 134 of file OW_File.hpp. References m_hdl, and OW_NAMESPACE::FileSystem::rewind(). |
|
Seek to a given offset within the file.
Definition at line 119 of file OW_File.hpp. References m_hdl, and OW_NAMESPACE::FileSystem::seek(). Referenced by OW_NAMESPACE::TempFileEnumerationImplBase::readSize(). |
|
Definition at line 78 of file OW_File.hpp. References m_hdl, m_hdl, and OW_NAMESPACE::swap(). |
|
Definition at line 127 of file OW_File.hpp. References m_hdl, and OW_NAMESPACE::FileSystem::tell(). |
|
Acquire a kernel lock on the file. This call won't block. The lock may be released by calling unlock() The lock will also be released when the locking application exits. This is only an advisory lock and will not prevent non-coordinated access to the file.
Definition at line 156 of file OW_PosixFile.cpp. References OW_NAMESPACE::doLock(), and m_hdl. Referenced by OW_NAMESPACE::ServerSocketImpl::doListen(), OW_NAMESPACE::HDB::open(), and OW_NAMESPACE::PidFile::writePid(). |
|
Release a lock on the file. This call will not block.
Definition at line 162 of file OW_PosixFile.cpp. References OW_NAMESPACE::doLock(), and m_hdl. Referenced by OW_NAMESPACE::ServerSocketImpl::close(), and OW_NAMESPACE::HDB::close(). |
|
Write to the underlying file.
Definition at line 105 of file OW_File.hpp. References m_hdl, and OW_NAMESPACE::BinarySerialization::write(). Referenced by OW_NAMESPACE::AssocDb::addEntry(), OW_NAMESPACE::AssocDb::addToFreeList(), OW_NAMESPACE::LocalAuthenticationCommon::createFile(), OW_NAMESPACE::HDB::createFile(), OW_NAMESPACE::AssocDb::createFile(), OW_NAMESPACE::HDB::setOffsets(), OW_NAMESPACE::HDBNode::write(), OW_NAMESPACE::HDB::writeBlock(), and OW_NAMESPACE::writeRecHeader(). |
|
Definition at line 214 of file OW_File.hpp. Referenced by getLock(), operator safe_bool(), operator==(), swap(), tryLock(), and unlock(). |