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

This commit is contained in:
Scott E. Graves 2024-10-19 15:58:51 -05:00
parent 8feb244dc9
commit cf6a370eea

View File

@ -121,6 +121,7 @@ auto get_free_drive_space(std::string_view path)
}); });
return li.QuadPart; return li.QuadPart;
}
#endif // defined(_WIN32) #endif // defined(_WIN32)
#if defined(__linux__) #if defined(__linux__)
@ -150,19 +151,17 @@ auto get_free_drive_space(std::string_view path)
return st.f_bfree * static_cast<std::uint64_t>(st.f_frsize); return st.f_bfree * static_cast<std::uint64_t>(st.f_frsize);
#endif // defined(__APPLE__) #endif // defined(__APPLE__)
} } catch (const std::exception &e) {
catch (const std::exception &e) {
utils::error::handle_exception(function_name, e); utils::error::handle_exception(function_name, e);
} } catch (...) {
catch (...) {
utils::error::handle_exception(function_name); utils::error::handle_exception(function_name);
} }
return std::nullopt; return std::nullopt;
} }
auto get_free_drive_space( auto get_free_drive_space(std::wstring_view path)
std::wstring_view path) -> std::optional<std::uint64_t> { -> std::optional<std::uint64_t> {
return get_free_drive_space(utils::string::to_utf8(path)); return get_free_drive_space(utils::string::to_utf8(path));
} }
@ -200,12 +199,10 @@ auto get_free_drive_space(std::string_view path)
if (res) { if (res) {
ret.accessed = ret.accessed =
utils::time::windows_file_time_to_unix_time(times.at(1U)); utils::time::windows_file_time_to_unix_time(times.at(1U));
ret.created = ret.created = utils::time::windows_file_time_to_unix_time(times.at(0U));
utils::time::windows_file_time_to_unix_time(times.at(0U));
ret.modified = ret.modified =
utils::time::windows_file_time_to_unix_time(times.at(2U)); utils::time::windows_file_time_to_unix_time(times.at(2U));
ret.written = ret.written = utils::time::windows_file_time_to_unix_time(times.at(2U));
utils::time::windows_file_time_to_unix_time(times.at(2U));
return ret; return ret;
} }
} }
@ -264,8 +261,8 @@ auto get_free_drive_space(std::string_view path)
return get_times(utils::string::to_utf8(path)); return get_times(utils::string::to_utf8(path));
} }
auto get_total_drive_space( auto get_total_drive_space(std::string_view path)
std::string_view path) -> std::optional<std::uint64_t> { -> std::optional<std::uint64_t> {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
try { try {
@ -320,13 +317,12 @@ auto get_free_drive_space(std::string_view path)
return std::nullopt; return std::nullopt;
} }
auto get_total_drive_space( auto get_total_drive_space(std::wstring_view path)
std::wstring_view path) -> std::optional<std::uint64_t> { -> std::optional<std::uint64_t> {
return get_total_drive_space(utils::string::to_utf8(path)); return get_total_drive_space(utils::string::to_utf8(path));
} }
auto i_fs_item::get_time(time_type type) auto i_fs_item::get_time(time_type type) const -> std::optional<std::uint64_t> {
const -> std::optional<std::uint64_t> {
return utils::file::get_time(get_path(), type); return utils::file::get_time(get_path(), type);
} }
@ -442,8 +438,7 @@ auto get_free_drive_space(std::string_view path)
data_buffer encrypted_data{}; data_buffer encrypted_data{};
utils::encryption::encrypt_data( utils::encryption::encrypt_data(
*password, *password, reinterpret_cast<const unsigned char *>(str_data.c_str()),
reinterpret_cast<const unsigned char *>(str_data.c_str()),
str_data.size(), encrypted_data); str_data.size(), encrypted_data);
return file->write(encrypted_data, 0U); return file->write(encrypted_data, 0U);
} }
@ -622,8 +617,7 @@ auto get_free_drive_space(std::string_view path)
}); });
} }
auto parts = auto parts = repertory::utils::string::split(smb_path.substr(2U), '/', false);
repertory::utils::string::split(smb_path.substr(2U), '/', false);
if (parts.size() > 2U) { if (parts.size() > 2U) {
parts.erase(std::prev(parts.end()), parts.end()); parts.erase(std::prev(parts.end()), parts.end());
} }
@ -651,8 +645,7 @@ auto get_free_drive_space(std::string_view path)
}); });
} }
auto parts = auto parts = repertory::utils::string::split(smb_path.substr(2U), '/', false);
repertory::utils::string::split(smb_path.substr(2U), '/', false);
if (parts.size() > 2U) { if (parts.size() > 2U) {
parts.erase(std::next(parts.begin(), 2U), parts.end()); parts.erase(std::next(parts.begin(), 2U), parts.end());
} }