mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Add a namespace to OpenFStream
For consistency with the other functions in FileUtil.h.
This commit is contained in:
@ -162,8 +162,6 @@ std::string& GetExeDirectory();
|
||||
bool WriteStringToFile(const std::string& str, const std::string& filename);
|
||||
bool ReadFileToString(const std::string& filename, std::string& str);
|
||||
|
||||
} // namespace
|
||||
|
||||
// To deal with Windows being dumb at unicode:
|
||||
template <typename T>
|
||||
void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmode openmode)
|
||||
@ -174,3 +172,5 @@ void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmod
|
||||
fstream.open(filename.c_str(), openmode);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -401,7 +401,7 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data)
|
||||
|
||||
// Open file
|
||||
std::ifstream in;
|
||||
OpenFStream(in, filename, std::ios::in);
|
||||
File::OpenFStream(in, filename, std::ios::in);
|
||||
|
||||
if (in.fail())
|
||||
return false;
|
||||
@ -474,7 +474,7 @@ bool IniFile::Save(const std::string& filename)
|
||||
{
|
||||
std::ofstream out;
|
||||
std::string temp = File::GetTempFilenameForAtomicWrite(filename);
|
||||
OpenFStream(out, temp, std::ios::out);
|
||||
File::OpenFStream(out, temp, std::ios::out);
|
||||
|
||||
if (out.fail())
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
m_num_entries = 0;
|
||||
|
||||
// try opening for reading/writing
|
||||
OpenFStream(m_file, filename, ios_base::in | ios_base::out | ios_base::binary);
|
||||
File::OpenFStream(m_file, filename, ios_base::in | ios_base::out | ios_base::binary);
|
||||
|
||||
m_file.seekg(0, std::ios::end);
|
||||
std::fstream::pos_type end_pos = m_file.tellg();
|
||||
|
@ -170,7 +170,7 @@ LogContainer::LogContainer(const std::string& shortName, const std::string& full
|
||||
|
||||
FileLogListener::FileLogListener(const std::string& filename)
|
||||
{
|
||||
OpenFStream(m_logfile, filename, std::ios::app);
|
||||
File::OpenFStream(m_logfile, filename, std::ios::app);
|
||||
SetEnable(true);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user