libcryfs/tempfile/TempDir.cpp
2015-04-25 02:40:02 +02:00

21 lines
323 B
C++

#include "TempDir.h"
namespace bf = boost::filesystem;
namespace cpputils {
TempDir::TempDir()
: _path(bf::unique_path(bf::temp_directory_path() / "%%%%-%%%%-%%%%-%%%%")) {
bf::create_directory(_path);
}
TempDir::~TempDir() {
bf::remove_all(_path);
}
const bf::path &TempDir::path() const {
return _path;
}
}