diff options
author | Max Kellermann <max@duempel.org> | 2015-03-03 20:09:34 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-03-03 21:41:10 +0100 |
commit | f04a3ec2017d63b8bb48e3d71c6502779a05321a (patch) | |
tree | 4386df4285355a05b6eb9269cb72481fd97be43b /src/fs/io/FileReader.hxx | |
parent | f402c5fe3c2f4631c0c28d99f9cb1da5f5dad43c (diff) | |
download | mpd-f04a3ec2017d63b8bb48e3d71c6502779a05321a.tar.gz mpd-f04a3ec2017d63b8bb48e3d71c6502779a05321a.tar.xz mpd-f04a3ec2017d63b8bb48e3d71c6502779a05321a.zip |
fs/io/FileReader: add move constructor
Diffstat (limited to 'src/fs/io/FileReader.hxx')
-rw-r--r-- | src/fs/io/FileReader.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fs/io/FileReader.hxx b/src/fs/io/FileReader.hxx index eb0646015..53651380f 100644 --- a/src/fs/io/FileReader.hxx +++ b/src/fs/io/FileReader.hxx @@ -49,6 +49,20 @@ class FileReader final : public Reader { public: FileReader(Path _path, Error &error); +#ifdef WIN32 + FileReader(FileReader &&other) + :path(std::move(other.path)), + handle(other.handle) { + other.handle = INVALID_HANDLE_VALUE; + } +#else + FileReader(FileReader &&other) + :path(std::move(other.path)), + fd(other.fd) { + other.fd.SetUndefined(); + } +#endif + ~FileReader() { if (IsDefined()) Close(); |