refactor system stop

This commit is contained in:
2025-01-21 13:18:22 -06:00
parent fe2a1b96b2
commit daa8b9df24
47 changed files with 583 additions and 407 deletions

View File

@ -32,17 +32,19 @@ namespace repertory::utils::encryption {
class encrypting_reader final {
public:
encrypting_reader(std::string_view file_name, std::string_view source_path,
stop_type &stop_requested, std::string_view token,
stop_type_callback stop_requested_cb,
std::string_view token,
std::optional<std::string> relative_parent_path,
std::size_t error_return = 0U);
encrypting_reader(std::string_view encrypted_file_path,
std::string_view source_path, stop_type &stop_requested,
std::string_view source_path,
stop_type_callback stop_requested_cb,
std::string_view token, std::size_t error_return = 0U);
encrypting_reader(
std::string_view encrypted_file_path, std::string_view source_path,
stop_type &stop_requested, std::string_view token,
stop_type_callback stop_requested_cb, std::string_view token,
std::vector<std::array<unsigned char,
crypto_aead_xchacha20poly1305_IETF_NPUBBYTES>>
iv_list,
@ -62,7 +64,7 @@ public:
private:
utils::encryption::hash_256_t key_;
stop_type &stop_requested_;
stop_type_callback stop_requested_cb_;
size_t error_return_;
std::unique_ptr<utils::file::i_file> source_file_;
@ -126,7 +128,7 @@ public:
}
[[nodiscard]] auto get_stop_requested() const -> bool {
return stop_requested_;
return stop_requested_cb_();
}
[[nodiscard]] auto get_total_size() const -> std::uint64_t {