summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-01 15:07:04 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-01 15:07:04 +0100
commit2d46203be73930a968806fa1af88369de51734ff (patch)
tree8c896f39ca2ef48c44dd3f069c043c89ce668bfd /src/lib/util.cc
parentc98c87afe29d9ef74bdced8a9c96d7752f3fe80f (diff)
Comments.
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index c23deb59e..45d5a757c 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -958,12 +958,16 @@ dependency_version_summary ()
return s.str ();
}
+/** Construct a ScopedTemporary. A temporary filename is decided but the file is not opened
+ * until ::open() is called.
+ */
ScopedTemporary::ScopedTemporary ()
: _open (0)
{
_file = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path ();
}
+/** Close and delete the temporary file */
ScopedTemporary::~ScopedTemporary ()
{
close ();
@@ -971,12 +975,16 @@ ScopedTemporary::~ScopedTemporary ()
boost::filesystem::remove (_file, ec);
}
+/** @return temporary filename */
char const *
ScopedTemporary::c_str () const
{
return _file.string().c_str ();
}
+/** Open the temporary file.
+ * @return File's FILE pointer.
+ */
FILE*
ScopedTemporary::open (char const * params)
{
@@ -984,6 +992,7 @@ ScopedTemporary::open (char const * params)
return _open;
}
+/** Close the file */
void
ScopedTemporary::close ()
{