X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Futil.h;h=579b1c231bf144874af2aa6fcc78b239e419dbe3;hb=854f2e5bbb7ffb9758b823af87034033033f3cb8;hp=2ae97814cf77726377a4f187c6e2e32d9c186435;hpb=1eeba876ce09cedfa4c779bf3554372c01dc34c5;p=dcpomatic.git diff --git a/src/lib/util.h b/src/lib/util.h index 2ae97814c..579b1c231 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -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