This commit is contained in:
@ -77,10 +77,10 @@ private:
|
||||
stop_type stop_requested_{false};
|
||||
|
||||
private:
|
||||
[[nodiscard]] auto adjust_cache_size(std::uint64_t file_size, bool shrink)
|
||||
-> api_error;
|
||||
[[nodiscard]] auto adjust_cache_size(std::uint64_t file_size,
|
||||
bool shrink) -> api_error;
|
||||
|
||||
[[nodiscard]] auto check_allocation() -> api_error;
|
||||
[[nodiscard]] auto check_start() -> api_error;
|
||||
|
||||
void download_chunk(std::size_t chunk, bool skip_active, bool should_reset);
|
||||
|
||||
@ -110,12 +110,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto native_operation(native_operation_callback callback)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
native_operation(native_operation_callback callback) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto native_operation(std::uint64_t new_file_size,
|
||||
native_operation_callback callback)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
native_operation(std::uint64_t new_file_size,
|
||||
native_operation_callback callback) -> api_error override;
|
||||
|
||||
void remove(std::uint64_t handle) override;
|
||||
|
||||
|
@ -63,7 +63,7 @@ private:
|
||||
stop_type stop_requested_{false};
|
||||
|
||||
private:
|
||||
[[nodiscard]] auto check_allocation() -> api_error;
|
||||
[[nodiscard]] auto check_start() -> api_error;
|
||||
|
||||
auto download_chunk(std::size_t chunk, bool skip_active) -> api_error;
|
||||
|
||||
|
@ -158,7 +158,7 @@ auto open_file::adjust_cache_size(std::uint64_t file_size,
|
||||
return set_api_error(res);
|
||||
}
|
||||
|
||||
auto open_file::check_allocation() -> api_error {
|
||||
auto open_file::check_start() -> api_error {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
|
||||
unique_recur_mutex_lock file_lock(file_mtx_);
|
||||
@ -410,7 +410,7 @@ auto open_file::native_operation(
|
||||
return set_api_error(api_error::download_stopped);
|
||||
}
|
||||
|
||||
auto res = check_allocation();
|
||||
auto res = check_start();
|
||||
if (res != api_error::success) {
|
||||
return res;
|
||||
}
|
||||
@ -432,7 +432,7 @@ auto open_file::native_operation(
|
||||
return set_api_error(api_error::download_stopped);
|
||||
}
|
||||
|
||||
auto res = check_allocation();
|
||||
auto res = check_start();
|
||||
if (res != api_error::success) {
|
||||
return res;
|
||||
}
|
||||
@ -548,7 +548,7 @@ auto open_file::read(std::size_t read_size, std::uint64_t read_offset,
|
||||
return api_error::success;
|
||||
}
|
||||
|
||||
auto res = check_allocation();
|
||||
auto res = check_start();
|
||||
if (res != api_error::success) {
|
||||
return res;
|
||||
}
|
||||
@ -711,7 +711,7 @@ auto open_file::write(std::uint64_t write_offset, const data_buffer &data,
|
||||
return set_api_error(api_error::download_stopped);
|
||||
}
|
||||
|
||||
auto res = check_allocation();
|
||||
auto res = check_start();
|
||||
if (res != api_error::success) {
|
||||
return res;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ auto ring_buffer_open_file::can_handle_file(std::uint64_t file_size,
|
||||
return file_size >= (static_cast<std::uint64_t>(ring_size) * chunk_size);
|
||||
}
|
||||
|
||||
auto ring_buffer_open_file::check_allocation() -> api_error {
|
||||
auto ring_buffer_open_file::check_start() -> api_error {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
|
||||
if (nf_) {
|
||||
@ -304,7 +304,7 @@ auto ring_buffer_open_file::read(std::size_t read_size,
|
||||
read_offset = read_offset - (begin_chunk * chunk_size_);
|
||||
|
||||
unique_mutex_lock read_lock(read_mtx_);
|
||||
auto res = check_allocation();
|
||||
auto res = check_start();
|
||||
if (res != api_error::success) {
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user