From 40fb114f601bc3743e233d0ec56ab876fbde4b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 15 May 2021 23:14:28 +0200 Subject: [PATCH] Delete a couple unused constructors of IOFile --- Common/File/FileUtil.cpp | 20 ++------------------ Common/File/FileUtil.h | 6 +----- 2 files changed, 3 insertions(+), 23 deletions(-) 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; };