Merge master.
[dcpomatic.git] / src / lib / util.h
index 2ae97814cf77726377a4f187c6e2e32d9c186435..579b1c231bf144874af2aa6fcc78b239e419dbe3 100644 (file)
@@ -141,6 +141,24 @@ private:
        char* _old;
 };
 
+class ScopedTemporary
+{
+public:
+       ScopedTemporary ();
+       ~ScopedTemporary ();
+
+       boost::filesystem::path file () const {
+               return _file;
+       }
+       
+       char const * c_str () const;
+       FILE* open (char const *);
+       void close ();
+
+private:
+       boost::filesystem::path _file;
+       FILE* _open;
+};
 
 #endif