An OO wrapper for a UNIX file descriptor.
More...
#include <FileDescriptor.hxx>
An OO wrapper for a UNIX file descriptor.
This class is unmanaged and trivial.
Definition at line 49 of file FileDescriptor.hxx.
FileDescriptor::FileDescriptor |
( |
| ) |
|
|
default |
constexpr FileDescriptor::FileDescriptor |
( |
int |
_fd | ) |
|
|
inlineexplicit |
bool FileDescriptor::Close |
( |
| ) |
|
|
inlinenoexcept |
Close the file descriptor.
It is legal to call it on an "undefined" object. After this call, IsDefined() is guaranteed to return false, and this object may be reused.
Definition at line 136 of file FileDescriptor.hxx.
bool FileDescriptor::Duplicate |
( |
int |
new_fd | ) |
const |
|
inlinenoexcept |
Duplicate the file descriptor onto the given file descriptor.
Definition at line 114 of file FileDescriptor.hxx.
constexpr int FileDescriptor::Get |
( |
| ) |
const |
|
inline |
gcc_pure off_t FileDescriptor::GetSize |
( |
| ) |
const |
|
noexcept |
Returns the size of the file in bytes, or -1 on error.
constexpr bool FileDescriptor::IsDefined |
( |
| ) |
const |
|
inline |
bool FileDescriptor::Open |
( |
const char * |
pathname, |
|
|
int |
flags, |
|
|
mode_t |
mode = 0666 |
|
) |
| |
|
noexcept |
bool FileDescriptor::OpenNonBlocking |
( |
const char * |
pathname | ) |
|
|
noexcept |
bool FileDescriptor::OpenReadOnly |
( |
const char * |
pathname | ) |
|
|
noexcept |
constexpr bool FileDescriptor::operator== |
( |
FileDescriptor |
other | ) |
const |
|
inline |
int FileDescriptor::Poll |
( |
short |
events, |
|
|
int |
timeout |
|
) |
| const |
|
noexcept |
ssize_t FileDescriptor::Read |
( |
void * |
buffer, |
|
|
size_t |
length |
|
) |
| |
|
inlinenoexcept |
bool FileDescriptor::Rewind |
( |
| ) |
|
|
noexcept |
Rewind the pointer to the beginning of the file.
off_t FileDescriptor::Seek |
( |
off_t |
offset | ) |
|
|
inlinenoexcept |
void FileDescriptor::Set |
( |
int |
_fd | ) |
|
|
inlinenoexcept |
void FileDescriptor::SetBlocking |
( |
| ) |
|
|
noexcept |
Enable blocking mode on this file descriptor.
void FileDescriptor::SetNonBlocking |
( |
| ) |
|
|
noexcept |
Enable non-blocking mode on this file descriptor.
void FileDescriptor::SetUndefined |
( |
| ) |
|
|
inlinenoexcept |
off_t FileDescriptor::Skip |
( |
off_t |
offset | ) |
|
|
inlinenoexcept |
int FileDescriptor::Steal |
( |
| ) |
|
|
inlinenoexcept |
gcc_pure off_t FileDescriptor::Tell |
( |
| ) |
const |
|
inlinenoexcept |
int FileDescriptor::WaitReadable |
( |
int |
timeout | ) |
const |
|
noexcept |
int FileDescriptor::WaitWritable |
( |
int |
timeout | ) |
const |
|
noexcept |
ssize_t FileDescriptor::Write |
( |
const void * |
buffer, |
|
|
size_t |
length |
|
) |
| |
|
inlinenoexcept |
The documentation for this class was generated from the following file: