|
|
| BasicUniqueFP ()=default |
| | Default constructor, initializes local class variables.
|
| |
|
| BasicUniqueFP (const BasicUniqueFP &)=delete |
| | A class that claims the unique property cannot be copied.
|
| |
|
| BasicUniqueFP (BasicUniqueFP &&other) noexcept |
| | Move constructor.
|
| |
| | BasicUniqueFP (const std::filesystem::path &path, const std::string_view &flags) |
| | Constructor that opens the file.
|
| |
| | BasicUniqueFP (FILE *fp) |
| | A constructor that takes over the management of an existing file pointer.
|
| |
|
| ~BasicUniqueFP () |
| | The destructor that closes the file pointer.
|
| |
|
BasicUniqueFP & | operator= (const BasicUniqueFP &)=delete |
| | A class that claims the unique property cannot be copied.
|
| |
|
BasicUniqueFP & | operator= (BasicUniqueFP &&other) noexcept |
| | Mover = operator.
|
| |
|
In-class declarations of functions that work with file pointers.
|
|
int | rawFd () const noexcept |
| | Get file descriptor of file pointer.
|
| |
|
FILE * | fp () noexcept |
| |
|
const FILE * | fp () const noexcept |
| |
|
std::string_view | flags () noexcept |
| | Get fopen() flags.
|
| |
|
std::string_view | flags () const noexcept |
| | Get fopen() flags.
|
| |
|
mode_t | mode () const noexcept |
| | Get file permissions (mode).
|
| |
|
std::filesystem::path | path () noexcept |
| | Get file path.
|
| |
|
std::filesystem::path | path () const noexcept |
| | Get file path.
|
| |
| BasicUniqueFP & | open (const std::filesystem::path &path, const std::string_view &flags) noexcept |
| | Open input file.
|
| |
|
bool | reOpen () |
| | Class-specific function that reopens the file.
|
| |
|
void | close () noexcept |
| |
|
int | putc (int c) noexcept |
| |
|
int | puts (const std::string &s) noexcept |
| |
|
template<typename... Args> |
| int | printf (std::format_string< Args... > fmt, Args &&...args) noexcept |
| |
|
size_t | write (const void *buf, size_t size, size_t nmemb) noexcept |
| |
|
int | getc () noexcept |
| |
|
char * | gets (char *str, int size) noexcept |
| |
|
size_t | read (void *buf, size_t size, size_t count) noexcept |
| |
|
template<typename... Args> |
| int | scanf (const char *fmt, Args &&...args) noexcept |
| |
|
int | seek (long offset, int whence) noexcept |
| |
|
long | tell () noexcept |
| |
|
void | rewind () noexcept |
| |
|
void | clearerr () noexcept |
| |
|
int | eof () noexcept |
| |
|
int | error () noexcept |
| |
|
int | flush () noexcept |
| |
|
Definitions of operators required for pointer-style behavior and usability.
|
|
bool | operator! () const noexcept |
| |
|
| operator bool () const noexcept |
| |
|
FILE * | operator() () noexcept |
| |
|
FILE * | operator() () const noexcept |
| |
|
bool | operator== (const FILE *fp) const noexcept |
| |
|
bool | operator!= (const FILE *fp) const noexcept |
| |
template<typename
Closer = Helper::Closer>
requires IsCloser<
Closer, FILE *>
class Helper::BasicUniqueFP< Closer >
A class that helps with easy file pointer management.
BasicUniqueFP()=default
Default constructor, initializes local class variables.
- Template Parameters
-
- See also
- Helper::IsCloser
-
Helper::IsCloserWithOperator
-
Helper::Closer