diff --git a/repertory/librepertory/include/app_config.hpp b/repertory/librepertory/include/app_config.hpp index a2838222..d320109d 100644 --- a/repertory/librepertory/include/app_config.hpp +++ b/repertory/librepertory/include/app_config.hpp @@ -57,7 +57,7 @@ public: static void set_stop_requested(); public: - app_config(provider_type prov, std::string_view data_directory = ""); + app_config(provider_type prov, std::string_view data_directory); app_config() = delete; app_config(app_config &&) = delete; @@ -73,7 +73,9 @@ private: utils::atomic api_password_; std::atomic api_port_; utils::atomic api_user_; + std::string cache_directory_; std::atomic config_changed_; + std::string data_directory_; std::atomic db_type_{database_type::rocksdb}; std::atomic download_timeout_secs_; std::atomic enable_download_timeout_; @@ -85,6 +87,7 @@ private: std::atomic eviction_delay_mins_; std::atomic eviction_uses_accessed_time_; std::atomic high_freq_interval_secs_; + std::string log_directory_; std::atomic low_freq_interval_secs_; std::atomic max_cache_size_bytes_; std::atomic max_upload_count_; @@ -96,11 +99,8 @@ private: std::atomic task_wait_ms_; private: - std::string cache_directory_; - std::string data_directory_; utils::atomic encrypt_config_; utils::atomic host_config_; - std::string log_directory_; mutable std::recursive_mutex read_write_mutex_; utils::atomic remote_config_; utils::atomic remote_mount_; @@ -108,8 +108,7 @@ private: utils::atomic sia_config_; std::unordered_map> value_get_lookup_; - std::unordered_map> + std::unordered_map> value_set_lookup_; std::uint64_t version_{REPERTORY_CONFIG_VERSION}; @@ -119,6 +118,8 @@ private: template auto set_value(dest &dst, const source &src) -> bool; + auto set_value(utils::atomic &dst, std::string_view src) -> bool; + public: [[nodiscard]] auto get_api_password() const -> std::string; @@ -188,21 +189,21 @@ public: [[nodiscard]] auto get_task_wait_ms() const -> std::uint16_t; - [[nodiscard]] auto get_value_by_name(const std::string &name) const + [[nodiscard]] auto get_value_by_name(std::string_view name) const -> std::string; - [[nodiscard]] auto get_raw_value_by_name(const std::string &name) const + [[nodiscard]] auto get_raw_value_by_name(std::string_view name) const -> std::string; [[nodiscard]] auto get_version() const -> std::uint64_t; void save(); - void set_api_password(const std::string &value); + void set_api_password(std::string_view value); void set_api_port(std::uint16_t value); - void set_api_user(const std::string &value); + void set_api_user(std::string_view value); void set_download_timeout_secs(std::uint8_t value); @@ -254,8 +255,8 @@ public: void set_task_wait_ms(std::uint16_t value); - [[nodiscard]] auto set_value_by_name(const std::string &name, - const std::string &value) -> std::string; + [[nodiscard]] auto set_value_by_name(std::string_view name, + std::string_view value) -> std::string; }; } // namespace repertory diff --git a/repertory/librepertory/include/comm/curl/curl_comm.hpp b/repertory/librepertory/include/comm/curl/curl_comm.hpp index cd9590c3..d809b1e3 100644 --- a/repertory/librepertory/include/comm/curl/curl_comm.hpp +++ b/repertory/librepertory/include/comm/curl/curl_comm.hpp @@ -62,14 +62,14 @@ public: public: [[nodiscard]] static auto construct_url(CURL *curl, - const std::string &relative_path, + std::string_view relative_path, const host_config &cfg) -> std::string; [[nodiscard]] static auto create_host_config(const s3_config &cfg) -> host_config; - [[nodiscard]] static auto url_encode(CURL *curl, const std::string &data, + [[nodiscard]] static auto url_encode(CURL *curl, std::string_view data, bool allow_slash) -> std::string; template @@ -97,14 +97,15 @@ public: request.decryption_token.value()); if (not utils::encryption::read_encrypted_range( request.range.value(), key, - [&](data_buffer &ct, std::uint64_t start_offset, + [&](data_buffer &buffer, std::uint64_t start_offset, std::uint64_t end_offset) -> bool { auto encrypted_request = request; encrypted_request.decryption_token = std::nullopt; encrypted_request.range = {{start_offset, end_offset}}; encrypted_request.response_handler = - [&ct](const auto &encrypted_data, long /*response_code*/) { - ct = encrypted_data; + [&buffer](const auto &encrypted_data, + long /*response_code*/) { + buffer = encrypted_data; }; encrypted_request.total_size = std::nullopt; diff --git a/repertory/librepertory/include/comm/packet/client_pool.hpp b/repertory/librepertory/include/comm/packet/client_pool.hpp index 9df0ab04..728a665f 100644 --- a/repertory/librepertory/include/comm/packet/client_pool.hpp +++ b/repertory/librepertory/include/comm/packet/client_pool.hpp @@ -97,11 +97,11 @@ private: static constexpr auto min_pool_size = 10U; public: - void execute(const std::string &client_id, std::uint64_t thread_id, + void execute(std::string_view client_id, std::uint64_t thread_id, const worker_callback &worker, const worker_complete_callback &worker_complete); - void remove_client(const std::string &client_id); + void remove_client(std::string_view client_id); void shutdown(); }; diff --git a/repertory/librepertory/include/comm/packet/common.hpp b/repertory/librepertory/include/comm/packet/common.hpp index edd29225..1cda016f 100644 --- a/repertory/librepertory/include/comm/packet/common.hpp +++ b/repertory/librepertory/include/comm/packet/common.hpp @@ -49,12 +49,11 @@ private: }; template -inline void run_with_deadline(boost::asio::io_context &io_ctx, - boost::asio::ip::tcp::socket &sock, - op_t operation, - std::chrono::milliseconds deadline, - const std::string &event_name, - const std::string &function_name); +inline void +run_with_deadline(boost::asio::io_context &io_ctx, + boost::asio::ip::tcp::socket &sock, op_t operation, + std::chrono::milliseconds deadline, + std::string_view event_name, std::string_view function_name); void apply_common_socket_properties(boost::asio::ip::tcp::socket &sock); @@ -78,12 +77,11 @@ void write_all_with_deadline(boost::asio::io_context &io_ctx, std::chrono::milliseconds deadline); template -inline void run_with_deadline(boost::asio::io_context &io_ctx, - boost::asio::ip::tcp::socket &sock, - op_t operation, - std::chrono::milliseconds deadline, - const std::string &event_name, - const std::string &function_name) { +inline void +run_with_deadline(boost::asio::io_context &io_ctx, + boost::asio::ip::tcp::socket &sock, op_t operation, + std::chrono::milliseconds deadline, + std::string_view event_name, std::string_view function_name) { deadline = std::max(deadline, std::chrono::milliseconds{250}); struct request_state final { @@ -118,12 +116,12 @@ inline void run_with_deadline(boost::asio::io_context &io_ctx, if (state->timed_out) { repertory::event_system::instance().raise( - std::string(event_name), std::string(function_name)); - throw std::runtime_error(event_name + " timed-out"); + event_name, function_name); + throw std::runtime_error(std::string{event_name} + " timed-out"); } if (state->err) { - throw std::runtime_error(event_name + " failed|err|" + + throw std::runtime_error(std::string{event_name} + " failed|err|" + state->err.message()); } } diff --git a/repertory/librepertory/include/comm/packet/packet_server.hpp b/repertory/librepertory/include/comm/packet/packet_server.hpp index cb33c4a1..cab3669d 100644 --- a/repertory/librepertory/include/comm/packet/packet_server.hpp +++ b/repertory/librepertory/include/comm/packet/packet_server.hpp @@ -32,10 +32,10 @@ using boost::asio::ip::tcp; namespace repertory { class packet_server final { public: - using closed_callback = std::function; + using closed_callback = std::function; using message_complete_callback = client_pool::worker_complete_callback; using message_handler_callback = std::function; public: @@ -78,7 +78,7 @@ private: std::unordered_map connection_lookup_; private: - void add_client(connection &conn, const std::string &client_id); + void add_client(connection &conn, std::string_view client_id); [[nodiscard]] auto handshake(std::shared_ptr conn) const -> bool; diff --git a/repertory/librepertory/include/db/i_file_db.hpp b/repertory/librepertory/include/db/i_file_db.hpp index c990ec65..ac31e731 100644 --- a/repertory/librepertory/include/db/i_file_db.hpp +++ b/repertory/librepertory/include/db/i_file_db.hpp @@ -68,43 +68,43 @@ public: std::function &)> callback, stop_type_callback stop_requested_cb) const = 0; - [[nodiscard]] virtual auto get_api_path(const std::string &source_path, + [[nodiscard]] virtual auto get_api_path(std::string_view source_path, std::string &api_path) const -> api_error = 0; [[nodiscard]] virtual auto - get_directory_api_path(const std::string &source_path, + get_directory_api_path(std::string_view source_path, std::string &api_path) const -> api_error = 0; - [[nodiscard]] virtual auto get_directory_data(const std::string &api_path, + [[nodiscard]] virtual auto get_directory_data(std::string_view api_path, directory_data &data) const -> api_error = 0; [[nodiscard]] virtual auto - get_directory_source_path(const std::string &api_path, + get_directory_source_path(std::string_view api_path, std::string &source_path) const -> api_error = 0; - [[nodiscard]] virtual auto get_file_api_path(const std::string &source_path, + [[nodiscard]] virtual auto get_file_api_path(std::string_view source_path, std::string &api_path) const -> api_error = 0; - [[nodiscard]] virtual auto get_file_data(const std::string &api_path, + [[nodiscard]] virtual auto get_file_data(std::string_view api_path, file_data &data) const -> api_error = 0; [[nodiscard]] virtual auto - get_file_source_path(const std::string &api_path, + get_file_source_path(std::string_view api_path, std::string &source_path) const -> api_error = 0; [[nodiscard]] virtual auto get_item_list(stop_type_callback stop_requested_cb) const -> std::vector = 0; - [[nodiscard]] virtual auto get_source_path(const std::string &api_path, + [[nodiscard]] virtual auto get_source_path(std::string_view api_path, std::string &source_path) const -> api_error = 0; - [[nodiscard]] virtual auto remove_item(const std::string &api_path) + [[nodiscard]] virtual auto remove_item(std::string_view api_path) -> api_error = 0; }; } // namespace repertory diff --git a/repertory/librepertory/include/db/i_file_mgr_db.hpp b/repertory/librepertory/include/db/i_file_mgr_db.hpp index 8d4627f1..e39bc8bc 100644 --- a/repertory/librepertory/include/db/i_file_mgr_db.hpp +++ b/repertory/librepertory/include/db/i_file_mgr_db.hpp @@ -59,23 +59,23 @@ public: [[nodiscard]] virtual auto get_resume_list() const -> std::vector = 0; - [[nodiscard]] virtual auto get_upload(const std::string &api_path) const + [[nodiscard]] virtual auto get_upload(std::string_view api_path) const -> std::optional = 0; [[nodiscard]] virtual auto get_upload_active_list() const -> std::vector = 0; - [[nodiscard]] virtual auto remove_resume(const std::string &api_path) + [[nodiscard]] virtual auto remove_resume(std::string_view api_path) -> bool = 0; - [[nodiscard]] virtual auto remove_upload(const std::string &api_path) + [[nodiscard]] virtual auto remove_upload(std::string_view api_path) -> bool = 0; - [[nodiscard]] virtual auto remove_upload_active(const std::string &api_path) + [[nodiscard]] virtual auto remove_upload_active(std::string_view api_path) -> bool = 0; - [[nodiscard]] virtual auto rename_resume(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] virtual auto rename_resume(std::string_view from_api_path, + std::string_view to_api_path) -> bool = 0; }; } // namespace repertory diff --git a/repertory/librepertory/include/db/i_meta_db.hpp b/repertory/librepertory/include/db/i_meta_db.hpp index a1a0d467..1344f7b1 100644 --- a/repertory/librepertory/include/db/i_meta_db.hpp +++ b/repertory/librepertory/include/db/i_meta_db.hpp @@ -35,19 +35,19 @@ public: std::function &)> callback, stop_type_callback stop_requested_cb) const = 0; - [[nodiscard]] virtual auto get_api_path(const std::string &source_path, + [[nodiscard]] virtual auto get_api_path(std::string_view source_path, std::string &api_path) const -> api_error = 0; [[nodiscard]] virtual auto get_api_path_list() const -> std::vector = 0; - [[nodiscard]] virtual auto get_item_meta(const std::string &api_path, + [[nodiscard]] virtual auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error = 0; - [[nodiscard]] virtual auto get_item_meta(const std::string &api_path, - const std::string &key, + [[nodiscard]] virtual auto get_item_meta(std::string_view api_path, + std::string_view key, std::string &value) const -> api_error = 0; @@ -58,22 +58,22 @@ public: [[nodiscard]] virtual auto get_total_size() const -> std::uint64_t = 0; - virtual void remove_api_path(const std::string &api_path) = 0; + virtual void remove_api_path(std::string_view api_path) = 0; - [[nodiscard]] virtual auto remove_item_meta(const std::string &api_path, - const std::string &key) + [[nodiscard]] virtual auto remove_item_meta(std::string_view api_path, + std::string_view key) -> api_error = 0; - [[nodiscard]] virtual auto rename_item_meta(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] virtual auto rename_item_meta(std::string_view from_api_path, + std::string_view to_api_path) -> api_error = 0; - [[nodiscard]] virtual auto set_item_meta(const std::string &api_path, - const std::string &key, - const std::string &value) + [[nodiscard]] virtual auto set_item_meta(std::string_view api_path, + std::string_view key, + std::string_view value) -> api_error = 0; - [[nodiscard]] virtual auto set_item_meta(const std::string &api_path, + [[nodiscard]] virtual auto set_item_meta(std::string_view api_path, const api_meta_map &meta) -> api_error = 0; }; diff --git a/repertory/librepertory/include/db/impl/rdb_file_db.hpp b/repertory/librepertory/include/db/impl/rdb_file_db.hpp index 68190482..c033c6b2 100644 --- a/repertory/librepertory/include/db/impl/rdb_file_db.hpp +++ b/repertory/librepertory/include/db/impl/rdb_file_db.hpp @@ -62,8 +62,8 @@ private: std::function action) -> api_error; - [[nodiscard]] auto remove_item(const std::string &api_path, - const std::string &source_path, + [[nodiscard]] auto remove_item(std::string_view api_path, + std::string_view source_path, rocksdb::Transaction *txn) -> rocksdb::Status; public: @@ -81,42 +81,42 @@ public: std::function &)> callback, stop_type_callback stop_requested_cb) const override; - [[nodiscard]] auto get_api_path(const std::string &source_path, + [[nodiscard]] auto get_api_path(std::string_view source_path, std::string &api_path) const -> api_error override; - [[nodiscard]] auto get_directory_api_path(const std::string &source_path, + [[nodiscard]] auto get_directory_api_path(std::string_view source_path, std::string &api_path) const -> api_error override; - [[nodiscard]] auto get_directory_data(const std::string &api_path, + [[nodiscard]] auto get_directory_data(std::string_view api_path, i_file_db::directory_data &data) const -> api_error override; - [[nodiscard]] auto get_directory_source_path(const std::string &api_path, + [[nodiscard]] auto get_directory_source_path(std::string_view api_path, std::string &source_path) const -> api_error override; - [[nodiscard]] auto get_file_api_path(const std::string &source_path, + [[nodiscard]] auto get_file_api_path(std::string_view source_path, std::string &api_path) const -> api_error override; - [[nodiscard]] auto get_file_data(const std::string &api_path, + [[nodiscard]] auto get_file_data(std::string_view api_path, i_file_db::file_data &data) const -> api_error override; - [[nodiscard]] auto get_file_source_path(const std::string &api_path, + [[nodiscard]] auto get_file_source_path(std::string_view api_path, std::string &source_path) const -> api_error override; [[nodiscard]] auto get_item_list(stop_type_callback stop_requested_cb) const -> std::vector override; - [[nodiscard]] auto get_source_path(const std::string &api_path, + [[nodiscard]] auto get_source_path(std::string_view api_path, std::string &source_path) const -> api_error override; - [[nodiscard]] auto remove_item(const std::string &api_path) + [[nodiscard]] auto remove_item(std::string_view api_path) -> api_error override; }; } // namespace repertory diff --git a/repertory/librepertory/include/db/impl/rdb_file_mgr_db.hpp b/repertory/librepertory/include/db/impl/rdb_file_mgr_db.hpp index 1e00f9c7..e57a6e0a 100644 --- a/repertory/librepertory/include/db/impl/rdb_file_mgr_db.hpp +++ b/repertory/librepertory/include/db/impl/rdb_file_mgr_db.hpp @@ -61,7 +61,7 @@ private: std::string_view function_name, std::function action) -> bool; - [[nodiscard]] auto remove_resume(const std::string &api_path, + [[nodiscard]] auto remove_resume(std::string_view api_path, rocksdb::Transaction *txn) -> rocksdb::Status; @@ -84,23 +84,21 @@ public: [[nodiscard]] auto get_resume_list() const -> std::vector override; - [[nodiscard]] auto get_upload(const std::string &api_path) const + [[nodiscard]] auto get_upload(std::string_view api_path) const -> std::optional override; [[nodiscard]] auto get_upload_active_list() const -> std::vector override; - [[nodiscard]] auto remove_resume(const std::string &api_path) + [[nodiscard]] auto remove_resume(std::string_view api_path) -> bool override; + + [[nodiscard]] auto remove_upload(std::string_view api_path) -> bool override; + + [[nodiscard]] auto remove_upload_active(std::string_view api_path) -> bool override; - [[nodiscard]] auto remove_upload(const std::string &api_path) - -> bool override; - - [[nodiscard]] auto remove_upload_active(const std::string &api_path) - -> bool override; - - [[nodiscard]] auto rename_resume(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] auto rename_resume(std::string_view from_api_path, + std::string_view to_api_path) -> bool override; }; diff --git a/repertory/librepertory/include/db/impl/rdb_meta_db.hpp b/repertory/librepertory/include/db/impl/rdb_meta_db.hpp index b235f779..bf78b282 100644 --- a/repertory/librepertory/include/db/impl/rdb_meta_db.hpp +++ b/repertory/librepertory/include/db/impl/rdb_meta_db.hpp @@ -54,7 +54,7 @@ private: void create_or_open(bool clear); - [[nodiscard]] auto get_item_meta_json(const std::string &api_path, + [[nodiscard]] auto get_item_meta_json(std::string_view api_path, json &json_data) const -> api_error; [[nodiscard]] static auto @@ -66,13 +66,12 @@ private: std::function action) -> api_error; - [[nodiscard]] auto remove_api_path(const std::string &api_path, - const std::string &source_path, + [[nodiscard]] auto remove_api_path(std::string_view api_path, + std::string_view source_path, rocksdb::Transaction *txn) -> rocksdb::Status; - [[nodiscard]] auto update_item_meta(const std::string &api_path, - json json_data, + [[nodiscard]] auto update_item_meta(std::string_view api_path, json json_data, rocksdb::Transaction *base_txn = nullptr, rocksdb::Status *status = nullptr) -> api_error; @@ -84,19 +83,19 @@ public: std::function &)> callback, stop_type_callback stop_requested_cb) const override; - [[nodiscard]] auto get_api_path(const std::string &source_path, + [[nodiscard]] auto get_api_path(std::string_view source_path, std::string &api_path) const -> api_error override; [[nodiscard]] auto get_api_path_list() const -> std::vector override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, + [[nodiscard]] auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, - const std::string &key, + [[nodiscard]] auto get_item_meta(std::string_view api_path, + std::string_view key, std::string &value) const -> api_error override; @@ -107,22 +106,21 @@ public: [[nodiscard]] auto get_total_size() const -> std::uint64_t override; - void remove_api_path(const std::string &api_path) override; + void remove_api_path(std::string_view api_path) override; - [[nodiscard]] auto remove_item_meta(const std::string &api_path, - const std::string &key) + [[nodiscard]] auto remove_item_meta(std::string_view api_path, + std::string_view key) -> api_error override; - [[nodiscard]] auto rename_item_meta(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] auto rename_item_meta(std::string_view from_api_path, + std::string_view to_api_path) -> api_error override; - [[nodiscard]] auto set_item_meta(const std::string &api_path, - const std::string &key, - const std::string &value) + [[nodiscard]] auto set_item_meta(std::string_view api_path, + std::string_view key, std::string_view value) -> api_error override; - [[nodiscard]] auto set_item_meta(const std::string &api_path, + [[nodiscard]] auto set_item_meta(std::string_view api_path, const api_meta_map &meta) -> api_error override; }; diff --git a/repertory/librepertory/include/db/impl/sqlite_file_db.hpp b/repertory/librepertory/include/db/impl/sqlite_file_db.hpp index 49f68cf3..6c1266ff 100644 --- a/repertory/librepertory/include/db/impl/sqlite_file_db.hpp +++ b/repertory/librepertory/include/db/impl/sqlite_file_db.hpp @@ -57,42 +57,42 @@ public: std::function &)> callback, stop_type_callback stop_requested_cb) const override; - [[nodiscard]] auto get_api_path(const std::string &source_path, + [[nodiscard]] auto get_api_path(std::string_view source_path, std::string &api_path) const -> api_error override; - [[nodiscard]] auto get_directory_api_path(const std::string &source_path, + [[nodiscard]] auto get_directory_api_path(std::string_view source_path, std::string &api_path) const -> api_error override; - [[nodiscard]] auto get_directory_data(const std::string &api_path, + [[nodiscard]] auto get_directory_data(std::string_view api_path, i_file_db::directory_data &data) const -> api_error override; - [[nodiscard]] auto get_directory_source_path(const std::string &api_path, + [[nodiscard]] auto get_directory_source_path(std::string_view api_path, std::string &source_path) const -> api_error override; - [[nodiscard]] auto get_file_api_path(const std::string &source_path, + [[nodiscard]] auto get_file_api_path(std::string_view source_path, std::string &api_path) const -> api_error override; - [[nodiscard]] auto get_file_data(const std::string &api_path, + [[nodiscard]] auto get_file_data(std::string_view api_path, i_file_db::file_data &data) const -> api_error override; - [[nodiscard]] auto get_file_source_path(const std::string &api_path, + [[nodiscard]] auto get_file_source_path(std::string_view api_path, std::string &source_path) const -> api_error override; [[nodiscard]] auto get_item_list(stop_type_callback stop_requested_cb) const -> std::vector override; - [[nodiscard]] auto get_source_path(const std::string &api_path, + [[nodiscard]] auto get_source_path(std::string_view api_path, std::string &source_path) const -> api_error override; - [[nodiscard]] auto remove_item(const std::string &api_path) + [[nodiscard]] auto remove_item(std::string_view api_path) -> api_error override; }; } // namespace repertory diff --git a/repertory/librepertory/include/db/impl/sqlite_file_mgr_db.hpp b/repertory/librepertory/include/db/impl/sqlite_file_mgr_db.hpp index acdb2a1d..b5081491 100644 --- a/repertory/librepertory/include/db/impl/sqlite_file_mgr_db.hpp +++ b/repertory/librepertory/include/db/impl/sqlite_file_mgr_db.hpp @@ -57,23 +57,21 @@ public: [[nodiscard]] auto get_resume_list() const -> std::vector override; - [[nodiscard]] auto get_upload(const std::string &api_path) const + [[nodiscard]] auto get_upload(std::string_view api_path) const -> std::optional override; [[nodiscard]] auto get_upload_active_list() const -> std::vector override; - [[nodiscard]] auto remove_resume(const std::string &api_path) + [[nodiscard]] auto remove_resume(std::string_view api_path) -> bool override; + + [[nodiscard]] auto remove_upload(std::string_view api_path) -> bool override; + + [[nodiscard]] auto remove_upload_active(std::string_view api_path) -> bool override; - [[nodiscard]] auto remove_upload(const std::string &api_path) - -> bool override; - - [[nodiscard]] auto remove_upload_active(const std::string &api_path) - -> bool override; - - [[nodiscard]] auto rename_resume(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] auto rename_resume(std::string_view from_api_path, + std::string_view to_api_path) -> bool override; }; diff --git a/repertory/librepertory/include/db/impl/sqlite_meta_db.hpp b/repertory/librepertory/include/db/impl/sqlite_meta_db.hpp index c1f7691d..f192e3b5 100644 --- a/repertory/librepertory/include/db/impl/sqlite_meta_db.hpp +++ b/repertory/librepertory/include/db/impl/sqlite_meta_db.hpp @@ -44,7 +44,7 @@ private: constexpr static const auto table_name = "meta"; private: - [[nodiscard]] auto update_item_meta(const std::string &api_path, + [[nodiscard]] auto update_item_meta(std::string_view api_path, api_meta_map meta) -> api_error; public: @@ -54,19 +54,19 @@ public: std::function &)> callback, stop_type_callback stop_requested_cb) const override; - [[nodiscard]] auto get_api_path(const std::string &source_path, + [[nodiscard]] auto get_api_path(std::string_view source_path, std::string &api_path) const -> api_error override; [[nodiscard]] auto get_api_path_list() const -> std::vector override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, + [[nodiscard]] auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, - const std::string &key, + [[nodiscard]] auto get_item_meta(std::string_view api_path, + std::string_view key, std::string &value) const -> api_error override; @@ -77,22 +77,21 @@ public: [[nodiscard]] auto get_total_size() const -> std::uint64_t override; - void remove_api_path(const std::string &api_path) override; + void remove_api_path(std::string_view api_path) override; - [[nodiscard]] auto remove_item_meta(const std::string &api_path, - const std::string &key) + [[nodiscard]] auto remove_item_meta(std::string_view api_path, + std::string_view key) -> api_error override; - [[nodiscard]] auto rename_item_meta(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] auto rename_item_meta(std::string_view from_api_path, + std::string_view to_api_path) -> api_error override; - [[nodiscard]] auto set_item_meta(const std::string &api_path, - const std::string &key, - const std::string &value) + [[nodiscard]] auto set_item_meta(std::string_view api_path, + std::string_view key, std::string_view value) -> api_error override; - [[nodiscard]] auto set_item_meta(const std::string &api_path, + [[nodiscard]] auto set_item_meta(std::string_view api_path, const api_meta_map &meta) -> api_error override; }; diff --git a/repertory/librepertory/include/drives/directory_cache.hpp b/repertory/librepertory/include/drives/directory_cache.hpp index 1278d5e1..b8abcf42 100644 --- a/repertory/librepertory/include/drives/directory_cache.hpp +++ b/repertory/librepertory/include/drives/directory_cache.hpp @@ -49,18 +49,18 @@ private: std::recursive_mutex directory_mutex_; public: - void execute_action(const std::string &api_path, + void execute_action(std::string_view api_path, const execute_callback &execute); [[nodiscard]] auto get_directory(std::uint64_t handle) -> std::shared_ptr; - auto remove_directory(const std::string &api_path) + auto remove_directory(std::string_view api_path) -> std::shared_ptr; void remove_directory(std::uint64_t handle); - void set_directory(const std::string &api_path, std::uint64_t handle, + void set_directory(std::string_view api_path, std::uint64_t handle, std::shared_ptr iterator); }; } // namespace repertory diff --git a/repertory/librepertory/include/drives/directory_iterator.hpp b/repertory/librepertory/include/drives/directory_iterator.hpp index d8a0874d..00aafedd 100644 --- a/repertory/librepertory/include/drives/directory_iterator.hpp +++ b/repertory/librepertory/include/drives/directory_iterator.hpp @@ -30,8 +30,8 @@ class directory_iterator final { public: #if !defined(_WIN32) using populate_stat_callback = - std::function; + std::function; #endif public: explicit directory_iterator(directory_item_list list) @@ -59,13 +59,13 @@ public: [[nodiscard]] auto get_directory_item(std::size_t offset, directory_item &di) -> api_error; - [[nodiscard]] auto get_directory_item(const std::string &api_path, + [[nodiscard]] auto get_directory_item(std::string_view api_path, directory_item &di) -> api_error; [[nodiscard]] auto get_json(std::size_t offset, json &item) -> int; - [[nodiscard]] auto - get_next_directory_offset(const std::string &api_path) const -> std::size_t; + [[nodiscard]] auto get_next_directory_offset(std::string_view api_path) const + -> std::size_t; public: auto operator=(const directory_iterator &iterator) noexcept diff --git a/repertory/librepertory/include/drives/eviction.hpp b/repertory/librepertory/include/drives/eviction.hpp index 0fc48b59..cb8250e7 100644 --- a/repertory/librepertory/include/drives/eviction.hpp +++ b/repertory/librepertory/include/drives/eviction.hpp @@ -46,7 +46,7 @@ private: i_provider &provider_; private: - [[nodiscard]] auto check_minimum_requirements(const std::string &file_path) + [[nodiscard]] auto check_minimum_requirements(std::string_view file_path) -> bool; [[nodiscard]] auto get_filtered_cached_files() -> std::deque; diff --git a/repertory/librepertory/include/drives/fuse/fuse_base.hpp b/repertory/librepertory/include/drives/fuse/fuse_base.hpp index 0ef7c20b..ca6e1a60 100644 --- a/repertory/librepertory/include/drives/fuse/fuse_base.hpp +++ b/repertory/librepertory/include/drives/fuse/fuse_base.hpp @@ -622,7 +622,7 @@ public: static void display_version_information(std::vector args); - auto unmount(const std::string &mount_location) -> int; + auto unmount(std::string_view mount_location) -> int; [[nodiscard]] auto get_mount_location() const -> std::string { return mount_location_; diff --git a/repertory/librepertory/include/drives/fuse/fuse_drive.hpp b/repertory/librepertory/include/drives/fuse/fuse_drive.hpp index 4c8b3e91..a2a83922 100644 --- a/repertory/librepertory/include/drives/fuse/fuse_drive.hpp +++ b/repertory/librepertory/include/drives/fuse/fuse_drive.hpp @@ -67,7 +67,7 @@ private: bool was_mounted_{false}; private: - void update_accessed_time(const std::string &api_path); + void update_accessed_time(std::string_view api_path); void stop_all(); @@ -293,21 +293,21 @@ protected: -> api_error override; public: - [[nodiscard]] auto get_directory_item_count(const std::string &api_path) const + [[nodiscard]] auto get_directory_item_count(std::string_view api_path) const -> std::uint64_t override; - [[nodiscard]] auto get_directory_items(const std::string &api_path) const + [[nodiscard]] auto get_directory_items(std::string_view api_path) const -> directory_item_list override; - [[nodiscard]] auto get_file_size(const std::string &api_path) const + [[nodiscard]] auto get_file_size(std::string_view api_path) const -> std::uint64_t override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, + [[nodiscard]] auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, - const std::string &name, + [[nodiscard]] auto get_item_meta(std::string_view api_path, + std::string_view name, std::string &value) const -> api_error override; @@ -324,21 +324,21 @@ public: void get_volume_info(UINT64 &total_size, UINT64 &free_size, std::string &volume_label) const override; - [[nodiscard]] auto is_processing(const std::string &api_path) const + [[nodiscard]] auto is_processing(std::string_view api_path) const -> bool override; - [[nodiscard]] auto rename_directory(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] auto rename_directory(std::string_view from_api_path, + std::string_view to_api_path) -> int override; - [[nodiscard]] auto rename_file(const std::string &from_api_path, - const std::string &to_api_path, bool overwrite) + [[nodiscard]] auto rename_file(std::string_view from_api_path, + std::string_view to_api_path, bool overwrite) -> int override; - void set_item_meta(const std::string &api_path, const std::string &key, - const std::string &value) override; + void set_item_meta(std::string_view api_path, std::string_view key, + std::string_view value) override; - void set_item_meta(const std::string &api_path, + void set_item_meta(std::string_view api_path, const api_meta_map &meta) override; }; } // namespace repertory diff --git a/repertory/librepertory/include/drives/fuse/fuse_drive_base.hpp b/repertory/librepertory/include/drives/fuse/fuse_drive_base.hpp index 9c4d8b60..01bbe4ee 100644 --- a/repertory/librepertory/include/drives/fuse/fuse_drive_base.hpp +++ b/repertory/librepertory/include/drives/fuse/fuse_drive_base.hpp @@ -47,11 +47,11 @@ protected: -> api_error override; protected: - [[nodiscard]] auto check_access(const std::string &api_path, int mask) const + [[nodiscard]] auto check_access(std::string_view api_path, int mask) const -> api_error; [[nodiscard]] auto - check_and_perform(const std::string &api_path, int parent_mask, + check_and_perform(std::string_view api_path, int parent_mask, const std::function &action) -> api_error; @@ -86,22 +86,21 @@ protected: -> mode_t; static void get_timespec_from_meta(const api_meta_map &meta, - const std::string &name, + std::string_view name, struct timespec &ts); [[nodiscard]] static auto get_uid_from_meta(const api_meta_map &meta) -> uid_t; #if defined(__APPLE__) - [[nodiscard]] auto parse_xattr_parameters(const char *name, - const uint32_t &position, - std::string &attribute_name, - const std::string &api_path) + [[nodiscard]] auto + parse_xattr_parameters(const char *name, const uint32_t &position, + std::string &attribute_name, std::string_view api_path) -> api_error; #else // !defined(__APPLE__) [[nodiscard]] auto parse_xattr_parameters(const char *name, std::string &attribute_name, - const std::string &api_path) + std::string_view api_path) -> api_error; #endif // defined(__APPLE__) @@ -109,29 +108,28 @@ protected: [[nodiscard]] auto parse_xattr_parameters(const char *name, const char *value, size_t size, const uint32_t &position, std::string &attribute_name, - const std::string &api_path) -> api_error; + std::string_view api_path) -> api_error; #else // !defined(__APPLE__) - [[nodiscard]] auto parse_xattr_parameters(const char *name, const char *value, - size_t size, - std::string &attribute_name, - const std::string &api_path) + [[nodiscard]] auto + parse_xattr_parameters(const char *name, const char *value, size_t size, + std::string &attribute_name, std::string_view api_path) -> api_error; #endif // defined(__APPLE__) - static void populate_stat(const std::string &api_path, + static void populate_stat(std::string_view api_path, std::uint64_t size_or_count, const api_meta_map &meta, bool directory, i_provider &provider, struct stat *u_stat); static void set_timespec_from_meta(const api_meta_map &meta, - const std::string &name, + std::string_view name, struct timespec &ts); public: - [[nodiscard]] auto check_owner(const std::string &api_path) const + [[nodiscard]] auto check_owner(std::string_view api_path) const -> api_error override; - [[nodiscard]] auto check_parent_access(const std::string &api_path, + [[nodiscard]] auto check_parent_access(std::string_view api_path, int mask) const -> api_error override; [[nodiscard]] static auto validate_timespec(const timespec &spec) -> bool; diff --git a/repertory/librepertory/include/drives/fuse/i_fuse_drive.hpp b/repertory/librepertory/include/drives/fuse/i_fuse_drive.hpp index d51143b7..106f29e0 100644 --- a/repertory/librepertory/include/drives/fuse/i_fuse_drive.hpp +++ b/repertory/librepertory/include/drives/fuse/i_fuse_drive.hpp @@ -32,30 +32,30 @@ class i_fuse_drive { INTERFACE_SETUP(i_fuse_drive); public: - [[nodiscard]] virtual auto check_owner(const std::string &api_path) const + [[nodiscard]] virtual auto check_owner(std::string_view api_path) const -> api_error = 0; - [[nodiscard]] virtual auto check_parent_access(const std::string &api_path, + [[nodiscard]] virtual auto check_parent_access(std::string_view api_path, int mask) const -> api_error = 0; [[nodiscard]] virtual auto - get_directory_item_count(const std::string &api_path) const + get_directory_item_count(std::string_view api_path) const -> std::uint64_t = 0; [[nodiscard]] virtual auto - get_directory_items(const std::string &api_path) const + get_directory_items(std::string_view api_path) const -> directory_item_list = 0; - [[nodiscard]] virtual auto get_file_size(const std::string &api_path) const + [[nodiscard]] virtual auto get_file_size(std::string_view api_path) const -> std::uint64_t = 0; - [[nodiscard]] virtual auto get_item_meta(const std::string &api_path, + [[nodiscard]] virtual auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error = 0; - [[nodiscard]] virtual auto get_item_meta(const std::string &api_path, - const std::string &name, + [[nodiscard]] virtual auto get_item_meta(std::string_view api_path, + std::string_view name, std::string &value) const -> api_error = 0; @@ -72,22 +72,21 @@ public: virtual void get_volume_info(UINT64 &total_size, UINT64 &free_size, std::string &volume_label) const = 0; - [[nodiscard]] virtual auto is_processing(const std::string &api_path) const + [[nodiscard]] virtual auto is_processing(std::string_view api_path) const -> bool = 0; - [[nodiscard]] virtual auto rename_directory(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] virtual auto rename_directory(std::string_view from_api_path, + std::string_view to_api_path) -> int = 0; - [[nodiscard]] virtual auto rename_file(const std::string &from_api_path, - const std::string &to_api_path, + [[nodiscard]] virtual auto rename_file(std::string_view from_api_path, + std::string_view to_api_path, bool overwrite) -> int = 0; - virtual void set_item_meta(const std::string &api_path, - const std::string &key, - const std::string &value) = 0; + virtual void set_item_meta(std::string_view api_path, std::string_view key, + std::string_view value) = 0; - virtual void set_item_meta(const std::string &api_path, + virtual void set_item_meta(std::string_view api_path, const api_meta_map &meta) = 0; }; } // namespace repertory diff --git a/repertory/librepertory/include/drives/fuse/remotefuse/remote_client.hpp b/repertory/librepertory/include/drives/fuse/remotefuse/remote_client.hpp index 4ce8e184..6f040940 100644 --- a/repertory/librepertory/include/drives/fuse/remotefuse/remote_client.hpp +++ b/repertory/librepertory/include/drives/fuse/remotefuse/remote_client.hpp @@ -198,17 +198,17 @@ public: remote::file_handle handle) -> packet::error_type override; - [[nodiscard]] auto json_create_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_create_directory_snapshot(std::string_view path, json &json_data) -> packet::error_type override; - [[nodiscard]] auto json_read_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_read_directory_snapshot(std::string_view path, remote::file_handle handle, std::uint32_t page, json &json_data) -> packet::error_type override; - [[nodiscard]] auto json_release_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_release_directory_snapshot(std::string_view path, remote::file_handle handle) -> packet::error_type override; diff --git a/repertory/librepertory/include/drives/fuse/remotefuse/remote_server.hpp b/repertory/librepertory/include/drives/fuse/remotefuse/remote_server.hpp index 048203bb..5ccb1c63 100644 --- a/repertory/librepertory/include/drives/fuse/remotefuse/remote_server.hpp +++ b/repertory/librepertory/include/drives/fuse/remotefuse/remote_server.hpp @@ -34,31 +34,31 @@ namespace remote_fuse { class remote_server final : public virtual remote_server_base { public: remote_server(app_config &config, i_fuse_drive &drive, - const std::string &mount_location); + std::string_view mount_location); private: directory_cache directory_cache_; std::atomic next_handle_{0U}; private: - [[nodiscard]] auto construct_path(std::string path) -> std::string; + [[nodiscard]] auto construct_path(std::string_view path) -> std::string; - [[nodiscard]] auto construct_path(const std::wstring &path) -> std::string; + [[nodiscard]] auto construct_path(std::wstring_view path) -> std::string; [[nodiscard]] static auto empty_as_zero(const json &data) -> std::string; [[nodiscard]] auto get_next_handle() -> std::uint64_t; - [[nodiscard]] auto populate_file_info(const std::string &api_path, + [[nodiscard]] auto populate_file_info(std::string_view api_path, remote::file_info &r_info) -> packet::error_type; - void populate_file_info(const std::string &api_path, UINT64 file_size, + void populate_file_info(std::string_view api_path, UINT64 file_size, UINT32 attributes, remote::file_info &r_info); static void populate_stat(const struct stat64 &u_stat, remote::stat &r_stat); - [[nodiscard]] auto update_to_windows_format(const std::string &root_api_path, + [[nodiscard]] auto update_to_windows_format(std::string_view root_api_path, json &item) -> json &; public: @@ -228,17 +228,17 @@ public: return static_cast(STATUS_INVALID_HANDLE); } - [[nodiscard]] auto json_create_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_create_directory_snapshot(std::string_view path, json &json_data) -> packet::error_type override; - [[nodiscard]] auto json_read_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_read_directory_snapshot(std::string_view path, remote::file_handle handle, std::uint32_t page, json &json_data) -> packet::error_type override; - [[nodiscard]] auto json_release_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_release_directory_snapshot(std::string_view path, remote::file_handle handle) -> packet::error_type override; @@ -277,7 +277,7 @@ public: std::string &volume_label) -> packet::error_type override; - [[nodiscard]] auto winfsp_mounted(const std::wstring &location) + [[nodiscard]] auto winfsp_mounted(std::wstring_view location) -> packet::error_type override; [[nodiscard]] auto winfsp_open(PWSTR file_name, UINT32 create_options, @@ -315,7 +315,7 @@ public: remote::file_info *r_info) -> packet::error_type override; - [[nodiscard]] auto winfsp_unmounted(const std::wstring &location) + [[nodiscard]] auto winfsp_unmounted(std::wstring_view location) -> packet::error_type override; [[nodiscard]] auto diff --git a/repertory/librepertory/include/drives/remote/i_remote_json.hpp b/repertory/librepertory/include/drives/remote/i_remote_json.hpp index 48265c13..571e1b46 100644 --- a/repertory/librepertory/include/drives/remote/i_remote_json.hpp +++ b/repertory/librepertory/include/drives/remote/i_remote_json.hpp @@ -30,16 +30,18 @@ class i_remote_json { public: [[nodiscard]] virtual auto - json_create_directory_snapshot(const std::string &path, - json &json_data) -> packet::error_type = 0; + json_create_directory_snapshot(std::string_view path, json &json_data) + -> packet::error_type = 0; - [[nodiscard]] virtual auto json_read_directory_snapshot( - const std::string &path, remote::file_handle handle, - std::uint32_t page, json &json_data) -> packet::error_type = 0; + [[nodiscard]] virtual auto + json_read_directory_snapshot(std::string_view path, + remote::file_handle handle, std::uint32_t page, + json &json_data) -> packet::error_type = 0; - [[nodiscard]] virtual auto json_release_directory_snapshot( - const std::string &path, - remote::file_handle handle) -> packet::error_type = 0; + [[nodiscard]] virtual auto + json_release_directory_snapshot(std::string_view path, + remote::file_handle handle) + -> packet::error_type = 0; }; } // namespace repertory diff --git a/repertory/librepertory/include/drives/remote/remote_open_file_table.hpp b/repertory/librepertory/include/drives/remote/remote_open_file_table.hpp index 826cde0c..0c37b17e 100644 --- a/repertory/librepertory/include/drives/remote/remote_open_file_table.hpp +++ b/repertory/librepertory/include/drives/remote/remote_open_file_table.hpp @@ -62,9 +62,9 @@ private: mutable std::recursive_mutex file_mutex_; protected: - void add_directory(const std::string &client_id, std::uint64_t handle); + void add_directory(std::string_view client_id, std::uint64_t handle); - void close_all(const std::string &client_id); + void close_all(std::string_view client_id); #if defined(_WIN32) [[nodiscard]] auto get_directory_buffer(const native_handle &handle, @@ -77,7 +77,7 @@ protected: [[nodiscard]] auto get_open_info(const native_handle &handle, open_info &oi) -> bool; - [[nodiscard]] auto has_open_directory(const std::string &client_id, + [[nodiscard]] auto has_open_directory(std::string_view client_id, std::uint64_t handle) -> bool; [[nodiscard]] auto has_compat_open_info(remote::file_handle handle, @@ -91,29 +91,29 @@ protected: return handle_lookup_.contains(handle) ? 0 : error_return; } - void remove_all(const std::string &file_path); + void remove_all(std::string_view file_path); void remove_and_close_all(const native_handle &handle); void remove_compat_open_info(remote::file_handle handle); - auto remove_directory(const std::string &client_id, std::uint64_t handle) + auto remove_directory(std::string_view client_id, std::uint64_t handle) -> bool; void remove_open_info(const native_handle &handle); - void set_client_id(const native_handle &handle, const std::string &client_id); + void set_client_id(const native_handle &handle, std::string_view client_id); void set_compat_client_id(remote::file_handle handle, - const std::string &client_id); + std::string_view client_id); void set_compat_open_info(remote::file_handle handle, - const std::string &file_path); + std::string_view file_path); void set_open_info(const native_handle &handle, open_info op_info); public: - [[nodiscard]] auto get_open_file_count(const std::string &file_path) const + [[nodiscard]] auto get_open_file_count(std::string_view file_path) const -> std::size_t; }; } // namespace repertory diff --git a/repertory/librepertory/include/drives/remote/remote_server_base.hpp b/repertory/librepertory/include/drives/remote/remote_server_base.hpp index 4ec6c076..2b77933e 100644 --- a/repertory/librepertory/include/drives/remote/remote_server_base.hpp +++ b/repertory/librepertory/include/drives/remote/remote_server_base.hpp @@ -46,7 +46,7 @@ class remote_server_base : public remote_open_file_table, public virtual remote_fuse::i_remote_instance { public: using handler_callback = std::function; public: @@ -56,10 +56,11 @@ public: auto operator=(remote_server_base &&) -> remote_server_base & = delete; public: - remote_server_base(app_config &config, drive &drv, std::string mount_location) + remote_server_base(app_config &config, drive &drv, + std::string_view mount_location) : config_(config), drive_(drv), - mount_location_(std::move(mount_location)), + mount_location_(std::string(mount_location)), client_pool_(config.get_remote_mount().client_pool_size) { REPERTORY_USES_FUNCTION_NAME(); @@ -102,461 +103,463 @@ private: std::unique_ptr packet_server_; private: - const std::unordered_map handler_lookup_ = { + const std::unordered_map handler_lookup_ = { - "::check", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, - auto && /* request */, - auto && /* response */) -> auto { return 0; }, - }, - { - "::fuse_access", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_access(request); + { + "::check", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto && /* request */, + auto && /* response */) -> auto { return 0; }, }, - }, - { - "::fuse_chflags", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_chflags(request); + { + "::fuse_access", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_access(request); + }, }, - }, - { - "::fuse_chmod", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_chmod(request); + { + "::fuse_chflags", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_chflags(request); + }, }, - }, - { - "::fuse_chown", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_chown(request); + { + "::fuse_chmod", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_chmod(request); + }, }, - }, - { - "::fuse_create", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_create(client_id, request, response); + { + "::fuse_chown", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_chown(request); + }, }, - }, - { - "::fuse_destroy", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, - auto && /* request */, auto && /* response */) -> auto { - return this->handle_fuse_destroy(); + { + "::fuse_create", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_create(client_id, request, response); + }, }, - }, - { - "::fuse_fgetattr", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_fgetattr(request, response); + { + "::fuse_destroy", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto && /* request */, auto && /* response */) -> auto { + return this->handle_fuse_destroy(); + }, }, - }, - { - "::fuse_fsetattr_x", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_fsetattr_x(request); + { + "::fuse_fgetattr", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_fgetattr(request, response); + }, }, - }, - { - "::fuse_fsync", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_fsync(request); + { + "::fuse_fsetattr_x", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_fsetattr_x(request); + }, }, - }, - { - "::fuse_ftruncate", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_ftruncate(request); + { + "::fuse_fsync", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_fsync(request); + }, }, - }, - { - "::fuse_getattr", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_getattr(request, response); + { + "::fuse_ftruncate", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_ftruncate(request); + }, }, - }, - { - "::fuse_getxtimes", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_getxtimes(request, response); + { + "::fuse_getattr", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_getattr(request, response); + }, }, - }, - { - "::fuse_init", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, - auto && /* request */, auto && /* response */) -> auto { - return this->handle_fuse_init(); + { + "::fuse_getxtimes", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_getxtimes(request, response); + }, }, - }, - { - "::fuse_mkdir", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_mkdir(request); + { + "::fuse_init", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto && /* request */, auto && /* response */) -> auto { + return this->handle_fuse_init(); + }, }, - }, - { - "::fuse_open", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_open(client_id, request, response); + { + "::fuse_mkdir", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_mkdir(request); + }, }, - }, - { - "::fuse_opendir", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_opendir(client_id, request, response); + { + "::fuse_open", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_open(client_id, request, response); + }, }, - }, - { - "::fuse_read", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_read(request, response); + { + "::fuse_opendir", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_opendir(client_id, request, response); + }, }, - }, - { - "::fuse_readdir", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_readdir(client_id, request, response); + { + "::fuse_read", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_read(request, response); + }, }, - }, - { - "::fuse_release", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_release(request); + { + "::fuse_readdir", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_readdir(client_id, request, response); + }, }, - }, - { - "::fuse_releasedir", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_releasedir(client_id, request); + { + "::fuse_release", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_release(request); + }, }, - }, - { - "::fuse_rename", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_rename(request); + { + "::fuse_releasedir", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_releasedir(client_id, request); + }, }, - }, - { - "::fuse_rmdir", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_rmdir(request); + { + "::fuse_rename", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_rename(request); + }, }, - }, - { - "::fuse_setattr_x", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_setattr_x(request); + { + "::fuse_rmdir", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_rmdir(request); + }, }, - }, - { - "::fuse_setbkuptime", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_setbkuptime(request); + { + "::fuse_setattr_x", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_setattr_x(request); + }, }, - }, - { - "::fuse_setchgtime", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_setchgtime(request); + { + "::fuse_setbkuptime", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_setbkuptime(request); + }, }, - }, - { - "::fuse_setcrtime", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_setcrtime(request); + { + "::fuse_setchgtime", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_setchgtime(request); + }, }, - }, - { - "::fuse_setvolname", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_setvolname(request); + { + "::fuse_setcrtime", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_setcrtime(request); + }, }, - }, - { - "::fuse_statfs", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_statfs(request, response); + { + "::fuse_setvolname", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_setvolname(request); + }, }, - }, - { - "::fuse_statfs_x", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_fuse_statfs_x(request, response); + { + "::fuse_statfs", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_statfs(request, response); + }, }, - }, - { - "::fuse_truncate", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_truncate(request); + { + "::fuse_statfs_x", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_fuse_statfs_x(request, response); + }, }, - }, - { - "::fuse_unlink", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_unlink(request); + { + "::fuse_truncate", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_truncate(request); + }, }, - }, - { - "::fuse_utimens", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_utimens(request); + { + "::fuse_unlink", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_unlink(request); + }, }, - }, - { - "::fuse_write", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_write(request); + { + "::fuse_utimens", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_utimens(request); + }, }, - }, - { - "::fuse_write_base64", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_fuse_write_base64(request); + { + "::fuse_write", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_write(request); + }, }, - }, - { - "::json_create_directory_snapshot", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_json_create_directory_snapshot( - client_id, request, response); + { + "::fuse_write_base64", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_fuse_write_base64(request); + }, }, - }, - { - "::json_read_directory_snapshot", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_json_read_directory_snapshot(client_id, request, - response); + { + "::json_create_directory_snapshot", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_json_create_directory_snapshot( + client_id, request, response); + }, }, - }, - { - "::json_release_directory_snapshot", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_json_release_directory_snapshot(client_id, - request); + { + "::json_read_directory_snapshot", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_json_read_directory_snapshot( + client_id, request, response); + }, }, - }, - { - "::winfsp_can_delete", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_winfsp_can_delete(request); + { + "::json_release_directory_snapshot", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_json_release_directory_snapshot(client_id, + request); + }, }, - }, - { - "::winfsp_cleanup", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_cleanup(request, response); + { + "::winfsp_can_delete", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_winfsp_can_delete(request); + }, }, - }, - { - "::winfsp_close", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_winfsp_close(request); + { + "::winfsp_cleanup", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_cleanup(request, response); + }, }, - }, - { - "::winfsp_create", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_create(client_id, request, response); + { + "::winfsp_close", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_winfsp_close(request); + }, }, - }, - { - "::winfsp_flush", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_flush(request, response); + { + "::winfsp_create", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_create(client_id, request, response); + }, }, - }, - { - "::winfsp_get_file_info", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_get_file_info(request, response); + { + "::winfsp_flush", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_flush(request, response); + }, }, - }, - { - "::winfsp_get_security_by_name", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_get_security_by_name(request, response); + { + "::winfsp_get_file_info", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_get_file_info(request, response); + }, }, - }, - { - "::winfsp_get_volume_info", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, - auto && /* request */, auto &&response) -> auto { - return this->handle_winfsp_get_volume_info(response); + { + "::winfsp_get_security_by_name", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_get_security_by_name(request, + response); + }, }, - }, - { - "::winfsp_mounted", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_winfsp_mounted(request); + { + "::winfsp_get_volume_info", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto && /* request */, auto &&response) -> auto { + return this->handle_winfsp_get_volume_info(response); + }, }, - }, - { - "::winfsp_open", - [this](auto && /* service_flags */, auto &&client_id, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_open(client_id, request, response); + { + "::winfsp_mounted", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_winfsp_mounted(request); + }, }, - }, - { - "::winfsp_overwrite", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_overwrite(request, response); + { + "::winfsp_open", + [this](auto && /* service_flags */, auto &&client_id, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_open(client_id, request, response); + }, }, - }, - { - "::winfsp_read", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_read(request, response); + { + "::winfsp_overwrite", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_overwrite(request, response); + }, }, - }, - { - "::winfsp_read_directory", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_read_directory(request, response); + { + "::winfsp_read", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_read(request, response); + }, }, - }, - { - "::winfsp_rename", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_winfsp_rename(request); + { + "::winfsp_read_directory", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_read_directory(request, response); + }, }, - }, - { - "::winfsp_set_basic_info", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_set_basic_info(request, response); + { + "::winfsp_rename", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_winfsp_rename(request); + }, }, - }, - { - "::winfsp_set_file_size", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_set_file_size(request, response); + { + "::winfsp_set_basic_info", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_set_basic_info(request, response); + }, }, - }, - { - "::winfsp_unmounted", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto && /* response */) -> auto { - return this->handle_winfsp_unmounted(request); + { + "::winfsp_set_file_size", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_set_file_size(request, response); + }, }, - }, - { - "::winfsp_write", - [this](auto && /* service_flags */, auto && /* client_id */, - auto && /* thread_id */, auto && /* method */, auto &&request, - auto &&response) -> auto { - return this->handle_winfsp_write(request, response); + { + "::winfsp_unmounted", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto && /* response */) -> auto { + return this->handle_winfsp_unmounted(request); + }, }, - }, - }; + { + "::winfsp_write", + [this](auto && /* service_flags */, auto && /* client_id */, + auto && /* thread_id */, auto && /* method */, + auto &&request, auto &&response) -> auto { + return this->handle_winfsp_write(request, response); + }, + }, + }; private: - void closed_handler(const std::string &client_id) { + void closed_handler(std::string_view client_id) { client_pool_.remove_client(client_id); close_all(client_id); } @@ -613,7 +616,7 @@ private: return this->fuse_chown(path.c_str(), uid, gid); } - [[nodiscard]] auto handle_fuse_create(const std::string &client_id, + [[nodiscard]] auto handle_fuse_create(std::string_view client_id, packet *request, packet &response) -> packet::error_type { auto ret{0}; @@ -779,7 +782,7 @@ private: return this->fuse_mkdir(path.c_str(), mode); } - [[nodiscard]] auto handle_fuse_open(const std::string &client_id, + [[nodiscard]] auto handle_fuse_open(std::string_view client_id, packet *request, packet &response) -> packet::error_type { auto ret{0}; @@ -803,7 +806,7 @@ private: return ret; } - [[nodiscard]] auto handle_fuse_opendir(const std::string &client_id, + [[nodiscard]] auto handle_fuse_opendir(std::string_view client_id, packet *request, packet &response) -> packet::error_type { auto ret{0}; @@ -846,7 +849,7 @@ private: return ret; } - [[nodiscard]] auto handle_fuse_readdir(const std::string &client_id, + [[nodiscard]] auto handle_fuse_readdir(std::string_view client_id, packet *request, packet &response) -> packet::error_type { auto ret{0}; @@ -886,7 +889,7 @@ private: return this->fuse_release(path.c_str(), handle); } - [[nodiscard]] auto handle_fuse_releasedir(const std::string &client_id, + [[nodiscard]] auto handle_fuse_releasedir(std::string_view client_id, packet *request) -> packet::error_type { auto ret{0}; @@ -1131,7 +1134,7 @@ private: } [[nodiscard]] auto - handle_json_create_directory_snapshot(const std::string &client_id, + handle_json_create_directory_snapshot(std::string_view client_id, packet *request, packet &response) -> packet::error_type { std::int32_t ret{}; @@ -1152,7 +1155,7 @@ private: } [[nodiscard]] auto - handle_json_read_directory_snapshot(const std::string &client_id, + handle_json_read_directory_snapshot(std::string_view client_id, packet *request, packet &response) -> packet::error_type { std::int32_t ret{0}; @@ -1181,7 +1184,7 @@ private: } [[nodiscard]] auto handle_json_release_directory_snapshot( - const std::string &client_id, packet *request) -> packet::error_type { + std::string_view client_id, packet *request) -> packet::error_type { std::int32_t ret{0}; std::string path; @@ -1240,7 +1243,7 @@ private: return this->winfsp_close(file_desc); } - [[nodiscard]] auto handle_winfsp_create(const std::string &client_id, + [[nodiscard]] auto handle_winfsp_create(std::string_view client_id, packet *request, packet &response) -> packet::error_type { auto ret = static_cast(STATUS_SUCCESS); @@ -1380,7 +1383,7 @@ private: return ret; } - [[nodiscard]] auto handle_winfsp_open(const std::string &client_id, + [[nodiscard]] auto handle_winfsp_open(std::string_view client_id, packet *request, packet &response) -> packet::error_type { auto ret = static_cast(STATUS_SUCCESS); @@ -1612,13 +1615,14 @@ private: } void - message_handler(std::uint32_t service_flags, const std::string &client_id, - std::uint64_t thread_id, const std::string &method, + message_handler(std::uint32_t service_flags, std::string_view client_id, + std::uint64_t thread_id, std::string_view method, packet *request, packet &response, packet_server::message_complete_callback message_complete) { auto idx{method.find_last_of("::")}; auto lookup_method_name{ - ((idx == std::string::npos) ? "::" + method : method.substr(idx - 1)), + ((idx == std::string::npos) ? "::" + std::string{method} + : method.substr(idx - 1)), }; if (handler_lookup_.find(lookup_method_name) == handler_lookup_.end()) { message_complete(static_cast(STATUS_NOT_IMPLEMENTED)); diff --git a/repertory/librepertory/include/drives/winfsp/i_winfsp_drive.hpp b/repertory/librepertory/include/drives/winfsp/i_winfsp_drive.hpp index bf0a77b9..54e81a39 100644 --- a/repertory/librepertory/include/drives/winfsp/i_winfsp_drive.hpp +++ b/repertory/librepertory/include/drives/winfsp/i_winfsp_drive.hpp @@ -32,22 +32,22 @@ class i_winfsp_drive { public: [[nodiscard]] virtual auto - get_directory_item_count(const std::string &api_path) const + get_directory_item_count(std::string_view api_path) const -> std::uint64_t = 0; [[nodiscard]] virtual auto - get_directory_items(const std::string &api_path) const + get_directory_items(std::string_view api_path) const -> directory_item_list = 0; - [[nodiscard]] virtual auto get_file_size(const std::string &api_path) const + [[nodiscard]] virtual auto get_file_size(std::string_view api_path) const -> std::uint64_t = 0; - [[nodiscard]] virtual auto get_item_meta(const std::string &api_path, - const std::string &name, + [[nodiscard]] virtual auto get_item_meta(std::string_view api_path, + std::string_view name, std::string &value) const -> api_error = 0; - [[nodiscard]] virtual auto get_item_meta(const std::string &api_path, + [[nodiscard]] virtual auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error = 0; @@ -65,7 +65,7 @@ public: virtual void get_volume_info(UINT64 &total_size, UINT64 &free_size, std::string &volume_label) const = 0; - [[nodiscard]] virtual auto populate_file_info(const std::string &api_path, + [[nodiscard]] virtual auto populate_file_info(std::string_view api_path, remote::file_info &r_info) const -> api_error = 0; }; diff --git a/repertory/librepertory/include/drives/winfsp/remotewinfsp/i_remote_instance.hpp b/repertory/librepertory/include/drives/winfsp/remotewinfsp/i_remote_instance.hpp index 3434bab1..05c90d98 100644 --- a/repertory/librepertory/include/drives/winfsp/remotewinfsp/i_remote_instance.hpp +++ b/repertory/librepertory/include/drives/winfsp/remotewinfsp/i_remote_instance.hpp @@ -68,7 +68,7 @@ public: std::string &volume_label) -> packet::error_type = 0; - [[nodiscard]] virtual auto winfsp_mounted(const std::wstring &location) + [[nodiscard]] virtual auto winfsp_mounted(std::wstring_view location) -> packet::error_type = 0; [[nodiscard]] virtual auto @@ -107,7 +107,7 @@ public: BOOLEAN set_allocation_size, remote::file_info *r_info) -> packet::error_type = 0; - [[nodiscard]] virtual auto winfsp_unmounted(const std::wstring &location) + [[nodiscard]] virtual auto winfsp_unmounted(std::wstring_view location) -> packet::error_type = 0; [[nodiscard]] virtual auto diff --git a/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_client.hpp b/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_client.hpp index 36879427..3087a9a0 100644 --- a/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_client.hpp +++ b/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_client.hpp @@ -50,17 +50,18 @@ private: public: [[nodiscard]] auto check() -> packet::error_type; - [[nodiscard]] auto json_create_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_create_directory_snapshot(std::string_view path, json &json_data) -> packet::error_type override; - [[nodiscard]] auto json_read_directory_snapshot( - const std::string &path, remote::file_handle handle, - std::uint32_t page, json &json_data) -> packet::error_type override; + [[nodiscard]] auto json_read_directory_snapshot(std::string_view path, + remote::file_handle handle, + std::uint32_t page, + json &json_data) + -> packet::error_type override; - [[nodiscard]] auto - json_release_directory_snapshot(const std::string &path, - remote::file_handle handle) + [[nodiscard]] auto json_release_directory_snapshot(std::string_view path, + remote::file_handle handle) -> packet::error_type override; [[nodiscard]] auto winfsp_can_delete(PVOID file_desc, PWSTR file_name) @@ -98,7 +99,7 @@ public: std::string &volume_label) -> packet::error_type override; - [[nodiscard]] auto winfsp_mounted(const std::wstring &location) + [[nodiscard]] auto winfsp_mounted(std::wstring_view location) -> packet::error_type override; [[nodiscard]] auto winfsp_open(PWSTR file_name, UINT32 create_options, @@ -136,7 +137,7 @@ public: remote::file_info *r_info) -> packet::error_type override; - [[nodiscard]] auto winfsp_unmounted(const std::wstring &location) + [[nodiscard]] auto winfsp_unmounted(std::wstring_view location) -> packet::error_type override; [[nodiscard]] auto diff --git a/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_server.hpp b/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_server.hpp index e11369f4..519463e6 100644 --- a/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_server.hpp +++ b/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_server.hpp @@ -36,7 +36,7 @@ namespace remote_winfsp { class remote_server final : public virtual remote_server_base { public: remote_server(app_config &config, i_winfsp_drive &drive, - const std::string &mount_location) + std::string_view mount_location) : remote_server_base(config, drive, utils::string::to_lower(mount_location)) {} @@ -49,7 +49,7 @@ private: [[nodiscard]] auto get_next_handle() -> std::uint64_t; - [[nodiscard]] auto populate_file_info(const std::string &api_path, + [[nodiscard]] auto populate_file_info(std::string_view api_path, remote::file_info &r_info) -> packet::error_type; @@ -215,17 +215,17 @@ public: remote::group_id /* gid */) override {} // JSON Layer - [[nodiscard]] auto json_create_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_create_directory_snapshot(std::string_view path, json &json_data) -> packet::error_type override; - [[nodiscard]] auto json_read_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_read_directory_snapshot(std::string_view path, remote::file_handle handle, std::uint32_t page, json &json_data) -> packet::error_type override; - [[nodiscard]] auto json_release_directory_snapshot(const std::string &path, + [[nodiscard]] auto json_release_directory_snapshot(std::string_view path, remote::file_handle handle) -> packet::error_type override; @@ -265,7 +265,7 @@ public: std::string &volume_label) -> packet::error_type override; - [[nodiscard]] auto winfsp_mounted(const std::wstring &location) + [[nodiscard]] auto winfsp_mounted(std::wstring_view location) -> packet::error_type override; [[nodiscard]] auto winfsp_open(PWSTR file_name, UINT32 create_options, @@ -303,7 +303,7 @@ public: remote::file_info *r_info) -> packet::error_type override; - [[nodiscard]] auto winfsp_unmounted(const std::wstring &location) + [[nodiscard]] auto winfsp_unmounted(std::wstring_view location) -> packet::error_type override; [[nodiscard]] auto diff --git a/repertory/librepertory/include/drives/winfsp/winfsp_drive.hpp b/repertory/librepertory/include/drives/winfsp/winfsp_drive.hpp index 28bb1858..0b88a29f 100644 --- a/repertory/librepertory/include/drives/winfsp/winfsp_drive.hpp +++ b/repertory/librepertory/include/drives/winfsp/winfsp_drive.hpp @@ -77,15 +77,15 @@ private: private: [[nodiscard]] auto handle_error(std::string_view function_name, - const std::string &api_path, api_error error, + std::string_view api_path, api_error error, FileInfo *f_info, std::uint64_t file_size, bool raise_on_failure_only = false) const -> NTSTATUS; - static auto parse_mount_location(const std::wstring &mount_location) + static auto parse_mount_location(std::wstring_view mount_location) -> std::string; - void populate_file_info(const std::string &api_path, std::uint64_t file_size, + void populate_file_info(std::string_view api_path, std::uint64_t file_size, const api_meta_map &meta, FSP_FSCTL_OPEN_FILE_INFO &ofi) const; @@ -114,24 +114,24 @@ public: auto Flush(PVOID file_node, PVOID file_desc, FileInfo *f_info) -> NTSTATUS override; - [[nodiscard]] auto get_directory_item_count(const std::string &api_path) const + [[nodiscard]] auto get_directory_item_count(std::string_view api_path) const -> std::uint64_t override; - [[nodiscard]] auto get_directory_items(const std::string &api_path) const + [[nodiscard]] auto get_directory_items(std::string_view api_path) const -> directory_item_list override; auto GetFileInfo(PVOID file_node, PVOID file_desc, FileInfo *f_info) -> NTSTATUS override; - [[nodiscard]] auto get_file_size(const std::string &api_path) const + [[nodiscard]] auto get_file_size(std::string_view api_path) const -> std::uint64_t override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, + [[nodiscard]] auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, - const std::string &name, + [[nodiscard]] auto get_item_meta(std::string_view api_path, + std::string_view name, std::string &value) const -> api_error override; @@ -172,7 +172,7 @@ public: BOOLEAN replace_attributes, UINT64 allocation_size, FileInfo *f_info) -> NTSTATUS override; - [[nodiscard]] auto populate_file_info(const std::string &api_path, + [[nodiscard]] auto populate_file_info(std::string_view api_path, remote::file_info &r_info) const -> api_error override; diff --git a/repertory/librepertory/include/events/types/curl_error.hpp b/repertory/librepertory/include/events/types/curl_error.hpp index a255fd59..b2f0d3ea 100644 --- a/repertory/librepertory/include/events/types/curl_error.hpp +++ b/repertory/librepertory/include/events/types/curl_error.hpp @@ -28,12 +28,9 @@ namespace repertory { struct curl_error final : public i_event { curl_error() = default; - curl_error(CURLcode code_, std::string_view function_name_, std::string type_, - std::string url_) - : code(code_), - function_name(std::string{function_name_}), - type(std::move(type_)), - url(std::move(url_)) {} + curl_error(CURLcode code_, std::string_view function_name_, + std::string_view type_, std::string_view url_) + : code(code_), function_name(function_name_), type(type_), url(url_) {} static constexpr event_level level{event_level::error}; static constexpr std::string_view name{"curl_error"}; diff --git a/repertory/librepertory/include/events/types/debug_log.hpp b/repertory/librepertory/include/events/types/debug_log.hpp index 2642d003..acf08c3c 100644 --- a/repertory/librepertory/include/events/types/debug_log.hpp +++ b/repertory/librepertory/include/events/types/debug_log.hpp @@ -28,8 +28,8 @@ namespace repertory { struct debug_log final : public i_event { debug_log() = default; - debug_log(std::string_view function_name_, std::string msg_) - : function_name(std::string(function_name_)), msg(std::move(msg_)) {} + debug_log(std::string_view function_name_, std::string_view msg_) + : function_name(function_name_), msg(msg_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"debug_log"}; diff --git a/repertory/librepertory/include/events/types/directory_remove_failed.hpp b/repertory/librepertory/include/events/types/directory_remove_failed.hpp index a044ed75..cd42a290 100644 --- a/repertory/librepertory/include/events/types/directory_remove_failed.hpp +++ b/repertory/librepertory/include/events/types/directory_remove_failed.hpp @@ -28,11 +28,9 @@ namespace repertory { struct directory_remove_failed final : public i_event { directory_remove_failed() = default; - directory_remove_failed(std::string api_path_, api_error error_, + directory_remove_failed(std::string_view api_path_, api_error error_, std::string_view function_name_) - : api_path(std::move(api_path_)), - error(error_), - function_name(std::string(function_name_)) {} + : api_path(api_path_), error(error_), function_name(function_name_) {} static constexpr event_level level{event_level::error}; static constexpr std::string_view name{"directory_remove_failed"}; diff --git a/repertory/librepertory/include/events/types/directory_removed.hpp b/repertory/librepertory/include/events/types/directory_removed.hpp index 922e7047..9e065342 100644 --- a/repertory/librepertory/include/events/types/directory_removed.hpp +++ b/repertory/librepertory/include/events/types/directory_removed.hpp @@ -28,9 +28,8 @@ namespace repertory { struct directory_removed final : public i_event { directory_removed() = default; - directory_removed(std::string api_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)) {} + directory_removed(std::string_view api_path_, std::string_view function_name_) + : api_path(api_path_), function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"directory_removed"}; diff --git a/repertory/librepertory/include/events/types/directory_removed_externally.hpp b/repertory/librepertory/include/events/types/directory_removed_externally.hpp index 95b87ae7..eac0dc5f 100644 --- a/repertory/librepertory/include/events/types/directory_removed_externally.hpp +++ b/repertory/librepertory/include/events/types/directory_removed_externally.hpp @@ -28,12 +28,12 @@ namespace repertory { struct directory_removed_externally final : public i_event { directory_removed_externally() = default; - directory_removed_externally(std::string api_path_, + directory_removed_externally(std::string_view api_path_, std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + std::string_view source_path_) + : api_path(api_path_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"directory_removed_externally"}; diff --git a/repertory/librepertory/include/events/types/download_begin.hpp b/repertory/librepertory/include/events/types/download_begin.hpp index 0fa3d3dd..b8c5c8d6 100644 --- a/repertory/librepertory/include/events/types/download_begin.hpp +++ b/repertory/librepertory/include/events/types/download_begin.hpp @@ -28,11 +28,11 @@ namespace repertory { struct download_begin final : public i_event { download_begin() = default; - download_begin(std::string api_path_, std::string dest_path_, + download_begin(std::string_view api_path_, std::string_view dest_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), - function_name(std::string(function_name_)) {} + : api_path(api_path_), + dest_path(dest_path_), + function_name(function_name_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"download_begin"}; diff --git a/repertory/librepertory/include/events/types/download_end.hpp b/repertory/librepertory/include/events/types/download_end.hpp index e4cebe2d..abb4ffad 100644 --- a/repertory/librepertory/include/events/types/download_end.hpp +++ b/repertory/librepertory/include/events/types/download_end.hpp @@ -28,12 +28,12 @@ namespace repertory { struct download_end final : public i_event { download_end() = default; - download_end(std::string api_path_, std::string dest_path_, api_error error_, - std::string_view function_name_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), + download_end(std::string_view api_path_, std::string_view dest_path_, + api_error error_, std::string_view function_name_) + : api_path(api_path_), + dest_path(dest_path_), error(error_), - function_name(std::string(function_name_)) {} + function_name(function_name_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"download_end"}; diff --git a/repertory/librepertory/include/events/types/download_progress.hpp b/repertory/librepertory/include/events/types/download_progress.hpp index 1361ef19..2cc82384 100644 --- a/repertory/librepertory/include/events/types/download_progress.hpp +++ b/repertory/librepertory/include/events/types/download_progress.hpp @@ -28,11 +28,11 @@ namespace repertory { struct download_progress final : public i_event { download_progress() = default; - download_progress(std::string api_path_, std::string dest_path_, + download_progress(std::string_view api_path_, std::string_view dest_path_, std::string_view function_name_, double progress_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), - function_name(std::string(function_name_)), + : api_path(api_path_), + dest_path(dest_path_), + function_name(function_name_), progress(progress_) {} static constexpr event_level level{event_level::info}; diff --git a/repertory/librepertory/include/events/types/download_restore_failed.hpp b/repertory/librepertory/include/events/types/download_restore_failed.hpp index 2c834967..739bf1ac 100644 --- a/repertory/librepertory/include/events/types/download_restore_failed.hpp +++ b/repertory/librepertory/include/events/types/download_restore_failed.hpp @@ -28,12 +28,13 @@ namespace repertory { struct download_restore_failed final : public i_event { download_restore_failed() = default; - download_restore_failed(std::string api_path_, std::string dest_path_, - std::string error_, std::string_view function_name_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), - error(std::move(error_)), - function_name(std::string(function_name_)) {} + download_restore_failed(std::string_view api_path_, + std::string_view dest_path_, std::string_view error_, + std::string_view function_name_) + : api_path(api_path_), + dest_path(dest_path_), + error(error_), + function_name(function_name_) {} static constexpr event_level level{event_level::error}; static constexpr std::string_view name{"download_restore_failed"}; diff --git a/repertory/librepertory/include/events/types/download_restored.hpp b/repertory/librepertory/include/events/types/download_restored.hpp index 67536cf4..22214744 100644 --- a/repertory/librepertory/include/events/types/download_restored.hpp +++ b/repertory/librepertory/include/events/types/download_restored.hpp @@ -28,11 +28,11 @@ namespace repertory { struct download_restored final : public i_event { download_restored() = default; - download_restored(std::string api_path_, std::string dest_path_, + download_restored(std::string_view api_path_, std::string_view dest_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), - function_name(std::string(function_name_)) {} + : api_path(api_path_), + dest_path(dest_path_), + function_name(function_name_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"download_restored"}; diff --git a/repertory/librepertory/include/events/types/download_resume_add_failed.hpp b/repertory/librepertory/include/events/types/download_resume_add_failed.hpp index 7741caa6..96e090ad 100644 --- a/repertory/librepertory/include/events/types/download_resume_add_failed.hpp +++ b/repertory/librepertory/include/events/types/download_resume_add_failed.hpp @@ -28,13 +28,14 @@ namespace repertory { struct download_resume_add_failed final : public i_event { download_resume_add_failed() = default; - download_resume_add_failed(std::string api_path_, std::string dest_path_, - std::string error_, + download_resume_add_failed(std::string_view api_path_, + std::string_view dest_path_, + std::string_view error_, std::string_view function_name_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), - error(std::move(error_)), - function_name(std::string(function_name_)) {} + : api_path(api_path_), + dest_path(dest_path_), + error(error_), + function_name(function_name_) {} static constexpr event_level level{event_level::error}; static constexpr std::string_view name{"download_resume_add_failed"}; diff --git a/repertory/librepertory/include/events/types/download_resume_added.hpp b/repertory/librepertory/include/events/types/download_resume_added.hpp index a2935079..c49af159 100644 --- a/repertory/librepertory/include/events/types/download_resume_added.hpp +++ b/repertory/librepertory/include/events/types/download_resume_added.hpp @@ -28,11 +28,11 @@ namespace repertory { struct download_resume_added final : public i_event { download_resume_added() = default; - download_resume_added(std::string api_path_, std::string dest_path_, + download_resume_added(std::string_view api_path_, std::string_view dest_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), - function_name(std::string(function_name_)) {} + : api_path(api_path_), + dest_path(dest_path_), + function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"download_resume_added"}; diff --git a/repertory/librepertory/include/events/types/download_resume_removed.hpp b/repertory/librepertory/include/events/types/download_resume_removed.hpp index 0ea3c0d9..aabd62d4 100644 --- a/repertory/librepertory/include/events/types/download_resume_removed.hpp +++ b/repertory/librepertory/include/events/types/download_resume_removed.hpp @@ -28,11 +28,12 @@ namespace repertory { struct download_resume_removed final : public i_event { download_resume_removed() = default; - download_resume_removed(std::string api_path_, std::string dest_path_, + download_resume_removed(std::string_view api_path_, + std::string_view dest_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), - function_name(std::string(function_name_)) {} + : api_path(api_path_), + dest_path(dest_path_), + function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"download_resume_removed"}; diff --git a/repertory/librepertory/include/events/types/download_type_selected.hpp b/repertory/librepertory/include/events/types/download_type_selected.hpp index 92d15978..15a3595d 100644 --- a/repertory/librepertory/include/events/types/download_type_selected.hpp +++ b/repertory/librepertory/include/events/types/download_type_selected.hpp @@ -28,11 +28,12 @@ namespace repertory { struct download_type_selected final : public i_event { download_type_selected() = default; - download_type_selected(std::string api_path_, std::string dest_path_, + download_type_selected(std::string_view api_path_, + std::string_view dest_path_, std::string_view function_name_, download_type type_) - : api_path(std::move(api_path_)), - dest_path(std::move(dest_path_)), - function_name(std::string(function_name_)), + : api_path(api_path_), + dest_path(dest_path_), + function_name(function_name_), type(type_) {} static constexpr event_level level{event_level::debug}; diff --git a/repertory/librepertory/include/events/types/drive_mount_failed.hpp b/repertory/librepertory/include/events/types/drive_mount_failed.hpp index ad76e9e0..e28dbdb3 100644 --- a/repertory/librepertory/include/events/types/drive_mount_failed.hpp +++ b/repertory/librepertory/include/events/types/drive_mount_failed.hpp @@ -30,9 +30,9 @@ namespace repertory { struct drive_mount_failed final : public i_event { drive_mount_failed() = default; drive_mount_failed(NTSTATUS error_, std::string_view function_name_, - std::string mount_location_) + std::string_view mount_location_) : error(error_), - function_name(std::string(function_name_)), + function_name(function_name_), mount_location(std::move(mount_location_)) {} static constexpr event_level level{event_level::error}; diff --git a/repertory/librepertory/include/events/types/drive_mount_result.hpp b/repertory/librepertory/include/events/types/drive_mount_result.hpp index ada57745..4d4d49bf 100644 --- a/repertory/librepertory/include/events/types/drive_mount_result.hpp +++ b/repertory/librepertory/include/events/types/drive_mount_result.hpp @@ -29,10 +29,10 @@ namespace repertory { struct drive_mount_result final : public i_event { drive_mount_result() = default; drive_mount_result(std::string_view function_name_, - std::string mount_location_, std::string result_) - : function_name(std::string(function_name_)), - mount_location(std::move(mount_location_)), - result(std::move(result_)) {} + std::string_view mount_location_, std::string result_) + : function_name(function_name_), + mount_location(mount_location_), + result(result_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"drive_mount_result"}; diff --git a/repertory/librepertory/include/events/types/drive_mounted.hpp b/repertory/librepertory/include/events/types/drive_mounted.hpp index 67c7c07d..92b115cb 100644 --- a/repertory/librepertory/include/events/types/drive_mounted.hpp +++ b/repertory/librepertory/include/events/types/drive_mounted.hpp @@ -28,9 +28,9 @@ namespace repertory { struct drive_mounted final : public i_event { drive_mounted() = default; - drive_mounted(std::string_view function_name_, std::string mount_location_) - : function_name(std::string(function_name_)), - mount_location(std::move(mount_location_)) {} + drive_mounted(std::string_view function_name_, + std::string_view mount_location_) + : function_name(function_name_), mount_location(mount_location_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"drive_mounted"}; diff --git a/repertory/librepertory/include/events/types/drive_stop_timed_out.hpp b/repertory/librepertory/include/events/types/drive_stop_timed_out.hpp index 4f54f7e1..03061bc7 100644 --- a/repertory/librepertory/include/events/types/drive_stop_timed_out.hpp +++ b/repertory/librepertory/include/events/types/drive_stop_timed_out.hpp @@ -29,7 +29,7 @@ namespace repertory { struct drive_stop_timed_out final : public i_event { drive_stop_timed_out() = default; drive_stop_timed_out(std::string_view function_name_) - : function_name(std::string(function_name_)) {} + : function_name(function_name_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"drive_stop_timed_out"}; diff --git a/repertory/librepertory/include/events/types/drive_unmount_pending.hpp b/repertory/librepertory/include/events/types/drive_unmount_pending.hpp index 75162598..fba886cd 100644 --- a/repertory/librepertory/include/events/types/drive_unmount_pending.hpp +++ b/repertory/librepertory/include/events/types/drive_unmount_pending.hpp @@ -29,9 +29,8 @@ namespace repertory { struct drive_unmount_pending final : public i_event { drive_unmount_pending() = default; drive_unmount_pending(std::string_view function_name_, - std::string mount_location_) - : function_name(std::string(function_name_)), - mount_location(std::move(mount_location_)) {} + std::string_view mount_location_) + : function_name(function_name_), mount_location(mount_location_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"drive_unmount_pending"}; diff --git a/repertory/librepertory/include/events/types/drive_unmounted.hpp b/repertory/librepertory/include/events/types/drive_unmounted.hpp index e9d69aad..e14e20df 100644 --- a/repertory/librepertory/include/events/types/drive_unmounted.hpp +++ b/repertory/librepertory/include/events/types/drive_unmounted.hpp @@ -28,9 +28,9 @@ namespace repertory { struct drive_unmounted final : public i_event { drive_unmounted() = default; - drive_unmounted(std::string_view function_name_, std::string mount_location_) - : function_name(std::string(function_name_)), - mount_location(std::move(mount_location_)) {} + drive_unmounted(std::string_view function_name_, + std::string_view mount_location_) + : function_name(function_name_), mount_location(mount_location_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"drive_unmounted"}; diff --git a/repertory/librepertory/include/events/types/event_level_changed.hpp b/repertory/librepertory/include/events/types/event_level_changed.hpp index aca9122b..5d77bc1c 100644 --- a/repertory/librepertory/include/events/types/event_level_changed.hpp +++ b/repertory/librepertory/include/events/types/event_level_changed.hpp @@ -29,7 +29,7 @@ namespace repertory { struct event_level_changed final : public i_event { event_level_changed() = default; event_level_changed(std::string_view function_name_, event_level new_level_) - : function_name(std::string(function_name_)), new_level(new_level_) {} + : function_name(function_name_), new_level(new_level_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"event_level_changed"}; diff --git a/repertory/librepertory/include/events/types/file_pinned.hpp b/repertory/librepertory/include/events/types/file_pinned.hpp index fdc742a8..879e4ab1 100644 --- a/repertory/librepertory/include/events/types/file_pinned.hpp +++ b/repertory/librepertory/include/events/types/file_pinned.hpp @@ -28,9 +28,8 @@ namespace repertory { struct file_pinned final : public i_event { file_pinned() = default; - file_pinned(std::string api_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)) {} + file_pinned(std::string_view api_path_, std::string_view function_name_) + : api_path(api_path_), function_name(function_name_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"file_pinned"}; diff --git a/repertory/librepertory/include/events/types/file_remove_failed.hpp b/repertory/librepertory/include/events/types/file_remove_failed.hpp index 37c2c6f3..ae216b25 100644 --- a/repertory/librepertory/include/events/types/file_remove_failed.hpp +++ b/repertory/librepertory/include/events/types/file_remove_failed.hpp @@ -28,11 +28,9 @@ namespace repertory { struct file_remove_failed final : public i_event { file_remove_failed() = default; - file_remove_failed(std::string api_path_, api_error error_, + file_remove_failed(std::string_view api_path_, api_error error_, std::string_view function_name_) - : api_path(std::move(api_path_)), - error(error_), - function_name(std::string(function_name_)) {} + : api_path(api_path_), error(error_), function_name(function_name_) {} static constexpr event_level level{event_level::error}; static constexpr std::string_view name{"file_remove_failed"}; diff --git a/repertory/librepertory/include/events/types/file_removed.hpp b/repertory/librepertory/include/events/types/file_removed.hpp index b1156b8b..5acb4765 100644 --- a/repertory/librepertory/include/events/types/file_removed.hpp +++ b/repertory/librepertory/include/events/types/file_removed.hpp @@ -28,9 +28,8 @@ namespace repertory { struct file_removed final : public i_event { file_removed() = default; - file_removed(std::string api_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)) {} + file_removed(std::string_view api_path_, std::string_view function_name_) + : api_path(api_path_), function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"file_removed"}; diff --git a/repertory/librepertory/include/events/types/file_removed_externally.hpp b/repertory/librepertory/include/events/types/file_removed_externally.hpp index 079f3110..1d277410 100644 --- a/repertory/librepertory/include/events/types/file_removed_externally.hpp +++ b/repertory/librepertory/include/events/types/file_removed_externally.hpp @@ -28,12 +28,12 @@ namespace repertory { struct file_removed_externally final : public i_event { file_removed_externally() = default; - file_removed_externally(std::string api_path_, + file_removed_externally(std::string_view api_path_, std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + std::string_view source_path_) + : api_path(api_path_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"file_removed_externally"}; diff --git a/repertory/librepertory/include/events/types/file_unpinned.hpp b/repertory/librepertory/include/events/types/file_unpinned.hpp index eb3b629f..3f53eefb 100644 --- a/repertory/librepertory/include/events/types/file_unpinned.hpp +++ b/repertory/librepertory/include/events/types/file_unpinned.hpp @@ -28,9 +28,8 @@ namespace repertory { struct file_unpinned final : public i_event { file_unpinned() = default; - file_unpinned(std::string api_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)) {} + file_unpinned(std::string_view api_path_, std::string_view function_name_) + : api_path(api_path_), function_name(function_name_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"file_unpinned"}; diff --git a/repertory/librepertory/include/events/types/file_upload_completed.hpp b/repertory/librepertory/include/events/types/file_upload_completed.hpp index 3ecb7766..ad22ef4b 100644 --- a/repertory/librepertory/include/events/types/file_upload_completed.hpp +++ b/repertory/librepertory/include/events/types/file_upload_completed.hpp @@ -28,14 +28,14 @@ namespace repertory { struct file_upload_completed final : public i_event { file_upload_completed() = default; - file_upload_completed(std::string api_path_, bool cancelled_, + file_upload_completed(std::string_view api_path_, bool cancelled_, api_error error_, std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), + std::string_view source_path_) + : api_path(api_path_), cancelled(cancelled_), error(error_), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"file_upload_completed"}; diff --git a/repertory/librepertory/include/events/types/file_upload_failed.hpp b/repertory/librepertory/include/events/types/file_upload_failed.hpp index 93800b8c..66eeca76 100644 --- a/repertory/librepertory/include/events/types/file_upload_failed.hpp +++ b/repertory/librepertory/include/events/types/file_upload_failed.hpp @@ -28,12 +28,13 @@ namespace repertory { struct file_upload_failed final : public i_event { file_upload_failed() = default; - file_upload_failed(std::string api_path_, std::string error_, - std::string_view function_name_, std::string source_path_) - : api_path(std::move(api_path_)), - error(std::move(error_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + file_upload_failed(std::string_view api_path_, std::string_view error_, + std::string_view function_name_, + std::string_view source_path_) + : api_path(api_path_), + error(error_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"file_upload_failed"}; diff --git a/repertory/librepertory/include/events/types/file_upload_not_found.hpp b/repertory/librepertory/include/events/types/file_upload_not_found.hpp index 1b74330e..5e076727 100644 --- a/repertory/librepertory/include/events/types/file_upload_not_found.hpp +++ b/repertory/librepertory/include/events/types/file_upload_not_found.hpp @@ -28,11 +28,12 @@ namespace repertory { struct file_upload_not_found final : public i_event { file_upload_not_found() = default; - file_upload_not_found(std::string api_path_, std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + file_upload_not_found(std::string_view api_path_, + std::string_view function_name_, + std::string_view source_path_) + : api_path(api_path_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"file_upload_not_found"}; diff --git a/repertory/librepertory/include/events/types/file_upload_queued.hpp b/repertory/librepertory/include/events/types/file_upload_queued.hpp index 41949302..cd4af05c 100644 --- a/repertory/librepertory/include/events/types/file_upload_queued.hpp +++ b/repertory/librepertory/include/events/types/file_upload_queued.hpp @@ -28,11 +28,12 @@ namespace repertory { struct file_upload_queued final : public i_event { file_upload_queued() = default; - file_upload_queued(std::string api_path_, std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + file_upload_queued(std::string_view api_path_, + std::string_view function_name_, + std::string_view source_path_) + : api_path(api_path_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"file_upload_queued"}; diff --git a/repertory/librepertory/include/events/types/file_upload_removed.hpp b/repertory/librepertory/include/events/types/file_upload_removed.hpp index 04ba865e..c7406a7a 100644 --- a/repertory/librepertory/include/events/types/file_upload_removed.hpp +++ b/repertory/librepertory/include/events/types/file_upload_removed.hpp @@ -28,9 +28,9 @@ namespace repertory { struct file_upload_removed final : public i_event { file_upload_removed() = default; - file_upload_removed(std::string api_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)) {} + file_upload_removed(std::string_view api_path_, + std::string_view function_name_) + : api_path(api_path_), function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"file_upload_removed"}; diff --git a/repertory/librepertory/include/events/types/file_upload_retry.hpp b/repertory/librepertory/include/events/types/file_upload_retry.hpp index 7296a364..44a4e09a 100644 --- a/repertory/librepertory/include/events/types/file_upload_retry.hpp +++ b/repertory/librepertory/include/events/types/file_upload_retry.hpp @@ -28,12 +28,13 @@ namespace repertory { struct file_upload_retry final : public i_event { file_upload_retry() = default; - file_upload_retry(std::string api_path_, api_error error_, - std::string_view function_name_, std::string source_path_) - : api_path(std::move(api_path_)), - error(std::move(error_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + file_upload_retry(std::string_view api_path_, api_error error_, + std::string_view function_name_, + std::string_view source_path_) + : api_path(api_path_), + error(error_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"file_upload_retry"}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_added.hpp b/repertory/librepertory/include/events/types/filesystem_item_added.hpp index 853da92b..eb30e23f 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_added.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_added.hpp @@ -28,12 +28,13 @@ namespace repertory { struct filesystem_item_added final : public i_event { filesystem_item_added() = default; - filesystem_item_added(std::string api_parent_, std::string api_path_, - bool directory_, std::string_view function_name_) - : api_parent(std::move(api_parent_)), - api_path(std::move(api_path_)), + filesystem_item_added(std::string_view api_parent_, + std::string_view api_path_, bool directory_, + std::string_view function_name_) + : api_parent(api_parent_), + api_path(api_path_), directory(directory_), - function_name(std::string(function_name_)) {} + function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"filesystem_item_added"}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_closed.hpp b/repertory/librepertory/include/events/types/filesystem_item_closed.hpp index b5d1340c..4946bfe2 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_closed.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_closed.hpp @@ -28,14 +28,14 @@ namespace repertory { struct filesystem_item_closed final : public i_event { filesystem_item_closed() = default; - filesystem_item_closed(std::string api_path_, bool changed_, bool directory_, - std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), + filesystem_item_closed(std::string_view api_path_, bool changed_, + bool directory_, std::string_view function_name_, + std::string_view source_path_) + : api_path(api_path_), changed(changed_), directory(directory_), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::trace}; static constexpr std::string_view name{"filesystem_item_closed"}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_evicted.hpp b/repertory/librepertory/include/events/types/filesystem_item_evicted.hpp index 5821d896..d08f226f 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_evicted.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_evicted.hpp @@ -28,12 +28,12 @@ namespace repertory { struct filesystem_item_evicted final : public i_event { filesystem_item_evicted() = default; - filesystem_item_evicted(std::string api_path_, + filesystem_item_evicted(std::string_view api_path_, std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + std::string_view source_path_) + : api_path(api_path_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"filesystem_item_evicted"}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_handle_closed.hpp b/repertory/librepertory/include/events/types/filesystem_item_handle_closed.hpp index b84627d9..b07f3c6f 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_handle_closed.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_handle_closed.hpp @@ -28,16 +28,17 @@ namespace repertory { struct filesystem_item_handle_closed final : public i_event { filesystem_item_handle_closed() = default; - filesystem_item_handle_closed(std::string api_path_, bool changed_, + filesystem_item_handle_closed(std::string_view api_path_, bool changed_, bool directory_, std::string_view function_name_, - std::uint64_t handle_, std::string source_path_) - : api_path(std::move(api_path_)), + std::uint64_t handle_, + std::string_view source_path_) + : api_path(api_path_), changed(changed_), directory(directory_), - function_name(std::string(function_name_)), + function_name(function_name_), handle(handle_), - source_path(std::move(source_path_)) {} + source_path(source_path_) {} static constexpr event_level level{event_level::trace}; static constexpr std::string_view name{"filesystem_item_handle_closed"}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_handle_opened.hpp b/repertory/librepertory/include/events/types/filesystem_item_handle_opened.hpp index 0ea6f0ad..d24a565b 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_handle_opened.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_handle_opened.hpp @@ -28,14 +28,15 @@ namespace repertory { struct filesystem_item_handle_opened final : public i_event { filesystem_item_handle_opened() = default; - filesystem_item_handle_opened(std::string api_path_, bool directory_, + filesystem_item_handle_opened(std::string_view api_path_, bool directory_, std::string_view function_name_, - std::uint64_t handle_, std::string source_path_) - : api_path(std::move(api_path_)), + std::uint64_t handle_, + std::string_view source_path_) + : api_path(api_path_), directory(directory_), - function_name(std::string(function_name_)), + function_name(function_name_), handle(handle_), - source_path(std::move(source_path_)) {} + source_path(source_path_) {} static constexpr event_level level{event_level::trace}; static constexpr std::string_view name{"filesystem_item_handle_opened"}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_opened.hpp b/repertory/librepertory/include/events/types/filesystem_item_opened.hpp index 5d19f839..d9d44e93 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_opened.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_opened.hpp @@ -28,13 +28,13 @@ namespace repertory { struct filesystem_item_opened final : public i_event { filesystem_item_opened() = default; - filesystem_item_opened(std::string api_path_, bool directory_, + filesystem_item_opened(std::string_view api_path_, bool directory_, std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), + std::string_view source_path_) + : api_path(api_path_), directory(directory_), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::trace}; static constexpr std::string_view name{"filesystem_item_opened"}; diff --git a/repertory/librepertory/include/events/types/fuse_args_parsed.hpp b/repertory/librepertory/include/events/types/fuse_args_parsed.hpp index 795bf4e5..e03c387c 100644 --- a/repertory/librepertory/include/events/types/fuse_args_parsed.hpp +++ b/repertory/librepertory/include/events/types/fuse_args_parsed.hpp @@ -30,7 +30,7 @@ namespace repertory { struct fuse_args_parsed final : public i_event { fuse_args_parsed() = default; fuse_args_parsed(std::string_view args_, std::string_view function_name_) - : args(std::move(args_)), function_name(std::string{function_name_}) {} + : args(args_), function_name(function_name_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"fuse_args_parsed"}; diff --git a/repertory/librepertory/include/events/types/fuse_event.hpp b/repertory/librepertory/include/events/types/fuse_event.hpp index a1f717ce..68679022 100644 --- a/repertory/librepertory/include/events/types/fuse_event.hpp +++ b/repertory/librepertory/include/events/types/fuse_event.hpp @@ -31,9 +31,7 @@ struct fuse_event final : public i_event { fuse_event() = default; fuse_event(std::string_view api_path_, std::int32_t error_, std::string_view function_name_) - : api_path(std::string{api_path_}), - error(error_), - function_name(std::string{function_name_}) {} + : api_path(api_path_), error(error_), function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"fuse_event"}; diff --git a/repertory/librepertory/include/events/types/info_log.hpp b/repertory/librepertory/include/events/types/info_log.hpp index 36e1e1cb..60653451 100644 --- a/repertory/librepertory/include/events/types/info_log.hpp +++ b/repertory/librepertory/include/events/types/info_log.hpp @@ -28,8 +28,8 @@ namespace repertory { struct info_log final : public i_event { info_log() = default; - info_log(std::string_view function_name_, std::string msg_) - : function_name(std::string(function_name_)), msg(std::move(msg_)) {} + info_log(std::string_view function_name_, std::string_view msg_) + : function_name(function_name_), msg(msg_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"info_log"}; diff --git a/repertory/librepertory/include/events/types/invalid_cache_size.hpp b/repertory/librepertory/include/events/types/invalid_cache_size.hpp index b6f21ab7..f059c33d 100644 --- a/repertory/librepertory/include/events/types/invalid_cache_size.hpp +++ b/repertory/librepertory/include/events/types/invalid_cache_size.hpp @@ -31,7 +31,7 @@ struct invalid_cache_size final : public i_event { invalid_cache_size(std::uint64_t cache_size_, std::string_view function_name_, std::uint64_t invalid_size_) : cache_size(cache_size_), - function_name(std::string{function_name_}), + function_name(function_name_), invalid_size(invalid_size_) {} static constexpr event_level level{event_level::warn}; diff --git a/repertory/librepertory/include/events/types/item_timeout.hpp b/repertory/librepertory/include/events/types/item_timeout.hpp index ac128a16..3da5898a 100644 --- a/repertory/librepertory/include/events/types/item_timeout.hpp +++ b/repertory/librepertory/include/events/types/item_timeout.hpp @@ -28,9 +28,8 @@ namespace repertory { struct item_timeout final : public i_event { item_timeout() = default; - item_timeout(std::string api_path_, std::string_view function_name_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)) {} + item_timeout(std::string_view api_path_, std::string_view function_name_) + : api_path(api_path_), function_name(function_name_) {} static constexpr event_level level{event_level::trace}; static constexpr std::string_view name{"item_timeout"}; diff --git a/repertory/librepertory/include/events/types/max_cache_size_reached.hpp b/repertory/librepertory/include/events/types/max_cache_size_reached.hpp index 3da04e59..d8e26972 100644 --- a/repertory/librepertory/include/events/types/max_cache_size_reached.hpp +++ b/repertory/librepertory/include/events/types/max_cache_size_reached.hpp @@ -32,7 +32,7 @@ struct max_cache_size_reached final : public i_event { std::string_view function_name_, std::uint64_t max_cache_size_) : cache_size(cache_size_), - function_name(std::string{function_name_}), + function_name(function_name_), max_cache_size(max_cache_size_) {} static constexpr event_level level{event_level::warn}; diff --git a/repertory/librepertory/include/events/types/orphaned_file_detected.hpp b/repertory/librepertory/include/events/types/orphaned_file_detected.hpp index d299a0a5..644363fc 100644 --- a/repertory/librepertory/include/events/types/orphaned_file_detected.hpp +++ b/repertory/librepertory/include/events/types/orphaned_file_detected.hpp @@ -29,9 +29,8 @@ namespace repertory { struct orphaned_file_detected final : public i_event { orphaned_file_detected() = default; orphaned_file_detected(std::string_view function_name_, - std::string source_path_) - : function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + std::string_view source_path_) + : function_name(function_name_), source_path(source_path_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"orphaned_file_detected"}; diff --git a/repertory/librepertory/include/events/types/orphaned_file_processing_failed.hpp b/repertory/librepertory/include/events/types/orphaned_file_processing_failed.hpp index 9476a972..3be9d9c7 100644 --- a/repertory/librepertory/include/events/types/orphaned_file_processing_failed.hpp +++ b/repertory/librepertory/include/events/types/orphaned_file_processing_failed.hpp @@ -28,13 +28,14 @@ namespace repertory { struct orphaned_file_processing_failed final : public i_event { orphaned_file_processing_failed() = default; - orphaned_file_processing_failed(std::string dest_path_, std::string error_, + orphaned_file_processing_failed(std::string_view dest_path_, + std::string_view error_, std::string_view function_name_, - std::string source_path_) - : dest_path(std::move(dest_path_)), - error(std::move(error_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + std::string_view source_path_) + : dest_path(dest_path_), + error(error_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::error}; static constexpr std::string_view name{ diff --git a/repertory/librepertory/include/events/types/orphaned_source_file_detected.hpp b/repertory/librepertory/include/events/types/orphaned_source_file_detected.hpp index 14aeb11a..bcee6f6a 100644 --- a/repertory/librepertory/include/events/types/orphaned_source_file_detected.hpp +++ b/repertory/librepertory/include/events/types/orphaned_source_file_detected.hpp @@ -29,9 +29,8 @@ namespace repertory { struct orphaned_source_file_detected final : public i_event { orphaned_source_file_detected() = default; orphaned_source_file_detected(std::string_view function_name_, - std::string source_path_) - : function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + std::string_view source_path_) + : function_name(function_name_), source_path(source_path_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"orphaned_source_file_detected"}; diff --git a/repertory/librepertory/include/events/types/orphaned_source_file_removed.hpp b/repertory/librepertory/include/events/types/orphaned_source_file_removed.hpp index 22d81529..dfcf3fb3 100644 --- a/repertory/librepertory/include/events/types/orphaned_source_file_removed.hpp +++ b/repertory/librepertory/include/events/types/orphaned_source_file_removed.hpp @@ -29,9 +29,8 @@ namespace repertory { struct orphaned_source_file_removed final : public i_event { orphaned_source_file_removed() = default; orphaned_source_file_removed(std::string_view function_name_, - std::string source_path_) - : function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + std::string_view source_path_) + : function_name(function_name_), source_path(source_path_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"orphaned_source_file_removed"}; diff --git a/repertory/librepertory/include/events/types/packet_client_timeout.hpp b/repertory/librepertory/include/events/types/packet_client_timeout.hpp index ff58753b..f87fddad 100644 --- a/repertory/librepertory/include/events/types/packet_client_timeout.hpp +++ b/repertory/librepertory/include/events/types/packet_client_timeout.hpp @@ -30,8 +30,7 @@ struct packet_client_timeout final : public i_event { packet_client_timeout() = default; packet_client_timeout(std::string_view event_name_, std::string_view function_name_) - : event_name(std::string(event_name_)), - function_name(std::string(function_name_)) {} + : event_name(event_name_), function_name(function_name_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"packet_client_timeout"}; diff --git a/repertory/librepertory/include/events/types/polling_item_begin.hpp b/repertory/librepertory/include/events/types/polling_item_begin.hpp index fd98cbe5..7e496f3d 100644 --- a/repertory/librepertory/include/events/types/polling_item_begin.hpp +++ b/repertory/librepertory/include/events/types/polling_item_begin.hpp @@ -28,9 +28,9 @@ namespace repertory { struct polling_item_begin final : public i_event { polling_item_begin() = default; - polling_item_begin(std::string_view function_name_, std::string item_name_) - : function_name(std::string(function_name_)), - item_name(std::move(item_name_)) {} + polling_item_begin(std::string_view function_name_, + std::string_view item_name_) + : function_name(function_name_), item_name(item_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"polling_item_begin"}; diff --git a/repertory/librepertory/include/events/types/polling_item_end.hpp b/repertory/librepertory/include/events/types/polling_item_end.hpp index 5bc6075e..8446e31c 100644 --- a/repertory/librepertory/include/events/types/polling_item_end.hpp +++ b/repertory/librepertory/include/events/types/polling_item_end.hpp @@ -28,9 +28,8 @@ namespace repertory { struct polling_item_end final : public i_event { polling_item_end() = default; - polling_item_end(std::string_view function_name_, std::string item_name_) - : function_name(std::string(function_name_)), - item_name(std::move(item_name_)) {} + polling_item_end(std::string_view function_name_, std::string_view item_name_) + : function_name(function_name_), item_name(item_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"polling_item_end"}; diff --git a/repertory/librepertory/include/events/types/provider_invalid_version.hpp b/repertory/librepertory/include/events/types/provider_invalid_version.hpp index cc6e84b0..df26c3f9 100644 --- a/repertory/librepertory/include/events/types/provider_invalid_version.hpp +++ b/repertory/librepertory/include/events/types/provider_invalid_version.hpp @@ -29,11 +29,11 @@ namespace repertory { struct provider_invalid_version final : public i_event { provider_invalid_version() = default; provider_invalid_version(std::string_view function_name_, - std::string required_version_, - std::string returned_version_) - : function_name(std::string(function_name_)), - required_version(std::move(required_version_)), - returned_version(std::move(returned_version_)) {} + std::string_view required_version_, + std::string_view returned_version_) + : function_name(function_name_), + required_version(required_version_), + returned_version(returned_version_) {} static constexpr event_level level{event_level::error}; static constexpr std::string_view name{"provider_invalid_version"}; diff --git a/repertory/librepertory/include/events/types/provider_offline.hpp b/repertory/librepertory/include/events/types/provider_offline.hpp index e1f3b82e..72512da3 100644 --- a/repertory/librepertory/include/events/types/provider_offline.hpp +++ b/repertory/librepertory/include/events/types/provider_offline.hpp @@ -29,9 +29,9 @@ namespace repertory { struct provider_offline final : public i_event { provider_offline() = default; provider_offline(std::string_view function_name_, - std::string host_name_or_ip_, std::uint16_t port_) - : function_name(std::string(function_name_)), - host_name_or_ip(std::move(host_name_or_ip_)), + std::string_view host_name_or_ip_, std::uint16_t port_) + : function_name(function_name_), + host_name_or_ip(host_name_or_ip_), port(port_) {} static constexpr event_level level{event_level::warn}; diff --git a/repertory/librepertory/include/events/types/provider_upload_begin.hpp b/repertory/librepertory/include/events/types/provider_upload_begin.hpp index 5a7fc5e2..6872c868 100644 --- a/repertory/librepertory/include/events/types/provider_upload_begin.hpp +++ b/repertory/librepertory/include/events/types/provider_upload_begin.hpp @@ -28,11 +28,12 @@ namespace repertory { struct provider_upload_begin final : public i_event { provider_upload_begin() = default; - provider_upload_begin(std::string api_path_, std::string_view function_name_, - std::string source_path_) - : api_path(std::move(api_path_)), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + provider_upload_begin(std::string_view api_path_, + std::string_view function_name_, + std::string_view source_path_) + : api_path(api_path_), + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"provider_upload_begin"}; diff --git a/repertory/librepertory/include/events/types/provider_upload_end.hpp b/repertory/librepertory/include/events/types/provider_upload_end.hpp index 7e69118a..4cfd62d4 100644 --- a/repertory/librepertory/include/events/types/provider_upload_end.hpp +++ b/repertory/librepertory/include/events/types/provider_upload_end.hpp @@ -28,12 +28,13 @@ namespace repertory { struct provider_upload_end final : public i_event { provider_upload_end() = default; - provider_upload_end(std::string api_path_, api_error error_, - std::string_view function_name_, std::string source_path_) - : api_path(std::move(api_path_)), + provider_upload_end(std::string_view api_path_, api_error error_, + std::string_view function_name_, + std::string_view source_path_) + : api_path(api_path_), error(error_), - function_name(std::string(function_name_)), - source_path(std::move(source_path_)) {} + function_name(function_name_), + source_path(source_path_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"provider_upload_end"}; diff --git a/repertory/librepertory/include/events/types/remote_server_event.hpp b/repertory/librepertory/include/events/types/remote_server_event.hpp index d13d368a..45547772 100644 --- a/repertory/librepertory/include/events/types/remote_server_event.hpp +++ b/repertory/librepertory/include/events/types/remote_server_event.hpp @@ -29,11 +29,9 @@ namespace repertory { struct remote_server_event final : public i_event { remote_server_event() = default; - remote_server_event(std::string api_path_, packet::error_type error_, + remote_server_event(std::string_view api_path_, packet::error_type error_, std::string_view function_name_) - : api_path(std::move(api_path_)), - error(error_), - function_name(std::string{function_name_}) {} + : api_path(api_path_), error(error_), function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"remote_server_event"}; diff --git a/repertory/librepertory/include/events/types/repertory_exception.hpp b/repertory/librepertory/include/events/types/repertory_exception.hpp index 6b901ec7..39847b53 100644 --- a/repertory/librepertory/include/events/types/repertory_exception.hpp +++ b/repertory/librepertory/include/events/types/repertory_exception.hpp @@ -28,8 +28,8 @@ namespace repertory { struct repertory_exception final : public i_event { repertory_exception() = default; - repertory_exception(std::string_view function_name_, std::string msg_) - : function_name(std::string(function_name_)), msg(std::move(msg_)) {} + repertory_exception(std::string_view function_name_, std::string_view msg_) + : function_name(function_name_), msg(msg_) {} static constexpr event_level level{event_level::error}; static constexpr std::string_view name{"repertory_exception"}; diff --git a/repertory/librepertory/include/events/types/service_start_begin.hpp b/repertory/librepertory/include/events/types/service_start_begin.hpp index 384c437a..303acc3f 100644 --- a/repertory/librepertory/include/events/types/service_start_begin.hpp +++ b/repertory/librepertory/include/events/types/service_start_begin.hpp @@ -29,9 +29,8 @@ namespace repertory { struct service_start_begin final : public i_event { service_start_begin() = default; service_start_begin(std::string_view function_name_, - std::string service_name_) - : function_name(std::string(function_name_)), - service_name(std::move(service_name_)) {} + std::string_view service_name_) + : function_name(function_name_), service_name(service_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"service_start_begin"}; diff --git a/repertory/librepertory/include/events/types/service_start_end.hpp b/repertory/librepertory/include/events/types/service_start_end.hpp index 470bdddd..ee559c64 100644 --- a/repertory/librepertory/include/events/types/service_start_end.hpp +++ b/repertory/librepertory/include/events/types/service_start_end.hpp @@ -28,9 +28,9 @@ namespace repertory { struct service_start_end final : public i_event { service_start_end() = default; - service_start_end(std::string_view function_name_, std::string service_name_) - : function_name(std::string(function_name_)), - service_name(std::move(service_name_)) {} + service_start_end(std::string_view function_name_, + std::string_view service_name_) + : function_name(function_name_), service_name(std::move(service_name_)) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"service_start_end"}; diff --git a/repertory/librepertory/include/events/types/service_stop_begin.hpp b/repertory/librepertory/include/events/types/service_stop_begin.hpp index 8b41a6f1..ce28c63a 100644 --- a/repertory/librepertory/include/events/types/service_stop_begin.hpp +++ b/repertory/librepertory/include/events/types/service_stop_begin.hpp @@ -28,9 +28,9 @@ namespace repertory { struct service_stop_begin final : public i_event { service_stop_begin() = default; - service_stop_begin(std::string_view function_name_, std::string service_name_) - : function_name(std::string(function_name_)), - service_name(std::move(service_name_)) {} + service_stop_begin(std::string_view function_name_, + std::string_view service_name_) + : function_name(function_name_), service_name(service_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"service_stop_begin"}; diff --git a/repertory/librepertory/include/events/types/service_stop_end.hpp b/repertory/librepertory/include/events/types/service_stop_end.hpp index ad4c3a89..6c12163a 100644 --- a/repertory/librepertory/include/events/types/service_stop_end.hpp +++ b/repertory/librepertory/include/events/types/service_stop_end.hpp @@ -28,9 +28,9 @@ namespace repertory { struct service_stop_end final : public i_event { service_stop_end() = default; - service_stop_end(std::string_view function_name_, std::string service_name_) - : function_name(std::string(function_name_)), - service_name(std::move(service_name_)) {} + service_stop_end(std::string_view function_name_, + std::string_view service_name_) + : function_name(function_name_), service_name(service_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"service_stop_end"}; diff --git a/repertory/librepertory/include/events/types/trace_log.hpp b/repertory/librepertory/include/events/types/trace_log.hpp index 7ad52be0..b1d79bb9 100644 --- a/repertory/librepertory/include/events/types/trace_log.hpp +++ b/repertory/librepertory/include/events/types/trace_log.hpp @@ -28,8 +28,8 @@ namespace repertory { struct trace_log final : public i_event { trace_log() = default; - trace_log(std::string_view function_name_, std::string msg_) - : function_name(std::string(function_name_)), msg(std::move(msg_)) {} + trace_log(std::string_view function_name_, std::string_view msg_) + : function_name(function_name_), msg(msg_) {} static constexpr event_level level{event_level::trace}; static constexpr std::string_view name{"trace_log"}; diff --git a/repertory/librepertory/include/events/types/unmount_requested.hpp b/repertory/librepertory/include/events/types/unmount_requested.hpp index ab470889..a16db278 100644 --- a/repertory/librepertory/include/events/types/unmount_requested.hpp +++ b/repertory/librepertory/include/events/types/unmount_requested.hpp @@ -29,7 +29,7 @@ namespace repertory { struct unmount_requested final : public i_event { unmount_requested() = default; unmount_requested(std::string_view function_name_) - : function_name(std::string(function_name_)) {} + : function_name(function_name_) {} static constexpr event_level level{event_level::info}; static constexpr std::string_view name{"unmount_requested"}; diff --git a/repertory/librepertory/include/events/types/unmount_result.hpp b/repertory/librepertory/include/events/types/unmount_result.hpp index 1ae99aea..1ba18f38 100644 --- a/repertory/librepertory/include/events/types/unmount_result.hpp +++ b/repertory/librepertory/include/events/types/unmount_result.hpp @@ -29,10 +29,10 @@ namespace repertory { struct unmount_result final : public i_event { unmount_result() = default; - unmount_result(std::string_view function_name_, std::string mount_location_, - std::int32_t result_) - : function_name(std::string(function_name_)), - mount_location(std::move(mount_location_)), + unmount_result(std::string_view function_name_, + std::string_view mount_location_, std::int32_t result_) + : function_name(function_name_), + mount_location(mount_location_), result(result_) {} static constexpr event_level level{event_level::info}; diff --git a/repertory/librepertory/include/events/types/warn_log.hpp b/repertory/librepertory/include/events/types/warn_log.hpp index f75d48ad..ba127ba1 100644 --- a/repertory/librepertory/include/events/types/warn_log.hpp +++ b/repertory/librepertory/include/events/types/warn_log.hpp @@ -28,8 +28,8 @@ namespace repertory { struct warn_log final : public i_event { warn_log() = default; - warn_log(std::string_view function_name_, std::string msg_) - : function_name(std::string(function_name_)), msg(std::move(msg_)) {} + warn_log(std::string_view function_name_, std::string_view msg_) + : function_name(function_name_), msg(msg_) {} static constexpr event_level level{event_level::warn}; static constexpr std::string_view name{"warn_log"}; diff --git a/repertory/librepertory/include/events/types/winfsp_event.hpp b/repertory/librepertory/include/events/types/winfsp_event.hpp index 21fb01df..7d0391bd 100644 --- a/repertory/librepertory/include/events/types/winfsp_event.hpp +++ b/repertory/librepertory/include/events/types/winfsp_event.hpp @@ -29,11 +29,9 @@ namespace repertory { struct winfsp_event final : public i_event { winfsp_event() = default; - winfsp_event(std::string api_path_, NTSTATUS error_, + winfsp_event(std::string_view api_path_, NTSTATUS error_, std::string_view function_name_) - : api_path(std::move(api_path_)), - error(error_), - function_name(std::string{function_name_}) {} + : api_path(api_path_), error(error_), function_name(function_name_) {} static constexpr event_level level{event_level::debug}; static constexpr std::string_view name{"winfsp_event"}; diff --git a/repertory/librepertory/include/file_manager/file_manager.hpp b/repertory/librepertory/include/file_manager/file_manager.hpp index 56ac87b4..d48ad3d0 100644 --- a/repertory/librepertory/include/file_manager/file_manager.hpp +++ b/repertory/librepertory/include/file_manager/file_manager.hpp @@ -81,27 +81,27 @@ private: bool &is_unlinked) const -> std::shared_ptr; - [[nodiscard]] auto get_open_file_count(const std::string &api_path) const + [[nodiscard]] auto get_open_file_count(std::string_view api_path) const -> std::size_t; [[nodiscard]] auto get_stop_requested() const -> bool; - [[nodiscard]] auto open(const std::string &api_path, bool directory, + [[nodiscard]] auto open(std::string_view api_path, bool directory, const open_file_data &ofd, std::uint64_t &handle, std::shared_ptr &file, std::shared_ptr closeable_file) -> api_error; - void queue_upload(const std::string &api_path, const std::string &source_path, + void queue_upload(std::string_view api_path, std::string_view source_path, bool is_unlinked, bool no_lock); - void remove_resume(const std::string &api_path, - const std::string &source_path, bool no_lock); + void remove_resume(std::string_view api_path, std::string_view source_path, + bool no_lock); - void remove_upload(const std::string &api_path, bool no_lock); + void remove_upload(std::string_view api_path, bool no_lock); - void swap_renamed_items(std::string from_api_path, std::string to_api_path, - bool directory); + void swap_renamed_items(std::string_view from_api_path, + std::string_view to_api_path, bool directory); void upload_completed(const file_upload_completed &evt); @@ -110,43 +110,43 @@ private: public: [[nodiscard]] auto get_next_handle() -> std::uint64_t; - auto handle_file_rename(const std::string &from_api_path, - const std::string &to_api_path) -> api_error; + auto handle_file_rename(std::string_view from_api_path, + std::string_view to_api_path) -> api_error; void queue_upload(const i_open_file &file) override; - void remove_resume(const std::string &api_path, - const std::string &source_path) override; + void remove_resume(std::string_view api_path, + std::string_view source_path) override; - static auto remove_source_and_shrink_cache(const std::string &api_path, - const std::string &source_path, + static auto remove_source_and_shrink_cache(std::string_view api_path, + std::string_view source_path, std::uint64_t file_size, bool allocated) -> bool; - void remove_upload(const std::string &api_path) override; + void remove_upload(std::string_view api_path) override; void store_resume(const i_open_file &file) override; public: void close(std::uint64_t handle); - [[nodiscard]] auto create(const std::string &api_path, api_meta_map &meta, + [[nodiscard]] auto create(std::string_view api_path, api_meta_map &meta, open_file_data ofd, std::uint64_t &handle, std::shared_ptr &file) -> api_error; - [[nodiscard]] auto download_pinned_file(const std::string &api_path) + [[nodiscard]] auto download_pinned_file(std::string_view api_path) -> bool override; - [[nodiscard]] auto evict_file(const std::string &api_path) -> bool override; + [[nodiscard]] auto evict_file(std::string_view api_path) -> bool override; - [[nodiscard]] auto get_directory_item(const std::string &api_path, + [[nodiscard]] auto get_directory_item(std::string_view api_path, directory_item &item) const -> api_error override; - [[nodiscard]] auto get_directory_items(const std::string &api_path) const + [[nodiscard]] auto get_directory_items(std::string_view api_path) const -> directory_item_list override; - [[nodiscard]] auto get_open_file(const std::string &api_path, + [[nodiscard]] auto get_open_file(std::string_view api_path, std::shared_ptr &file) -> bool; [[nodiscard]] auto get_open_file(std::uint64_t handle, bool write_supported, @@ -164,7 +164,7 @@ public: [[nodiscard]] auto has_no_open_file_handles() const -> bool override; - [[nodiscard]] auto is_processing(const std::string &api_path) const + [[nodiscard]] auto is_processing(std::string_view api_path) const -> bool override; #if defined(PROJECT_TESTING) @@ -172,20 +172,20 @@ public: const open_file_data &ofd, std::uint64_t &handle, std::shared_ptr &file) -> api_error; #endif // defined(PROJECT_TESTING) - [[nodiscard]] auto open(const std::string &api_path, bool directory, + [[nodiscard]] auto open(std::string_view api_path, bool directory, const open_file_data &ofd, std::uint64_t &handle, std::shared_ptr &file) -> api_error; - [[nodiscard]] auto remove_directory(const std::string &api_path) -> api_error; + [[nodiscard]] auto remove_directory(std::string_view api_path) -> api_error; - [[nodiscard]] auto remove_file(const std::string &api_path) -> api_error; + [[nodiscard]] auto remove_file(std::string_view api_path) -> api_error; - [[nodiscard]] auto rename_directory(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] auto rename_directory(std::string_view from_api_path, + std::string_view to_api_path) -> api_error; - [[nodiscard]] auto rename_file(const std::string &from_api_path, - const std::string &to_api_path, bool overwrite) + [[nodiscard]] auto rename_file(std::string_view from_api_path, + std::string_view to_api_path, bool overwrite) -> api_error; void start(); diff --git a/repertory/librepertory/include/file_manager/i_file_manager.hpp b/repertory/librepertory/include/file_manager/i_file_manager.hpp index 1484a568..b3f5b9d2 100644 --- a/repertory/librepertory/include/file_manager/i_file_manager.hpp +++ b/repertory/librepertory/include/file_manager/i_file_manager.hpp @@ -31,18 +31,17 @@ class i_file_manager { INTERFACE_SETUP(i_file_manager); public: - [[nodiscard]] virtual auto download_pinned_file(const std::string &api_path) + [[nodiscard]] virtual auto download_pinned_file(std::string_view api_path) -> bool = 0; - [[nodiscard]] virtual auto evict_file(const std::string &api_path) - -> bool = 0; + [[nodiscard]] virtual auto evict_file(std::string_view api_path) -> bool = 0; - [[nodiscard]] virtual auto get_directory_item(const std::string &api_path, + [[nodiscard]] virtual auto get_directory_item(std::string_view api_path, directory_item &item) const -> api_error = 0; [[nodiscard]] virtual auto - get_directory_items(const std::string &api_path) const + get_directory_items(std::string_view api_path) const -> directory_item_list = 0; [[nodiscard]] virtual auto get_open_files() const @@ -50,7 +49,7 @@ public: [[nodiscard]] virtual auto has_no_open_file_handles() const -> bool = 0; - [[nodiscard]] virtual auto is_processing(const std::string &api_path) const + [[nodiscard]] virtual auto is_processing(std::string_view api_path) const -> bool = 0; }; } // namespace repertory diff --git a/repertory/librepertory/include/file_manager/i_open_file.hpp b/repertory/librepertory/include/file_manager/i_open_file.hpp index 6d6bdef7..cfdcd4d1 100644 --- a/repertory/librepertory/include/file_manager/i_open_file.hpp +++ b/repertory/librepertory/include/file_manager/i_open_file.hpp @@ -90,7 +90,7 @@ public: [[nodiscard]] virtual auto resize(std::uint64_t new_file_size) -> api_error = 0; - virtual void set_api_path(const std::string &api_path) = 0; + virtual void set_api_path(std::string_view api_path) = 0; [[nodiscard]] virtual auto write(std::uint64_t write_offset, const data_buffer &data, diff --git a/repertory/librepertory/include/file_manager/i_upload_manager.hpp b/repertory/librepertory/include/file_manager/i_upload_manager.hpp index e66d77d6..309ea612 100644 --- a/repertory/librepertory/include/file_manager/i_upload_manager.hpp +++ b/repertory/librepertory/include/file_manager/i_upload_manager.hpp @@ -31,10 +31,10 @@ class i_upload_manager { public: virtual void queue_upload(const i_open_file &file) = 0; - virtual void remove_resume(const std::string &api_path, - const std::string &source_path) = 0; + virtual void remove_resume(std::string_view api_path, + std::string_view source_path) = 0; - virtual void remove_upload(const std::string &api_path) = 0; + virtual void remove_upload(std::string_view api_path) = 0; virtual void store_resume(const i_open_file &file) = 0; }; diff --git a/repertory/librepertory/include/file_manager/open_file_base.hpp b/repertory/librepertory/include/file_manager/open_file_base.hpp index 5cb866d9..f306b04b 100644 --- a/repertory/librepertory/include/file_manager/open_file_base.hpp +++ b/repertory/librepertory/include/file_manager/open_file_base.hpp @@ -220,7 +220,7 @@ public: void remove_all() override; - void set_api_path(const std::string &api_path) override; + void set_api_path(std::string_view api_path) override; void set_unlinked(bool value) override; diff --git a/repertory/librepertory/include/file_manager/ring_buffer_base.hpp b/repertory/librepertory/include/file_manager/ring_buffer_base.hpp index 7da05a35..1026ee71 100644 --- a/repertory/librepertory/include/file_manager/ring_buffer_base.hpp +++ b/repertory/librepertory/include/file_manager/ring_buffer_base.hpp @@ -139,7 +139,7 @@ public: void set(std::size_t first_chunk, std::size_t current_chunk); - void set_api_path(const std::string &api_path) override; + void set_api_path(std::string_view api_path) override; [[nodiscard]] auto write(std::uint64_t /* write_offset */, const data_buffer & /* data */, diff --git a/repertory/librepertory/include/platform/unix_platform.hpp b/repertory/librepertory/include/platform/unix_platform.hpp index 96f239eb..7e6ec5f6 100644 --- a/repertory/librepertory/include/platform/unix_platform.hpp +++ b/repertory/librepertory/include/platform/unix_platform.hpp @@ -30,7 +30,7 @@ class i_provider; class lock_data final { public: - lock_data(std::string data_directory, provider_type prov, + lock_data(std::string_view data_directory, provider_type prov, std::string_view unique_id); lock_data(const lock_data &) = delete; @@ -73,13 +73,14 @@ public: -> bool; }; -[[nodiscard]] auto create_meta_attributes( - std::uint64_t accessed_date, std::uint32_t attributes, - std::uint64_t changed_date, std::uint64_t creation_date, bool directory, - std::uint32_t gid, const std::string &key, std::uint32_t mode, - std::uint64_t modified_date, std::uint32_t osx_flags, std::uint64_t size, - const std::string &source_path, std::uint32_t uid, - std::uint64_t written_date) -> api_meta_map; +[[nodiscard]] auto +create_meta_attributes(std::uint64_t accessed_date, std::uint32_t attributes, + std::uint64_t changed_date, std::uint64_t creation_date, + bool directory, std::uint32_t gid, std::string_view key, + std::uint32_t mode, std::uint64_t modified_date, + std::uint32_t osx_flags, std::uint64_t size, + std::string_view source_path, std::uint32_t uid, + std::uint64_t written_date) -> api_meta_map; [[nodiscard]] auto provider_meta_creator(bool directory, const api_file &file) -> api_meta_map; diff --git a/repertory/librepertory/include/platform/win32_platform.hpp b/repertory/librepertory/include/platform/win32_platform.hpp index c629e0b0..7c488bc4 100644 --- a/repertory/librepertory/include/platform/win32_platform.hpp +++ b/repertory/librepertory/include/platform/win32_platform.hpp @@ -60,13 +60,14 @@ public: std::int64_t pid) -> bool; }; -[[nodiscard]] auto create_meta_attributes( - std::uint64_t accessed_date, std::uint32_t attributes, - std::uint64_t changed_date, std::uint64_t creation_date, bool directory, - std::uint32_t gid, const std::string &key, std::uint32_t mode, - std::uint64_t modified_date, std::uint32_t osx_flags, std::uint64_t size, - const std::string &source_path, std::uint32_t uid, - std::uint64_t written_date) -> api_meta_map; +[[nodiscard]] auto +create_meta_attributes(std::uint64_t accessed_date, std::uint32_t attributes, + std::uint64_t changed_date, std::uint64_t creation_date, + bool directory, std::uint32_t gid, std::string_view key, + std::uint32_t mode, std::uint64_t modified_date, + std::uint32_t osx_flags, std::uint64_t size, + std::string_view source_path, std::uint32_t uid, + std::uint64_t written_date) -> api_meta_map; [[nodiscard]] auto provider_meta_creator(bool directory, const api_file &file) -> api_meta_map; diff --git a/repertory/librepertory/include/providers/base_provider.hpp b/repertory/librepertory/include/providers/base_provider.hpp index 93726a98..6cd55e97 100644 --- a/repertory/librepertory/include/providers/base_provider.hpp +++ b/repertory/librepertory/include/providers/base_provider.hpp @@ -68,22 +68,21 @@ private: void remove_unmatched_source_files(stop_type &stop_requested); protected: - [[nodiscard]] static auto create_api_file(std::string path, std::string key, - std::uint64_t size, - std::uint64_t file_time) - -> api_file; + [[nodiscard]] static auto + create_api_file(std::string_view path, std::string_view key, + std::uint64_t size, std::uint64_t file_time) -> api_file; - [[nodiscard]] static auto create_api_file(std::string path, + [[nodiscard]] static auto create_api_file(std::string_view path, std::uint64_t size, api_meta_map &meta) -> api_file; - [[nodiscard]] virtual auto create_directory_impl(const std::string &api_path, + [[nodiscard]] virtual auto create_directory_impl(std::string_view api_path, api_meta_map &meta) -> api_error = 0; - [[nodiscard]] virtual auto - create_file_extra(const std::string & /* api_path */, - api_meta_map & /* meta */) -> api_error { + [[nodiscard]] virtual auto create_file_extra(std::string_view /* api_path */, + api_meta_map & /* meta */) + -> api_error { return api_error::success; } @@ -111,7 +110,7 @@ protected: [[nodiscard]] auto get_db() const -> const i_meta_db & { return *meta_db_; } [[nodiscard]] virtual auto - get_directory_items_impl(const std::string &api_path, + get_directory_items_impl(std::string_view api_path, directory_item_list &list) const -> api_error = 0; [[nodiscard]] auto get_file_mgr() -> i_file_manager * { return fm_; } @@ -120,61 +119,61 @@ protected: return fm_; } - [[nodiscard]] virtual auto remove_directory_impl(const std::string &api_path) + [[nodiscard]] virtual auto remove_directory_impl(std::string_view api_path) -> api_error = 0; - [[nodiscard]] virtual auto remove_file_impl(const std::string &api_path) + [[nodiscard]] virtual auto remove_file_impl(std::string_view api_path) -> api_error = 0; - [[nodiscard]] virtual auto upload_file_impl(const std::string &api_path, - const std::string &source_path, + [[nodiscard]] virtual auto upload_file_impl(std::string_view api_path, + std::string_view source_path, stop_type &stop_requested) -> api_error = 0; public: [[nodiscard]] auto - create_directory_clone_source_meta(const std::string &source_api_path, - const std::string &api_path) + create_directory_clone_source_meta(std::string_view source_api_path, + std::string_view api_path) -> api_error override; - [[nodiscard]] auto create_directory(const std::string &api_path, + [[nodiscard]] auto create_directory(std::string_view api_path, api_meta_map &meta) -> api_error override; - [[nodiscard]] auto create_file(const std::string &api_path, - api_meta_map &meta) -> api_error override; + [[nodiscard]] auto create_file(std::string_view api_path, api_meta_map &meta) + -> api_error override; - [[nodiscard]] auto get_api_path_from_source(const std::string &source_path, + [[nodiscard]] auto get_api_path_from_source(std::string_view source_path, std::string &api_path) const -> api_error override; - [[nodiscard]] auto get_directory_item(const std::string &api_path, + [[nodiscard]] auto get_directory_item(std::string_view api_path, directory_item &item) const -> api_error override; - [[nodiscard]] auto get_directory_items(const std::string &api_path, + [[nodiscard]] auto get_directory_items(std::string_view api_path, directory_item_list &list) const -> api_error override; - [[nodiscard]] auto get_file_size(const std::string &api_path, + [[nodiscard]] auto get_file_size(std::string_view api_path, std::uint64_t &file_size) const -> api_error override; - [[nodiscard]] auto get_filesystem_item(const std::string &api_path, + [[nodiscard]] auto get_filesystem_item(std::string_view api_path, bool directory, filesystem_item &fsi) const -> api_error override; [[nodiscard]] auto - get_filesystem_item_from_source_path(const std::string &source_path, + get_filesystem_item_from_source_path(std::string_view source_path, filesystem_item &fsi) const -> api_error override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, + [[nodiscard]] auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, - const std::string &key, + [[nodiscard]] auto get_item_meta(std::string_view api_path, + std::string_view key, std::string &value) const -> api_error override; @@ -187,31 +186,30 @@ public: [[nodiscard]] auto is_read_only() const -> bool override { return false; } - [[nodiscard]] auto remove_directory(const std::string &api_path) + [[nodiscard]] auto remove_directory(std::string_view api_path) -> api_error override; - [[nodiscard]] auto remove_file(const std::string &api_path) + [[nodiscard]] auto remove_file(std::string_view api_path) -> api_error override; - [[nodiscard]] auto remove_item_meta(const std::string &api_path, - const std::string &key) + [[nodiscard]] auto remove_item_meta(std::string_view api_path, + std::string_view key) -> api_error override; - [[nodiscard]] auto set_item_meta(const std::string &api_path, - const std::string &key, - const std::string &value) + [[nodiscard]] auto set_item_meta(std::string_view api_path, + std::string_view key, std::string_view value) -> api_error override; - [[nodiscard]] auto set_item_meta(const std::string &api_path, - api_meta_map meta) -> api_error override; + [[nodiscard]] auto set_item_meta(std::string_view api_path, api_meta_map meta) + -> api_error override; [[nodiscard]] auto start(api_item_added_callback api_item_added, i_file_manager *mgr) -> bool override; void stop() override; - [[nodiscard]] auto upload_file(const std::string &api_path, - const std::string &source_path, + [[nodiscard]] auto upload_file(std::string_view api_path, + std::string_view source_path, stop_type &stop_requested) -> api_error override; }; diff --git a/repertory/librepertory/include/providers/encrypt/encrypt_provider.hpp b/repertory/librepertory/include/providers/encrypt/encrypt_provider.hpp index 30b9bf84..2a861086 100644 --- a/repertory/librepertory/include/providers/encrypt/encrypt_provider.hpp +++ b/repertory/librepertory/include/providers/encrypt/encrypt_provider.hpp @@ -63,18 +63,18 @@ private: std::recursive_mutex reader_lookup_mtx_; private: - [[nodiscard]] static auto create_api_file(const std::string &api_path, + [[nodiscard]] static auto create_api_file(std::string_view api_path, bool directory, - const std::string &source_path) + std::string_view source_path) -> api_file; static void create_item_meta(api_meta_map &meta, bool directory, const api_file &file); [[nodiscard]] auto do_fs_operation( - const std::string &api_path, bool directory, + std::string_view api_path, bool directory, std::function callback) const + std::string_view source_path)> callback) const -> api_error; [[nodiscard]] auto get_encrypt_config() const -> const encrypt_config & { @@ -97,68 +97,67 @@ public: return true; } - [[nodiscard]] auto create_directory(const std::string &api_path, + [[nodiscard]] auto create_directory(std::string_view api_path, api_meta_map &meta) -> api_error override; [[nodiscard]] auto - create_directory_clone_source_meta(const std::string & /*source_api_path*/, - const std::string & /*api_path*/) + create_directory_clone_source_meta(std::string_view /*source_api_path*/, + std::string_view /*api_path*/) -> api_error override { return api_error::not_implemented; } - [[nodiscard]] auto create_file(const std::string & /*api_path*/, + [[nodiscard]] auto create_file(std::string_view /*api_path*/, api_meta_map & /*meta*/) -> api_error override { return api_error::not_implemented; } - [[nodiscard]] auto - get_api_path_from_source(const std::string & /*source_path*/, - std::string & /*api_path*/) const + [[nodiscard]] auto get_api_path_from_source(std::string_view /*source_path*/, + std::string & /*api_path*/) const -> api_error override; - [[nodiscard]] auto get_directory_item_count(const std::string &api_path) const + [[nodiscard]] auto get_directory_item_count(std::string_view api_path) const -> std::uint64_t override; - [[nodiscard]] auto get_directory_item(const std::string &api_path, + [[nodiscard]] auto get_directory_item(std::string_view api_path, directory_item &item) const -> api_error override; - [[nodiscard]] auto get_directory_items(const std::string &api_path, + [[nodiscard]] auto get_directory_items(std::string_view api_path, directory_item_list &list) const -> api_error override; - [[nodiscard]] auto get_file(const std::string &api_path, api_file &file) const + [[nodiscard]] auto get_file(std::string_view api_path, api_file &file) const -> api_error override; [[nodiscard]] auto get_file_list(api_file_list &list, std::string &marker) const -> api_error override; - [[nodiscard]] auto get_file_size(const std::string &api_path, + [[nodiscard]] auto get_file_size(std::string_view api_path, std::uint64_t &file_size) const -> api_error override; - [[nodiscard]] auto get_filesystem_item(const std::string &api_path, + [[nodiscard]] auto get_filesystem_item(std::string_view api_path, bool directory, filesystem_item &fsi) const -> api_error override; [[nodiscard]] auto - get_filesystem_item_from_source_path(const std::string &source_path, + get_filesystem_item_from_source_path(std::string_view source_path, filesystem_item &fsi) const -> api_error override; [[nodiscard]] auto get_pinned_files() const -> std::vector override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, + [[nodiscard]] auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error override; - [[nodiscard]] auto get_item_meta(const std::string &api_path, - const std::string &key, + [[nodiscard]] auto get_item_meta(std::string_view api_path, + std::string_view key, std::string &value) const -> api_error override; @@ -172,10 +171,10 @@ public: [[nodiscard]] auto get_used_drive_space() const -> std::uint64_t override; - [[nodiscard]] auto is_directory(const std::string &api_path, - bool &exists) const -> api_error override; + [[nodiscard]] auto is_directory(std::string_view api_path, bool &exists) const + -> api_error override; - [[nodiscard]] auto is_file(const std::string &api_path, bool &exists) const + [[nodiscard]] auto is_file(std::string_view api_path, bool &exists) const -> api_error override; [[nodiscard]] auto is_online() const -> bool override; @@ -186,40 +185,40 @@ public: return false; } - [[nodiscard]] auto read_file_bytes(const std::string &api_path, + [[nodiscard]] auto read_file_bytes(std::string_view api_path, std::size_t size, std::uint64_t offset, data_buffer &data, stop_type &stop_requested) -> api_error override; - [[nodiscard]] auto remove_directory(const std::string & /*api_path*/) + [[nodiscard]] auto remove_directory(std::string_view /*api_path*/) -> api_error override { return api_error::not_implemented; } - [[nodiscard]] auto remove_file(const std::string & /*api_path*/) + [[nodiscard]] auto remove_file(std::string_view /*api_path*/) -> api_error override { return api_error::not_implemented; } - [[nodiscard]] auto remove_item_meta(const std::string &api_path, - const std::string &key) + [[nodiscard]] auto remove_item_meta(std::string_view api_path, + std::string_view key) -> api_error override; - [[nodiscard]] auto rename_file(const std::string & /*from_api_path*/, - const std::string & /*to_api_path*/) + [[nodiscard]] auto rename_file(std::string_view /*from_api_path*/, + std::string_view /*to_api_path*/) -> api_error override { return api_error::not_implemented; } - [[nodiscard]] auto set_item_meta(const std::string & /*api_path*/, - const std::string & /*key*/, - const std::string & /*value*/) + [[nodiscard]] auto set_item_meta(std::string_view /*api_path*/, + std::string_view /*key*/, + std::string_view /*value*/) -> api_error override { return api_error::success; } - [[nodiscard]] auto set_item_meta(const std::string & /*api_path*/, + [[nodiscard]] auto set_item_meta(std::string_view /*api_path*/, api_meta_map /*meta*/) -> api_error override { return api_error::success; @@ -230,8 +229,8 @@ public: void stop() override; - [[nodiscard]] auto upload_file(const std::string & /*api_path*/, - const std::string & /*source_path*/, + [[nodiscard]] auto upload_file(std::string_view /*api_path*/, + std::string_view /*source_path*/, stop_type & /*stop_requested*/) -> api_error override { return api_error::not_implemented; diff --git a/repertory/librepertory/include/providers/i_provider.hpp b/repertory/librepertory/include/providers/i_provider.hpp index 3c9587cc..09cb0463 100644 --- a/repertory/librepertory/include/providers/i_provider.hpp +++ b/repertory/librepertory/include/providers/i_provider.hpp @@ -35,61 +35,61 @@ public: std::string &returned_version) const -> bool = 0; - [[nodiscard]] virtual auto create_directory(const std::string &api_path, + [[nodiscard]] virtual auto create_directory(std::string_view api_path, api_meta_map &meta) -> api_error = 0; [[nodiscard]] virtual auto - create_directory_clone_source_meta(const std::string &source_api_path, - const std::string &api_path) + create_directory_clone_source_meta(std::string_view source_api_path, + std::string_view api_path) -> api_error = 0; - [[nodiscard]] virtual auto create_file(const std::string &api_path, + [[nodiscard]] virtual auto create_file(std::string_view api_path, api_meta_map &meta) -> api_error = 0; [[nodiscard]] virtual auto - get_api_path_from_source(const std::string &source_path, + get_api_path_from_source(std::string_view source_path, std::string &api_path) const -> api_error = 0; [[nodiscard]] virtual auto - get_directory_item_count(const std::string &api_path) const + get_directory_item_count(std::string_view api_path) const -> std::uint64_t = 0; - [[nodiscard]] virtual auto get_directory_item(const std::string &api_path, + [[nodiscard]] virtual auto get_directory_item(std::string_view api_path, directory_item &list) const -> api_error = 0; [[nodiscard]] virtual auto - get_directory_items(const std::string &api_path, + get_directory_items(std::string_view api_path, directory_item_list &list) const -> api_error = 0; - [[nodiscard]] virtual auto get_file(const std::string &api_path, + [[nodiscard]] virtual auto get_file(std::string_view api_path, api_file &file) const -> api_error = 0; [[nodiscard]] virtual auto get_file_list(api_file_list &list, std::string &marker) const -> api_error = 0; - [[nodiscard]] virtual auto get_file_size(const std::string &api_path, + [[nodiscard]] virtual auto get_file_size(std::string_view api_path, std::uint64_t &file_size) const -> api_error = 0; - [[nodiscard]] virtual auto get_filesystem_item(const std::string &api_path, + [[nodiscard]] virtual auto get_filesystem_item(std::string_view api_path, bool directory, filesystem_item &fsi) const -> api_error = 0; [[nodiscard]] virtual auto - get_filesystem_item_from_source_path(const std::string &source_path, + get_filesystem_item_from_source_path(std::string_view source_path, filesystem_item &fsi) const -> api_error = 0; - [[nodiscard]] virtual auto get_item_meta(const std::string &api_path, + [[nodiscard]] virtual auto get_item_meta(std::string_view api_path, api_meta_map &meta) const -> api_error = 0; - [[nodiscard]] virtual auto get_item_meta(const std::string &api_path, - const std::string &key, + [[nodiscard]] virtual auto get_item_meta(std::string_view api_path, + std::string_view key, std::string &value) const -> api_error = 0; @@ -104,10 +104,10 @@ public: [[nodiscard]] virtual auto get_used_drive_space() const -> std::uint64_t = 0; - [[nodiscard]] virtual auto is_directory(const std::string &api_path, + [[nodiscard]] virtual auto is_directory(std::string_view api_path, bool &exists) const -> api_error = 0; - [[nodiscard]] virtual auto is_file(const std::string &api_path, + [[nodiscard]] virtual auto is_file(std::string_view api_path, bool &exists) const -> api_error = 0; [[nodiscard]] virtual auto is_online() const -> bool = 0; @@ -117,30 +117,30 @@ public: [[nodiscard]] virtual auto is_rename_supported() const -> bool = 0; [[nodiscard]] virtual auto - read_file_bytes(const std::string &api_path, std::size_t size, + read_file_bytes(std::string_view api_path, std::size_t size, std::uint64_t offset, data_buffer &data, stop_type &stop_requested) -> api_error = 0; - [[nodiscard]] virtual auto remove_directory(const std::string &api_path) + [[nodiscard]] virtual auto remove_directory(std::string_view api_path) -> api_error = 0; - [[nodiscard]] virtual auto remove_file(const std::string &api_path) + [[nodiscard]] virtual auto remove_file(std::string_view api_path) -> api_error = 0; - [[nodiscard]] virtual auto remove_item_meta(const std::string &api_path, - const std::string &key) + [[nodiscard]] virtual auto remove_item_meta(std::string_view api_path, + std::string_view key) -> api_error = 0; - [[nodiscard]] virtual auto rename_file(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] virtual auto rename_file(std::string_view from_api_path, + std::string_view to_api_path) -> api_error = 0; - [[nodiscard]] virtual auto set_item_meta(const std::string &api_path, - const std::string &key, - const std::string &value) + [[nodiscard]] virtual auto set_item_meta(std::string_view api_path, + std::string_view key, + std::string_view value) -> api_error = 0; - [[nodiscard]] virtual auto set_item_meta(const std::string &api_path, + [[nodiscard]] virtual auto set_item_meta(std::string_view api_path, api_meta_map meta) -> api_error = 0; [[nodiscard]] virtual auto start(api_item_added_callback api_item_added, @@ -148,8 +148,8 @@ public: virtual void stop() = 0; - [[nodiscard]] virtual auto upload_file(const std::string &api_path, - const std::string &source_path, + [[nodiscard]] virtual auto upload_file(std::string_view api_path, + std::string_view source_path, stop_type &stop_requested) -> api_error = 0; }; diff --git a/repertory/librepertory/include/providers/s3/s3_provider.hpp b/repertory/librepertory/include/providers/s3/s3_provider.hpp index eeb78d52..7b49be16 100644 --- a/repertory/librepertory/include/providers/s3/s3_provider.hpp +++ b/repertory/librepertory/include/providers/s3/s3_provider.hpp @@ -36,8 +36,8 @@ struct head_object_result; class s3_provider final : public base_provider { private: using interate_callback_t = std::function; + std::string_view prefix, const pugi::xml_node &node, + std::string_view api_prefix)>; public: static const constexpr auto type{provider_type::s3}; @@ -63,18 +63,18 @@ private: private: [[nodiscard]] auto add_if_not_found(api_file &file, - const std::string &object_name) const + std::string_view object_name) const -> api_error; - [[nodiscard]] auto - create_directory_object(const std::string &api_path, - const std::string &object_name) const -> api_error; - - [[nodiscard]] auto create_directory_paths(const std::string &api_path, - const std::string &key) const + [[nodiscard]] auto create_directory_object(std::string_view api_path, + std::string_view object_name) const -> api_error; - [[nodiscard]] auto create_file_extra(const std::string &api_path, + [[nodiscard]] auto create_directory_paths(std::string_view api_path, + std::string_view key) const + -> api_error; + + [[nodiscard]] auto create_file_extra(std::string_view api_path, api_meta_map &meta) -> api_error override; @@ -82,25 +82,25 @@ private: -> api_error; [[nodiscard]] auto - get_kdf_config_from_meta(const std::string &api_path, + get_kdf_config_from_meta(std::string_view api_path, utils::encryption::kdf_config &cfg) const -> api_error; [[nodiscard]] auto get_last_modified(bool directory, - const std::string &api_path, + std::string_view api_path, std::uint64_t &last_modified) const -> api_error; [[nodiscard]] auto - get_object_info(bool directory, const std::string &api_path, - bool &is_encrypted, std::string &object_name, - head_object_result &result) const -> api_error; + get_object_info(bool directory, std::string_view api_path, bool &is_encrypted, + std::string &object_name, head_object_result &result) const + -> api_error; [[nodiscard]] auto get_object_list(std::string &response_data, long &response_code, - std::optional delimiter = std::nullopt, - std::optional prefix = std::nullopt, - std::optional token = std::nullopt) const + std::optional delimiter = std::nullopt, + std::optional prefix = std::nullopt, + std::optional token = std::nullopt) const -> bool; [[nodiscard]] auto get_s3_config() const -> const s3_config & { @@ -111,28 +111,28 @@ private: -> bool; [[nodiscard]] auto - search_keys_for_master_kdf(const std::string &encryption_token) -> bool; + search_keys_for_master_kdf(std::string_view encryption_token) -> bool; - [[nodiscard]] auto set_meta_key(const std::string &api_path, - api_meta_map &meta) -> api_error; + [[nodiscard]] auto set_meta_key(std::string_view api_path, api_meta_map &meta) + -> api_error; protected: - [[nodiscard]] auto create_directory_impl(const std::string &api_path, + [[nodiscard]] auto create_directory_impl(std::string_view api_path, api_meta_map &meta) -> api_error override; - [[nodiscard]] auto get_directory_items_impl(const std::string &api_path, + [[nodiscard]] auto get_directory_items_impl(std::string_view api_path, directory_item_list &list) const -> api_error override; - [[nodiscard]] auto remove_directory_impl(const std::string &api_path) + [[nodiscard]] auto remove_directory_impl(std::string_view api_path) -> api_error override; - [[nodiscard]] auto remove_file_impl(const std::string &api_path) + [[nodiscard]] auto remove_file_impl(std::string_view api_path) -> api_error override; - [[nodiscard]] auto upload_file_impl(const std::string &api_path, - const std::string &source_path, + [[nodiscard]] auto upload_file_impl(std::string_view api_path, + std::string_view source_path, stop_type &stop_requested) -> api_error override; @@ -147,10 +147,10 @@ public: [[nodiscard]] static auto convert_api_date(std::string_view date) -> std::uint64_t; - [[nodiscard]] auto get_directory_item_count(const std::string &api_path) const + [[nodiscard]] auto get_directory_item_count(std::string_view api_path) const -> std::uint64_t override; - [[nodiscard]] auto get_file(const std::string &api_path, api_file &file) const + [[nodiscard]] auto get_file(std::string_view api_path, api_file &file) const -> api_error override; [[nodiscard]] auto get_file_list(api_file_list &list, @@ -163,10 +163,10 @@ public: return type; } - [[nodiscard]] auto is_directory(const std::string &api_path, - bool &exists) const -> api_error override; + [[nodiscard]] auto is_directory(std::string_view api_path, bool &exists) const + -> api_error override; - [[nodiscard]] auto is_file(const std::string &api_path, bool &exists) const + [[nodiscard]] auto is_file(std::string_view api_path, bool &exists) const -> api_error override; [[nodiscard]] auto is_online() const -> bool override; @@ -175,19 +175,19 @@ public: return false; }; - [[nodiscard]] auto iterate_prefix(const std::string &prefix, + [[nodiscard]] auto iterate_prefix(std::string_view prefix, interate_callback_t prefix_action, interate_callback_t key_action) const -> api_error; - [[nodiscard]] auto read_file_bytes(const std::string &api_path, + [[nodiscard]] auto read_file_bytes(std::string_view api_path, std::size_t size, std::uint64_t offset, data_buffer &data, stop_type &stop_requested) -> api_error override; - [[nodiscard]] auto rename_file(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] auto rename_file(std::string_view from_api_path, + std::string_view to_api_path) -> api_error override; auto start(api_item_added_callback api_item_added, i_file_manager *mgr) diff --git a/repertory/librepertory/include/providers/sia/sia_provider.hpp b/repertory/librepertory/include/providers/sia/sia_provider.hpp index fc564f45..bdc0e2de 100644 --- a/repertory/librepertory/include/providers/sia/sia_provider.hpp +++ b/repertory/librepertory/include/providers/sia/sia_provider.hpp @@ -49,17 +49,17 @@ private: sia_config sia_config_; private: - [[nodiscard]] auto create_directory_key(const std::string &api_path) const + [[nodiscard]] auto create_directory_key(std::string_view api_path) const -> repertory::api_error; - [[nodiscard]] auto ensure_directory_exists(const std::string &api_path) const + [[nodiscard]] auto ensure_directory_exists(std::string_view api_path) const -> api_error; - [[nodiscard]] auto get_object_info(const std::string &api_path, + [[nodiscard]] auto get_object_info(std::string_view api_path, json &object_info) const -> api_error; [[nodiscard]] auto - get_object_list(const std::string &api_path, nlohmann::json &object_list, + get_object_list(std::string_view api_path, nlohmann::json &object_list, std::optional marker = std::nullopt) const -> bool; @@ -68,26 +68,26 @@ private: } void iterate_objects( - const std::string &api_path, const json &object_list, - std::function handle_entry) const; + std::string_view api_path, const json &object_list, + std::function handle_entry) const; protected: - [[nodiscard]] auto create_directory_impl(const std::string &api_path, + [[nodiscard]] auto create_directory_impl(std::string_view api_path, api_meta_map &meta) -> api_error override; - [[nodiscard]] auto get_directory_items_impl(const std::string &api_path, + [[nodiscard]] auto get_directory_items_impl(std::string_view api_path, directory_item_list &list) const -> api_error override; - [[nodiscard]] auto remove_directory_impl(const std::string &api_path) + [[nodiscard]] auto remove_directory_impl(std::string_view api_path) -> api_error override; - [[nodiscard]] auto remove_file_impl(const std::string &api_path) + [[nodiscard]] auto remove_file_impl(std::string_view api_path) -> api_error override; - [[nodiscard]] auto upload_file_impl(const std::string &api_path, - const std::string &source_path, + [[nodiscard]] auto upload_file_impl(std::string_view api_path, + std::string_view source_path, stop_type &stop_requested) -> api_error override; @@ -96,10 +96,10 @@ public: std::string &returned_version) const -> bool override; - [[nodiscard]] auto get_directory_item_count(const std::string &api_path) const + [[nodiscard]] auto get_directory_item_count(std::string_view api_path) const -> std::uint64_t override; - [[nodiscard]] auto get_file(const std::string &api_path, api_file &file) const + [[nodiscard]] auto get_file(std::string_view api_path, api_file &file) const -> api_error override; [[nodiscard]] auto get_file_list(api_file_list &list, @@ -112,10 +112,10 @@ public: [[nodiscard]] auto get_total_drive_space() const -> std::uint64_t override; - [[nodiscard]] auto is_directory(const std::string &api_path, - bool &exists) const -> api_error override; + [[nodiscard]] auto is_directory(std::string_view api_path, bool &exists) const + -> api_error override; - [[nodiscard]] auto is_file(const std::string &api_path, bool &exists) const + [[nodiscard]] auto is_file(std::string_view api_path, bool &exists) const -> api_error override; [[nodiscard]] auto is_online() const -> bool override; @@ -124,14 +124,14 @@ public: return true; } - [[nodiscard]] auto read_file_bytes(const std::string &api_path, + [[nodiscard]] auto read_file_bytes(std::string_view api_path, std::size_t size, std::uint64_t offset, data_buffer &buffer, stop_type &stop_requested) -> api_error override; - [[nodiscard]] auto rename_file(const std::string &from_api_path, - const std::string &to_api_path) + [[nodiscard]] auto rename_file(std::string_view from_api_path, + std::string_view to_api_path) -> api_error override; [[nodiscard]] auto start(api_item_added_callback api_item_added, diff --git a/repertory/librepertory/include/rpc/client/client.hpp b/repertory/librepertory/include/rpc/client/client.hpp index bdb1e8f4..baef3fa8 100644 --- a/repertory/librepertory/include/rpc/client/client.hpp +++ b/repertory/librepertory/include/rpc/client/client.hpp @@ -38,32 +38,31 @@ public: [[nodiscard]] auto get_config() const -> rpc_response; - [[nodiscard]] auto get_config_value_by_name(const std::string &name) const + [[nodiscard]] auto get_config_value_by_name(std::string_view name) const -> rpc_response; - [[nodiscard]] auto get_directory_items(const std::string &api_path) const + [[nodiscard]] auto get_directory_items(std::string_view api_path) const -> rpc_response; - [[nodiscard]] auto get_item_info(const std::string &api_path) const + [[nodiscard]] auto get_item_info(std::string_view api_path) const -> rpc_response; [[nodiscard]] auto get_open_files() const -> rpc_response; [[nodiscard]] auto get_pinned_files() const -> rpc_response; - [[nodiscard]] auto pin_file(const std::string &api_path) const + [[nodiscard]] auto pin_file(std::string_view api_path) const -> rpc_response; + + [[nodiscard]] auto pinned_status(std::string_view api_path) const -> rpc_response; - [[nodiscard]] auto pinned_status(const std::string &api_path) const - -> rpc_response; - - [[nodiscard]] auto set_config_value_by_name(const std::string &name, - const std::string &value) const + [[nodiscard]] auto set_config_value_by_name(std::string_view name, + std::string_view value) const -> rpc_response; [[nodiscard]] auto unmount() const -> rpc_response; - [[nodiscard]] auto unpin_file(const std::string &api_path) const + [[nodiscard]] auto unpin_file(std::string_view api_path) const -> rpc_response; }; } // namespace repertory diff --git a/repertory/librepertory/include/types/repertory.hpp b/repertory/librepertory/include/types/repertory.hpp index 0b8f259e..96aa19dd 100644 --- a/repertory/librepertory/include/types/repertory.hpp +++ b/repertory/librepertory/include/types/repertory.hpp @@ -147,7 +147,7 @@ enum class database_type { sqlite, }; [[nodiscard]] auto -database_type_from_string(std::string type, +database_type_from_string(std::string_view type, database_type default_type = database_type::rocksdb) -> database_type; @@ -160,7 +160,7 @@ enum class download_type { ring_buffer, }; [[nodiscard]] auto -download_type_from_string(std::string type, +download_type_from_string(std::string_view type, download_type default_type = download_type::default_) -> download_type; @@ -177,7 +177,7 @@ enum class event_level { }; [[nodiscard]] auto -event_level_from_string(std::string level, +event_level_from_string(std::string_view type, event_level default_level = event_level::info) -> event_level; diff --git a/repertory/librepertory/include/types/s3.hpp b/repertory/librepertory/include/types/s3.hpp index add306a1..f20954eb 100644 --- a/repertory/librepertory/include/types/s3.hpp +++ b/repertory/librepertory/include/types/s3.hpp @@ -31,16 +31,16 @@ namespace repertory { using get_key_callback = std::function; using get_api_file_token_callback = - std::function; + std::function; using get_name_callback = std::function; + std::string_view key, std::string_view object_name)>; using get_size_callback = std::function; using get_token_callback = std::function; -using set_key_callback = std::function; +using set_key_callback = std::function; using list_directories_result = api_file_list; diff --git a/repertory/librepertory/include/types/startup_exception.hpp b/repertory/librepertory/include/types/startup_exception.hpp index 22d672e0..12132a5d 100644 --- a/repertory/librepertory/include/types/startup_exception.hpp +++ b/repertory/librepertory/include/types/startup_exception.hpp @@ -25,8 +25,8 @@ namespace repertory { class startup_exception : public virtual std::runtime_error { public: - explicit startup_exception(const std::string &msg) - : std::runtime_error(msg) {} + explicit startup_exception(std::string_view msg) + : std::runtime_error(std::string{msg}) {} }; } // namespace repertory diff --git a/repertory/librepertory/include/utils/cli_utils.hpp b/repertory/librepertory/include/utils/cli_utils.hpp index b34cb387..7029736c 100644 --- a/repertory/librepertory/include/utils/cli_utils.hpp +++ b/repertory/librepertory/include/utils/cli_utils.hpp @@ -96,20 +96,20 @@ inline const std::vector