updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2024-08-30 14:08:39 -05:00
parent a22a92abc0
commit 561cfd937a
7 changed files with 89 additions and 33 deletions

View File

@@ -89,6 +89,19 @@ auto traverse_directory(
namespace repertory::utils::file {
auto directory::copy_to(std::string_view new_path,
bool overwrite) const -> bool {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
try {
throw std::runtime_error("failed to copy directory|" + path_ + '|' +
std::string{new_path} + "|not implemented");
} catch (const std::exception &e) {
utils::error::handle_exception(function_name, e);
} catch (...) {
utils::error::handle_exception(function_name);
}
return false;
}
@@ -177,8 +190,8 @@ auto directory::exists() const -> bool {
#if defined(_WIN32)
return ::PathIsDirectoryA(path_.c_str()) != 0;
#else // !defined(_WIN32)
struct stat st {};
return (stat(path_.c_str(), &st) == 0 && S_ISDIR(st.st_mode));
struct stat64 st {};
return (stat64(path_.c_str(), &st) == 0 && S_ISDIR(st.st_mode));
#endif // defined(_WIN32)
return false;
@@ -345,7 +358,22 @@ auto directory::is_symlink() const -> bool {
return false;
}
auto directory::move_to(std::string_view new_path) -> bool { return false; }
auto directory::move_to(std::string_view new_path) -> bool {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
try {
throw std::runtime_error("failed to move directory|" + path_ + '|' +
std::string{new_path} + "|not implemented");
} catch (const std::exception &e) {
utils::error::handle_exception(function_name, e);
} catch (...) {
utils::error::handle_exception(function_name);
}
return false;
}
auto directory::remove() -> bool {
static constexpr const std::string_view function_name{