summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/FileUtil.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2013-02-18 18:49:20 +0100
committerdegasus <wickmarkus@web.de>2013-02-18 18:49:20 +0100
commita629dea4dc134ee7778a6c6b3481a6656802fedf (patch)
treee035073928c499714c1098d7e875da156cb80952 /Source/Core/Common/Src/FileUtil.cpp
parent4653adecf16d9aa0cf3003386999f3d46f3c38f4 (diff)
parentd0ea94a2aaa1909a4b53b158a4a8250ee7578ae4 (diff)
Merge branch 'master' into GLSL-master
Conflicts: CMakeLists.txt Source/Core/DolphinWX/Dolphin.vcxproj Source/Core/DolphinWX/Src/GLInterface/WX.cpp Source/Core/DolphinWX/Src/GLInterface/WX.h Source/Core/VideoCommon/Src/TextureCacheBase.cpp Source/Core/VideoCommon/Src/TextureCacheBase.h Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp Source/Plugins/Plugin_VideoDX11/Src/TextureCache.h Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp Source/Plugins/Plugin_VideoDX9/Src/TextureCache.h Source/Plugins/Plugin_VideoOGL/Src/Render.cpp Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp Source/Plugins/Plugin_VideoOGL/Src/TextureCache.h Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp damn mipmap_fixes ...
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
index d74c99b7a2..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
@@ -196,8 +197,9 @@ bool CreateFullPath(const std::string &fullPath)
// we're done, yay!
if (position == fullPath.npos)
return true;
-
- std::string subPath = fullPath.substr(0, position);
+
+ // Include the '/' so the first call is CreateDir("/") rather than CreateDir("")
+ std::string const subPath(fullPath.substr(0, position + 1));
if (!File::IsDirectory(subPath))
File::CreateDir(subPath);
@@ -773,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();