summaryrefslogtreecommitdiff
path: root/src/lib/scoped_temporary.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-04-16 22:20:54 +0200
committerCarl Hetherington <cth@carlh.net>2022-05-05 23:38:41 +0200
commit8a8c977c12fc65f1f50ea05099387e0fc8840e7d (patch)
tree2d2c8663652939d643779d1ab1c18a12813fcbd2 /src/lib/scoped_temporary.h
parentefe153ab23b54cdbf28c653f2ccb0f25ca6bd015 (diff)
Use dcp::File in DCP-o-matic (#2231).
Diffstat (limited to 'src/lib/scoped_temporary.h')
-rw-r--r--src/lib/scoped_temporary.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/scoped_temporary.h b/src/lib/scoped_temporary.h
index 75d9a272f..b78f60541 100644
--- a/src/lib/scoped_temporary.h
+++ b/src/lib/scoped_temporary.h
@@ -19,7 +19,9 @@
*/
+#include <dcp/file.h>
#include <boost/filesystem.hpp>
+#include <boost/optional.hpp>
#include <cstdio>
@@ -35,16 +37,15 @@ public:
ScopedTemporary (ScopedTemporary const&) = delete;
ScopedTemporary& operator= (ScopedTemporary const&) = delete;
- /** @return temporary filename */
- boost::filesystem::path file () const {
- return _file;
+ /** @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 = nullptr;
+ boost::filesystem::path _path;
+ boost::optional<dcp::File> _file;
};