diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2013-02-17 13:30:04 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2013-02-17 13:37:01 -0600 |
| commit | fa9aafeed8753b0fd8f039d3d740b97c1bfad4dd (patch) | |
| tree | 1c1220c4ab85b6a010115462f542086cf215543a /Source/Core/Common/Src/FileUtil.cpp | |
| parent | 0cdd4434b9ce7f6b34d32f79c5fe23eb61602b52 (diff) | |
Some cleanup of CWII_IPC_HLE_Device_FileIO:
The real file was never kept open for longer than a single operation so there was no point in dealing with it in DoState.
Saving the real path in the savestate was also probably a bad idea. Savestates should be a bit more portable now.
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/Src/FileUtil.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 8e1bec2809..d6ab33962a 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -42,6 +42,7 @@ #endif #include <fstream> +#include <algorithm> #include <sys/stat.h> #ifndef S_ISDIR @@ -774,6 +775,24 @@ IOFile::~IOFile() Close(); } +IOFile::IOFile(IOFile&& other) + : m_file(NULL), m_good(true) +{ + Swap(other); +} + +IOFile& IOFile::operator=(IOFile other) +{ + Swap(other); + return *this; +} + +void IOFile::Swap(IOFile& other) +{ + std::swap(m_file, other.m_file); + std::swap(m_good, other.m_good); +} + bool IOFile::Open(const std::string& filename, const char openmode[]) { Close(); |
