|
|
| BasicUniqueFD ()=default |
| | Default constructor, initializes local class variables.
|
| |
|
| BasicUniqueFD (const BasicUniqueFD &)=delete |
| | A class that claims the unique property cannot be copied.
|
| |
|
| BasicUniqueFD (BasicUniqueFD &&other) noexcept |
| | Move constructor.
|
| |
| | BasicUniqueFD (const std::filesystem::path &path, int flags) |
| | Constructor that opens the file.
|
| |
| | BasicUniqueFD (const std::filesystem::path &path, int flags, mode_t mode) |
| | Constructor that opens the file with mode.
|
| |
| | BasicUniqueFD (int fd) |
| | A constructor that takes over the management of an existing file descriptor.
|
| |
|
| ~BasicUniqueFD () |
| | The destructor that closes the file descriptor.
|
| |
|
BasicUniqueFD & | operator= (const BasicUniqueFD &)=delete |
| | A class that claims the unique property cannot be copied.
|
| |
|
BasicUniqueFD & | operator= (BasicUniqueFD &&other) noexcept |
| | Mover = operator.
|
| |
|
In-class declarations of functions that work with file descriptors.
|
|
int | fd () |
| | Get file descriptor.
|
| |
|
int | fd () const |
| | Get file descriptor.
|
| |
|
int | flags () |
| | Get open() flags.
|
| |
|
int | flags () const |
| | Get open() flags.
|
| |
|
std::optional< mode_t > | mode () |
| | It returns std::nullopt if no mode information is stored!
|
| |
|
std::optional< mode_t > | mode () const |
| | It returns std::nullopt if no mode information is stored!
|
| |
|
std::filesystem::path | path () |
| | Get file path.
|
| |
|
std::filesystem::path | path () const |
| | Get file path.
|
| |
| BasicUniqueFD & | open (bool withMode=false) |
| | Open.
|
| |
| BasicUniqueFD & | open (const std::filesystem::path &path, int flags) |
| | Open input file.
|
| |
| BasicUniqueFD & | open (const std::filesystem::path &path, int flags, mode_t mode) |
| | Open input file with mode.
|
| |
|
bool | reOpen (bool withMode=false) |
| | Class-specific function that reopens the file.
|
| |
|
void | close () noexcept |
| |
|
ssize_t | read (void *buf, size_t count) const |
| |
|
ssize_t | write (const void *buf, size_t count) |
| |
|
off_t | lseek (off_t offset, int whence) |
| |
|
int | fsync () |
| |
|
template<typename... Args> |
| int | fcntl (int op, Args... args) |
| |
|
template<typename... Args> |
| int | ioctl (unsigned long cmd, Args... args) |
| |
|
int | dup () |
| |
|
int | dup2 (int newfd) |
| |
|
Definitions of operators required for int-style behavior.
|
|
bool | operator! () const noexcept |
| |
|
| operator bool () const noexcept |
| |
|
int | operator() () noexcept |
| |
|
int | operator() () const noexcept |
| |
template<typename T >
requires std::is_integral_v<T> |
| bool | operator< (T fd) const noexcept |
| |
template<typename T >
requires std::is_integral_v<T> |
| bool | operator> (T fd) const noexcept |
| |
template<typename T >
requires std::is_integral_v<T> |
| bool | operator<= (T fd) const noexcept |
| |
template<typename T >
requires std::is_integral_v<T> |
| bool | operator>= (T fd) const noexcept |
| |
template<typename T >
requires std::is_integral_v<T> |
| bool | operator== (T fd) const noexcept |
| |
template<typename T >
requires std::is_integral_v<T> |
| bool | operator!= (T fd) const noexcept |
| |
template<typename
Closer = Helper::Closer>
requires IsCloser<
Closer, int>
class Helper::BasicUniqueFD< Closer >
A class that helps with easy file descriptor management.
BasicUniqueFD()=default
Default constructor, initializes local class variables.
- Template Parameters
-
- See also
- Helper::IsCloser
-
Helper::IsCloserWithOperator
-
Helper::Closer