#include <File.hpp>
Public Types | |
typedef FileHandle File::* | safe_bool |
enum | ELockType { E_READ_LOCK, E_WRITE_LOCK } |
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 (ELockType type=E_WRITE_LOCK) |
Acquire a kernel lock on the file. | |
int | tryLock (ELockType type=E_WRITE_LOCK) |
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 52 of file File.hpp.
|
|
|
|
|
Create a NULL File object.
|
|
Copy constructor.
Definition at line 133 of file PosixFile.cpp. |
|
Definition at line 72 of file File.hpp. References BLOCXX_NAMESPACE::FileSystem::close(). |
|
|
|
Close the underlying file object.
Definition at line 150 of file File.hpp. References BLOCXX_INVALID_FILEHANDLE, and BLOCXX_NAMESPACE::FileSystem::close(). Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::close(), and BLOCXX_NAMESPACE::TempFileEnumerationImplBase::readSize(). |
|
Flush any buffered data to the file.
Definition at line 164 of file File.hpp. References BLOCXX_NAMESPACE::FileSystem::flush(). |
|
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 154 of file PosixFile.cpp. References BLOCXX_NAMESPACE::doLock(), E_WRITE_LOCK, and m_hdl. |
|
Definition at line 205 of file File.hpp. References BLOCXX_INVALID_FILEHANDLE, and m_hdl. |
|
Definition at line 207 of file File.hpp. References BLOCXX_INVALID_FILEHANDLE. |
|
Assignment operator.
|
|
Equality operator.
Definition at line 214 of file File.hpp. References m_hdl. |
|
Read from the underlying file.
Definition at line 100 of file File.hpp. References BLOCXX_NAMESPACE::BinarySerialization::read(). Referenced by BLOCXX_NAMESPACE::dlSharedLibrary::isFakeLibrary(), and BLOCXX_NAMESPACE::TempFileEnumerationImplBase::readSize(). |
|
Position the file pointer to the beginning of the file.
Definition at line 142 of file File.hpp. References BLOCXX_NAMESPACE::FileSystem::rewind(). |
|
Seek to a given offset within the file.
Definition at line 127 of file File.hpp. References BLOCXX_NAMESPACE::FileSystem::seek(). Referenced by BLOCXX_NAMESPACE::TempFileEnumerationImplBase::readSize(). |
|
Definition at line 86 of file File.hpp. References m_hdl, and BLOCXX_NAMESPACE::swap(). |
|
Definition at line 135 of file File.hpp. References BLOCXX_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. lt is a exclusive lock.
Definition at line 161 of file PosixFile.cpp. References BLOCXX_NAMESPACE::doLock(), E_WRITE_LOCK, and m_hdl. Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::doListen(). |
|
Release a lock on the file. This call will not block.
Definition at line 168 of file PosixFile.cpp. References BLOCXX_NAMESPACE::doLock(), and m_hdl. Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::close(). |
|
Write to the underlying file.
Definition at line 113 of file File.hpp. References BLOCXX_NAMESPACE::BinarySerialization::write(). |
|
Definition at line 225 of file File.hpp. Referenced by getLock(), operator safe_bool(), operator==(), swap(), tryLock(), and unlock(). |