summaryrefslogtreecommitdiff
path: root/src/file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/file.cc')
-rw-r--r--src/file.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/file.cc b/src/file.cc
index 9ee91fe7..74db8396 100644
--- a/src/file.cc
+++ b/src/file.cc
@@ -58,6 +58,26 @@ File::File(boost::filesystem::path path, std::string mode)
}
+File::File(File&& other)
+ : _path(other._path)
+ , _file(other._file)
+{
+ other._file = nullptr;
+}
+
+
+File&
+File::operator=(File&& other)
+{
+ if (*this != other) {
+ close();
+ _file = other._file;
+ other._file = nullptr;
+ }
+ return *this;
+}
+
+
void
File::close()
{