updated build system

This commit is contained in:
2024-08-23 09:34:41 -05:00
parent bc85e34310
commit 4eff7aae64
19 changed files with 198 additions and 226 deletions

View File

@ -21,6 +21,7 @@
*/
#include "utils/file.hpp"
#include "utils/common.hpp"
#include "utils/error.hpp"
#include "utils/unix.hpp"
#include "utils/windows.hpp"
@ -329,19 +330,21 @@ auto directory::remove() -> bool {
static_cast<const char *>(__FUNCTION__),
};
try {
return utils::retry_action([this]() -> bool {
try {
#if defined(_WIN32)
return (not exists() || ::RemoveDirectoryA(path_.c_str()));
return (not exists() || ::RemoveDirectoryA(path_.c_str()));
#else // !defined(_WIN32)
return not exists() || (rmdir(path_.c_str()) == 0);
return not exists() || (rmdir(path_.c_str()) == 0);
#endif // defined(_WIN32)
} catch (const std::exception &e) {
utils::error::handle_exception(function_name, e);
} catch (...) {
utils::error::handle_exception(function_name);
}
} catch (const std::exception &e) {
utils::error::handle_exception(function_name, e);
} catch (...) {
utils::error::handle_exception(function_name);
}
return false;
return false;
});
}
auto directory::remove_recursively() -> bool {