Fix typo in log message.
[dcpomatic.git] / src / lib / scoped_temporary.h
index 986f565a0896a64e507eba34ba7bdbc1d8c94d14..b78f60541089fc6ed7833e69b8c05e965f0b4720 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
+#include <dcp/file.h>
 #include <boost/filesystem.hpp>
-#include <boost/noncopyable.hpp>
+#include <boost/optional.hpp>
 #include <cstdio>
 
+
 /** @class ScopedTemporary
  *  @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope.
  */
-class ScopedTemporary : public boost::noncopyable
+class ScopedTemporary
 {
 public:
        ScopedTemporary ();
        ~ScopedTemporary ();
 
-       /** @return temporary filename */
-       boost::filesystem::path file () const {
-               return _file;
+       ScopedTemporary (ScopedTemporary const&) = delete;
+       ScopedTemporary& operator= (ScopedTemporary const&) = delete;
+
+       /** @return temporary pathname */
+       boost::filesystem::path path () const {
+               return _path;
        }
 
        char const * c_str () const;
-       FILE* open (char const *);
-       void close ();
+       dcp::File& open (char const *);
 
 private:
-       boost::filesystem::path _file;
-       FILE* _open;
+       boost::filesystem::path _path;
+       boost::optional<dcp::File> _file;
 };