refactor
This commit is contained in:
@ -78,18 +78,14 @@ auto encrypt_provider::create_api_file(
|
||||
}
|
||||
|
||||
api_file file{};
|
||||
file.accessed_date = times->get(utils::file::time_type::accessed);
|
||||
file.api_path = api_path;
|
||||
file.api_parent = utils::path::get_parent_api_path(api_path);
|
||||
file.file_size =
|
||||
directory
|
||||
? 0U
|
||||
: utils::encryption::encrypting_reader::calculate_encrypted_size(
|
||||
source_path);
|
||||
file.source_path = source_path;
|
||||
file.accessed_date = times->get(utils::file::time_type::accessed);
|
||||
file.changed_date = times->get(utils::file::time_type::modified);
|
||||
file.creation_date = times->get(utils::file::time_type::created);
|
||||
file.file_size = directory ? 0U : utils::encryption::encrypting_reader::calculate_encrypted_size( source_path);
|
||||
file.modified_date = times->get(utils::file::time_type::written);
|
||||
file.source_path = source_path;
|
||||
|
||||
return file;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ struct file_times final {
|
||||
return written;
|
||||
}
|
||||
|
||||
throw std::runtime_error("type_type not supported") :
|
||||
throw std::runtime_error("type_type not supported");
|
||||
}
|
||||
};
|
||||
|
||||
@ -71,11 +71,11 @@ file_exists_in_path(std::string_view path, std::string_view file_name) -> bool;
|
||||
file_exists_in_path(std::wstring_view path,
|
||||
std::wstring_view file_name) -> bool;
|
||||
|
||||
[[nodiscard]] auto get_time(std::string_view path, time_type type) const
|
||||
-> std::optional<std::uint64_t>;
|
||||
[[nodiscard]] auto get_time(std::string_view path,
|
||||
time_type type) -> std::optional<std::uint64_t>;
|
||||
|
||||
[[nodiscard]] auto get_time(std::wstring_view path, time_type type) const
|
||||
-> std::optional<std::uint64_t>;
|
||||
[[nodiscard]] auto get_time(std::wstring_view path,
|
||||
time_type type) -> std::optional<std::uint64_t>;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_times(std::string_view path) -> std::optional<file_times>;
|
||||
|
Reference in New Issue
Block a user