|
pstore2
|
A class which, on destruction, will delete a file whose name is passed to the constructor. More...
#include <file.hpp>

Public Types | |
| using | unlink_proc = std::function< void(std::string const &)> |
Public Member Functions | |
| deleter_base (deleter_base const &)=delete | |
| deleter_base (deleter_base &&) noexcept=delete | |
| deleter_base & | operator= (deleter_base const &)=delete |
| deleter_base & | operator= (deleter_base &&) noexcept=delete |
| void | unlink () |
| Explicitly deletes the file at the path given to the constructor. More... | |
| void | release () noexcept |
| Releases the file path given to the constructor so that it will not be deleted when the instance is destroyed. More... | |
Protected Member Functions | |
| deleter_base (std::string path, unlink_proc unlinker) | |
A class which, on destruction, will delete a file whose name is passed to the constructor.
The path can be "released" (so that it won't be deleted) by calling the release() method.
|
inlinenoexcept |
Releases the file path given to the constructor so that it will not be deleted when the instance is destroyed.
| void pstore::file::deleter_base::unlink | ( | ) |
Explicitly deletes the file at the path given to the constructor.
Calling this function will immediately delete the file at the path passed to the constructor unless the release() method has been called. If this function is called, the destructor will not attempt to delete the file a second time.
1.8.13