summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/FileUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp19
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();