Add TempFile::remove()
This commit is contained in:
parent
fcd239ac65
commit
525c29c65d
@ -25,13 +25,17 @@ TempFile::TempFile(bool create)
|
|||||||
TempFile::~TempFile() {
|
TempFile::~TempFile() {
|
||||||
try {
|
try {
|
||||||
if (exists()) {
|
if (exists()) {
|
||||||
bf::remove(_path);
|
remove();
|
||||||
}
|
}
|
||||||
} catch (const boost::filesystem::filesystem_error &e) {
|
} catch (const boost::filesystem::filesystem_error &e) {
|
||||||
LOG(ERR, "Could not delete tempfile.");
|
LOG(ERR, "Could not delete tempfile.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TempFile::remove() {
|
||||||
|
bf::remove(_path);
|
||||||
|
}
|
||||||
|
|
||||||
bool TempFile::exists() const {
|
bool TempFile::exists() const {
|
||||||
return bf::exists(_path);
|
return bf::exists(_path);
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,8 @@ public:
|
|||||||
const boost::filesystem::path &path() const;
|
const boost::filesystem::path &path() const;
|
||||||
//TODO Test exists()
|
//TODO Test exists()
|
||||||
bool exists() const;
|
bool exists() const;
|
||||||
|
//TODO Test remove()
|
||||||
|
void remove();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const boost::filesystem::path _path;
|
const boost::filesystem::path _path;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user