Gobelijn API documentation
- generated for commit a0cbea7
|
A wrapper around the C FILE*-based IO API. More...
#include <file.h>
Public Member Functions | |
File ()=delete | |
File (const File &)=delete | |
File & | operator= (const File &)=delete |
File (const char *path, const char *mode) | |
Opens the file at the given path. More... | |
File (File &&other) noexcept | |
Creates a new file object from the file object's resources. More... | |
File & | operator= (File &&other) |
Moves the given file object's resources to this file object. More... | |
~File () | |
Performs clean-up for this File instance. More... | |
void | Close () |
Closes this file resource. More... | |
bool | IsOpen () const |
Checks if this file is still open. More... | |
int | ReadChar () |
Reads the next input character from this file. More... | |
void | WriteChar (char Value) |
Writes a single character to the file. More... | |
Private Member Functions | |
bool | CloseImpl () |
Closes this file resource. More... | |
Private Attributes | |
std::FILE * | m_file |
A wrapper around the C FILE*-based IO API.
Note: this is a header-only class.
|
delete |
|
delete |
|
inline |
|
inlinenoexcept |
|
inline |
Performs clean-up for this File instance.
Definition at line 79 of file file.h.
References CloseImpl().
|
inline |
Closes this file resource.
An exception is thrown if this file cannot be closed properly. Successfully closing a file more than once is a no-op.
Definition at line 89 of file file.h.
References CloseImpl().
Referenced by main().
|
inline |
Checks if this file is still open.
Definition at line 97 of file file.h.
References m_file.
Referenced by CloseImpl(), ReadChar(), and WriteChar().
|
inline |
Reads the next input character from this file.
'EOF' is returned when the end-of-file has been reached.
Definition at line 101 of file file.h.
References IsOpen(), and m_file.
Referenced by Raii::RandomReadFile::operator[](), and printFile().
|
inline |
|
inlineprivate |
Closes this file resource.
A boolean is returned that tells if this resource has been closed properly. Closing a file more than once is OK and will return 'true' every time.
Definition at line 126 of file file.h.
References IsOpen(), and m_file.
Referenced by Close(), and ~File().
|
private |
Definition at line 139 of file file.h.
Referenced by CloseImpl(), File(), IsOpen(), operator=(), ReadChar(), and WriteChar().