utils: Fix file wrapper
This commit is contained in:
parent
3cd177bff2
commit
ea2d181741
@ -25,6 +25,9 @@ namespace hex {
|
|||||||
|
|
||||||
explicit File(const std::string &path, Mode mode);
|
explicit File(const std::string &path, Mode mode);
|
||||||
File();
|
File();
|
||||||
|
File(const File&) = delete;
|
||||||
|
File(File &&other) noexcept;
|
||||||
|
|
||||||
~File();
|
~File();
|
||||||
|
|
||||||
bool isValid() { return this->m_file != nullptr; }
|
bool isValid() { return this->m_file != nullptr; }
|
||||||
|
@ -17,6 +17,11 @@ namespace hex {
|
|||||||
this->m_file = nullptr;
|
this->m_file = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File::File(File &&other) noexcept {
|
||||||
|
this->m_file = other.m_file;
|
||||||
|
other.m_file = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
File::~File() {
|
File::~File() {
|
||||||
if (isValid())
|
if (isValid())
|
||||||
fclose(this->m_file);
|
fclose(this->m_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user