Delete a couple unused constructors of IOFile

This commit is contained in:
Henrik Rydgård committed 2021-06-07 00:24:51 +02:00
1 parent a2fa724d8e
commit 40fb114f60
2 files changed
+3 -23

No files matched your search

+2 -18
View File
@@ -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[])
+1 -5
View File
@@ -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;
};