summaryrefslogtreecommitdiff
path: root/src/lib/util.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-04-01 22:51:54 +0100
committerCarl Hetherington <cth@carlh.net>2014-04-01 22:51:54 +0100
commit854f2e5bbb7ffb9758b823af87034033033f3cb8 (patch)
tree54e5fe000e5f961ca65e2c2aba81749d9601226d /src/lib/util.h
parent1eeba876ce09cedfa4c779bf3554372c01dc34c5 (diff)
parent931fa4ef2dbfb7c9f726c4dd41eea79621b49906 (diff)
Merge master.
Diffstat (limited to 'src/lib/util.h')
-rw-r--r--src/lib/util.h18
1 files changed, 18 insertions, 0 deletions
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