libept
|
File descriptor with a name. More...
#include <sys.h>
Public Member Functions | |
NamedFileDescriptor (int fd, const std::string &pathname) | |
NamedFileDescriptor (NamedFileDescriptor &&) | |
NamedFileDescriptor & | operator= (NamedFileDescriptor &&) |
virtual void | throw_error (const char *desc) |
Throw an exception based on errno and the given message. More... | |
const std::string & | name () const |
Return the file pathname. More... | |
![]() | |
FileDescriptor () | |
FileDescriptor (FileDescriptor &&o) | |
FileDescriptor (int fd) | |
virtual | ~FileDescriptor () |
void | close () |
void | fstat (struct stat &st) |
void | fchmod (mode_t mode) |
size_t | write (const void *buf, size_t count) |
void | write_all (const void *buf, size_t count) |
Write all the data in buf, retrying partial writes. More... | |
MMap | mmap (size_t length, int prot, int flags, off_t offset=0) |
operator int () const | |
Protected Attributes | |
std::string | pathname |
![]() | |
int | fd = -1 |
File descriptor with a name.
ept::sys::NamedFileDescriptor::NamedFileDescriptor | ( | int | fd, |
const std::string & | pathname | ||
) |
Referenced by ept::sys::Path::iterator::operator->().
ept::sys::NamedFileDescriptor::NamedFileDescriptor | ( | NamedFileDescriptor && | o | ) |
|
inline |
Return the file pathname.
Referenced by ept::sys::Path::rmtree(), ept::sys::which(), and ept::sys::write_file_atomically().
NamedFileDescriptor & ept::sys::NamedFileDescriptor::operator= | ( | NamedFileDescriptor && | o | ) |
References ept::sys::FileDescriptor::fd, and pathname.
|
virtual |
Throw an exception based on errno and the given message.
This can be overridden by subclasses that may have more information about the file descriptor, so that they can generate more descriptive messages.
Reimplemented from ept::sys::FileDescriptor.
References pathname.
Referenced by ept::sys::Path::fdopendir(), ept::sys::Path::fstatat(), ept::sys::Path::lstatat(), ept::sys::Path::openat(), ept::sys::Path::iterator::operator++(), ept::sys::Path::Path(), ept::sys::Path::rmdirat(), and ept::sys::Path::unlinkat().
|
protected |
Referenced by operator=(), and throw_error().