This commit is contained in:
@ -39,10 +39,9 @@ namespace repertory {
|
|||||||
encrypt_provider::encrypt_provider(app_config &config)
|
encrypt_provider::encrypt_provider(app_config &config)
|
||||||
: config_(config), encrypt_config_(config.get_encrypt_config()) {}
|
: config_(config), encrypt_config_(config.get_encrypt_config()) {}
|
||||||
|
|
||||||
auto encrypt_provider::create_api_file(const std::string &api_path,
|
auto encrypt_provider::create_api_file(
|
||||||
bool directory,
|
const std::string &api_path, bool directory,
|
||||||
const std::string &source_path)
|
const std::string &source_path) -> api_file {
|
||||||
-> api_file {
|
|
||||||
auto times{utils::file::get_times(source_path)};
|
auto times{utils::file::get_times(source_path)};
|
||||||
if (not times.has_value()) {
|
if (not times.has_value()) {
|
||||||
throw std::runtime_error("failed to get file times");
|
throw std::runtime_error("failed to get file times");
|
||||||
@ -151,9 +150,8 @@ auto encrypt_provider::do_fs_operation(
|
|||||||
return callback(cfg, source_path);
|
return callback(cfg, source_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto encrypt_provider::get_api_path_from_source(const std::string &source_path,
|
auto encrypt_provider::get_api_path_from_source(
|
||||||
std::string &api_path) const
|
const std::string &source_path, std::string &api_path) const -> api_error {
|
||||||
-> api_error {
|
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -193,9 +191,8 @@ auto encrypt_provider::get_directory_item_count(
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto encrypt_provider::get_directory_items(const std::string &api_path,
|
auto encrypt_provider::get_directory_items(
|
||||||
directory_item_list &list) const
|
const std::string &api_path, directory_item_list &list) const -> api_error {
|
||||||
-> api_error {
|
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
return do_fs_operation(
|
return do_fs_operation(
|
||||||
@ -328,9 +325,8 @@ auto encrypt_provider::get_file(const std::string &api_path,
|
|||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto encrypt_provider::get_file_list(api_file_list &list,
|
auto encrypt_provider::get_file_list(
|
||||||
std::string & /* marker */) const
|
api_file_list &list, std::string & /* marker */) const -> api_error {
|
||||||
-> api_error {
|
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
const auto &cfg{get_encrypt_config()};
|
const auto &cfg{get_encrypt_config()};
|
||||||
@ -353,9 +349,8 @@ auto encrypt_provider::get_file_list(api_file_list &list,
|
|||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto encrypt_provider::get_file_size(const std::string &api_path,
|
auto encrypt_provider::get_file_size(
|
||||||
std::uint64_t &file_size) const
|
const std::string &api_path, std::uint64_t &file_size) const -> api_error {
|
||||||
-> api_error {
|
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -376,10 +371,9 @@ auto encrypt_provider::get_file_size(const std::string &api_path,
|
|||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto encrypt_provider::get_filesystem_item(const std::string &api_path,
|
auto encrypt_provider::get_filesystem_item(
|
||||||
bool directory,
|
const std::string &api_path, bool directory,
|
||||||
filesystem_item &fsi) const
|
filesystem_item &fsi) const -> api_error {
|
||||||
-> api_error {
|
|
||||||
std::string source_path;
|
std::string source_path;
|
||||||
if (directory) {
|
if (directory) {
|
||||||
auto result{db_->get_directory_source_path(api_path, source_path)};
|
auto result{db_->get_directory_source_path(api_path, source_path)};
|
||||||
@ -430,10 +424,9 @@ auto encrypt_provider::get_filesystem_item_from_source_path(
|
|||||||
return get_filesystem_item(api_path, false, fsi);
|
return get_filesystem_item(api_path, false, fsi);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto encrypt_provider::get_filesystem_item_and_file(const std::string &api_path,
|
auto encrypt_provider::get_filesystem_item_and_file(
|
||||||
api_file &file,
|
const std::string &api_path, api_file &file,
|
||||||
filesystem_item &fsi) const
|
filesystem_item &fsi) const -> api_error {
|
||||||
-> api_error {
|
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -559,8 +552,8 @@ auto encrypt_provider::is_directory(const std::string &api_path,
|
|||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto encrypt_provider::is_file(const std::string &api_path, bool &exists) const
|
auto encrypt_provider::is_file(const std::string &api_path,
|
||||||
-> api_error {
|
bool &exists) const -> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user