diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index 6bfbe956b6..7c3c990dfe 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -927,30 +927,14 @@ const Path &GetExeDirectory() { return ExePath; } -IOFile::IOFile() {} -IOFile::IOFile(std::FILE* file) - : m_file(file) -{} - -IOFile::IOFile(const std::string &filename, const char openmode[]) { +IOFile::IOFile(const Path &filename, const char openmode[]) { Open(filename, openmode); } -IOFile::IOFile(const Path &filename, const char openmode[]) { - Open(filename.ToString(), openmode); -} - -IOFile::~IOFile() { - Close(); -} - -bool IOFile::Open(const std::string& filename, const char openmode[]) +IOFile::~IOFile() { Close(); - m_file = File::OpenCFile(Path(filename), openmode); - m_good = IsOpen(); - return m_good; } bool IOFile::Open(const Path& filename, const char openmode[]) diff --git a/Common/File/FileUtil.h b/Common/File/FileUtil.h index 0e7927e069..9086140fe7 100644 --- a/Common/File/FileUtil.h +++ b/Common/File/FileUtil.h @@ -113,8 +113,7 @@ const Path &GetExeDirectory(); // and make forgetting an fclose() harder class IOFile { public: - IOFile(); - IOFile(FILE* file); + IOFile() {} IOFile(const Path &filename, const char openmode[]); ~IOFile(); @@ -179,9 +178,6 @@ public: } private: - IOFile(const std::string &filename, const char openmode[]); - bool Open(const std::string &filename, const char openmode[]); - std::FILE *m_file = nullptr; bool m_good = true; };