56 File(
const char* path,
const char* mode) :
m_file(std::fopen(path, mode))
67 other.m_file =
nullptr;
74 other.m_file =
nullptr;
106 int result = std::fgetc(
m_file);
107 if (std::ferror(
m_file)) {
118 if (std::fputc(Value,
m_file) == EOF) {
131 bool result = (std::fclose(
m_file) == 0);
bool IsOpen() const
Checks if this file is still open.
A wrapper around the C FILE*-based IO API.
File(const char *path, const char *mode)
Opens the file at the given path.
int ReadChar()
Reads the next input character from this file.
void WriteChar(char Value)
Writes a single character to the file.
File & operator=(File &&other)
Moves the given file object's resources to this file object.
~File()
Performs clean-up for this File instance.
File(File &&other) noexcept
Creates a new file object from the file object's resources.
File & operator=(const File &)=delete
void Close()
Closes this file resource.
bool CloseImpl()
Closes this file resource.