master
Avril 4 years ago
parent 3f568538bf
commit 550d211aa1
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -138,15 +138,22 @@ const unsigned char* get_data(int i)
template<typename Path> template<typename Path>
struct DirTree struct DirTree
{ {
bool clean=true;
const Path path; const Path path;
DirTree(const Path input): path(input) DirTree(const Path input) noexcept : path(input)
{ {
fs::create_directory(input); fs::create_directory(path);
} }
DirTree(DirTree&& other) noexcept : path(other.path)
{
other.clean=false;
}
DirTree(const DirTree& _) noexcept = delete;
~DirTree() ~DirTree()
{ {
fs::remove_all(path); if(clean)
fs::remove_all(path);
} }
const Path& operator &() const Path& operator &()

Loading…
Cancel
Save