Added TempFile::exists()

This commit is contained in:
Sebastian Messmer 2015-10-23 12:15:51 +02:00
parent ca5edb48db
commit 74cb9eaf2d
2 changed files with 6 additions and 1 deletions

View File

@ -19,11 +19,15 @@ TempFile::TempFile(bool create)
}
TempFile::~TempFile() {
if (bf::exists(_path)) {
if (exists()) {
bf::remove(_path);
}
}
bool TempFile::exists() const {
return bf::exists(_path);
}
const bf::path &TempFile::path() const {
return _path;
}

View File

@ -13,6 +13,7 @@ public:
explicit TempFile(bool create = true);
virtual ~TempFile();
const boost::filesystem::path &path() const;
bool exists() const;
private:
const boost::filesystem::path _path;