From d86e40ab154d9a87dcf330275980480c9daef8ed Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 29 Apr 2025 14:45:17 -0500 Subject: [PATCH] refactor 'constexpr const'->'constexpr' --- cmake/versions.cmake | 12 +- .../include/comm/packet/client_pool.hpp | 2 +- repertory/librepertory/include/common.hpp | 12 +- .../events/consumers/logging_consumer.hpp | 5 +- .../include/events/event_system.hpp | 4 +- .../include/events/types/curl_error.hpp | 4 +- .../include/events/types/debug_log.hpp | 4 +- .../events/types/directory_remove_failed.hpp | 4 +- .../events/types/directory_removed.hpp | 4 +- .../types/directory_removed_externally.hpp | 4 +- .../include/events/types/download_begin.hpp | 4 +- .../include/events/types/download_end.hpp | 4 +- .../events/types/download_progress.hpp | 4 +- .../events/types/download_restore_failed.hpp | 4 +- .../events/types/download_restored.hpp | 4 +- .../types/download_resume_add_failed.hpp | 4 +- .../events/types/download_resume_added.hpp | 4 +- .../events/types/download_resume_removed.hpp | 4 +- .../events/types/download_type_selected.hpp | 4 +- .../events/types/drive_mount_failed.hpp | 4 +- .../events/types/drive_mount_result.hpp | 4 +- .../include/events/types/drive_mounted.hpp | 4 +- .../events/types/drive_stop_timed_out.hpp | 4 +- .../events/types/drive_unmount_pending.hpp | 4 +- .../include/events/types/drive_unmounted.hpp | 4 +- .../events/types/event_level_changed.hpp | 4 +- .../include/events/types/file_pinned.hpp | 4 +- .../events/types/file_remove_failed.hpp | 4 +- .../include/events/types/file_removed.hpp | 4 +- .../events/types/file_removed_externally.hpp | 4 +- .../include/events/types/file_unpinned.hpp | 4 +- .../events/types/file_upload_completed.hpp | 4 +- .../events/types/file_upload_failed.hpp | 4 +- .../events/types/file_upload_not_found.hpp | 4 +- .../events/types/file_upload_queued.hpp | 4 +- .../events/types/file_upload_removed.hpp | 4 +- .../events/types/file_upload_retry.hpp | 4 +- .../events/types/filesystem_item_added.hpp | 4 +- .../events/types/filesystem_item_closed.hpp | 4 +- .../events/types/filesystem_item_evicted.hpp | 4 +- .../types/filesystem_item_handle_closed.hpp | 4 +- .../types/filesystem_item_handle_opened.hpp | 4 +- .../events/types/filesystem_item_opened.hpp | 4 +- .../include/events/types/fuse_args_parsed.hpp | 4 +- .../include/events/types/fuse_event.hpp | 4 +- .../include/events/types/info_log.hpp | 4 +- .../events/types/invalid_cache_size.hpp | 4 +- .../include/events/types/item_timeout.hpp | 4 +- .../events/types/max_cache_size_reached.hpp | 4 +- .../events/types/orphaned_file_detected.hpp | 4 +- .../types/orphaned_file_processing_failed.hpp | 4 +- .../types/orphaned_source_file_detected.hpp | 4 +- .../types/orphaned_source_file_removed.hpp | 4 +- .../events/types/packet_client_timeout.hpp | 4 +- .../events/types/polling_item_begin.hpp | 4 +- .../include/events/types/polling_item_end.hpp | 4 +- .../events/types/provider_invalid_version.hpp | 4 +- .../include/events/types/provider_offline.hpp | 4 +- .../events/types/provider_upload_begin.hpp | 4 +- .../events/types/provider_upload_end.hpp | 4 +- .../events/types/remote_server_event.hpp | 4 +- .../events/types/repertory_exception.hpp | 4 +- .../events/types/service_start_begin.hpp | 4 +- .../events/types/service_start_end.hpp | 4 +- .../events/types/service_stop_begin.hpp | 4 +- .../include/events/types/service_stop_end.hpp | 4 +- .../include/events/types/trace_log.hpp | 4 +- .../events/types/unmount_requested.hpp | 4 +- .../include/events/types/unmount_result.hpp | 4 +- .../include/events/types/warn_log.hpp | 4 +- .../include/events/types/winfsp_event.hpp | 4 +- .../include/file_manager/cache_size_mgr.hpp | 2 +- .../include/file_manager/file_manager.hpp | 2 +- .../include/file_manager/ring_buffer_base.hpp | 2 +- .../librepertory/include/types/remote.hpp | 18 +- .../librepertory/include/types/repertory.hpp | 192 +++++++++--------- .../librepertory/src/comm/curl/curl_comm.cpp | 4 +- .../src/comm/curl/multi_request.cpp | 2 +- .../src/comm/packet/packet_client.cpp | 2 +- repertory/librepertory/src/initialize.cpp | 4 +- .../src/platform/unix_platform.cpp | 2 +- .../src/platform/win32_platform.cpp | 2 +- repertory/repertory/include/ui/handlers.hpp | 4 +- repertory/repertory/src/ui/handlers.cpp | 2 +- .../include/fixtures/fuse_fixture.hpp | 32 +-- .../include/fixtures/winfsp_fixture.hpp | 32 +-- .../src/direct_open_file_test.cpp | 10 +- .../repertory_test/src/open_file_test.cpp | 2 +- .../src/ring_buffer_open_file_test.cpp | 10 +- repertory/repertory_test/src/upload_test.cpp | 2 +- .../src/winfsp_drive_info_test.cpp | 6 +- repertory/version.cpp.in | 8 +- support/include/utils/collection.hpp | 4 +- support/include/utils/config.hpp | 8 +- support/include/utils/encryption.hpp | 2 +- support/include/utils/path.hpp | 44 ++-- support/include/utils/time.hpp | 6 +- support/src/utils/file.cpp | 12 +- support/src/utils/path.cpp | 14 +- support/test/src/utils/common_test.cpp | 8 +- support/test/src/utils/encryption_test.cpp | 4 +- support/test/src/utils/file_test.cpp | 4 +- 102 files changed, 364 insertions(+), 381 deletions(-) diff --git a/cmake/versions.cmake b/cmake/versions.cmake index c45c2174..17d5eb4c 100644 --- a/cmake/versions.cmake +++ b/cmake/versions.cmake @@ -1,15 +1,15 @@ set(BINUTILS_VERSION 2.44) -set(BOOST2_MAJOR_VERSION 1) -set(BOOST2_MINOR_VERSION 76) -set(BOOST2_PATCH_VERSION 0) set(BOOST_MAJOR_VERSION 1) set(BOOST_MINOR_VERSION 88) set(BOOST_PATCH_VERSION 0) +set(BOOST2_MAJOR_VERSION 1) +set(BOOST2_MINOR_VERSION 76) +set(BOOST2_PATCH_VERSION 0) set(CPP_HTTPLIB_VERSION 0.20.0) -set(CURL2_VERSION 8_13_0) set(CURL_VERSION 8.13.0) -set(EXPAT2_VERSION 2_7_1) +set(CURL2_VERSION 8_13_0) set(EXPAT_VERSION 2.7.1) +set(EXPAT2_VERSION 2_7_1) set(GCC_VERSION 14.2.0) set(GTEST_VERSION 1.16.0) set(ICU_VERSION 76-1) @@ -21,7 +21,7 @@ set(PKG_CONFIG_VERSION 0.29.2) set(PUGIXML_VERSION 1.15) set(ROCKSDB_VERSION 10.0.1) set(SPDLOG_VERSION 1.15.2) -set(SQLITE2_VERSION 3.49.1) set(SQLITE_VERSION 3490100) +set(SQLITE2_VERSION 3.49.1) set(STDUUID_VERSION 1.2.3) set(ZLIB_VERSION 1.3.1) diff --git a/repertory/librepertory/include/comm/packet/client_pool.hpp b/repertory/librepertory/include/comm/packet/client_pool.hpp index d4c9795d..9df0ab04 100644 --- a/repertory/librepertory/include/comm/packet/client_pool.hpp +++ b/repertory/librepertory/include/comm/packet/client_pool.hpp @@ -94,7 +94,7 @@ private: bool shutdown_ = false; private: - static constexpr const auto min_pool_size = 10U; + static constexpr auto min_pool_size = 10U; public: void execute(const std::string &client_id, std::uint64_t thread_id, diff --git a/repertory/librepertory/include/common.hpp b/repertory/librepertory/include/common.hpp index 24c263e3..8c7cb131 100644 --- a/repertory/librepertory/include/common.hpp +++ b/repertory/librepertory/include/common.hpp @@ -54,13 +54,13 @@ REPERTORY_IGNORE_WARNINGS_DISABLE() using namespace std::chrono_literals; using json = nlohmann::json; -inline constexpr const std::string_view REPERTORY{"repertory"}; -inline constexpr const std::string_view REPERTORY_DATA_NAME{"repertory2"}; -inline constexpr const std::wstring_view REPERTORY_W{L"repertory"}; +inline constexpr std::string_view REPERTORY{"repertory"}; +inline constexpr std::string_view REPERTORY_DATA_NAME{"repertory2"}; +inline constexpr std::wstring_view REPERTORY_W{L"repertory"}; -inline constexpr const std::uint64_t REPERTORY_CONFIG_VERSION{2ULL}; -inline constexpr const std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"}; -inline constexpr const std::string_view RENTERD_MIN_VERSION{"2.0.0"}; +inline constexpr std::uint64_t REPERTORY_CONFIG_VERSION{2ULL}; +inline constexpr std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"}; +inline constexpr std::string_view RENTERD_MIN_VERSION{"2.0.0"}; #define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE diff --git a/repertory/librepertory/include/events/consumers/logging_consumer.hpp b/repertory/librepertory/include/events/consumers/logging_consumer.hpp index 603f2ea1..d5750fd2 100644 --- a/repertory/librepertory/include/events/consumers/logging_consumer.hpp +++ b/repertory/librepertory/include/events/consumers/logging_consumer.hpp @@ -35,9 +35,8 @@ public: ~logging_consumer(); private: - static constexpr const std::uint8_t MAX_LOG_FILES{5U}; - static constexpr const std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL * - 5ULL}; + static constexpr std::uint8_t MAX_LOG_FILES{5U}; + static constexpr std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL * 5ULL}; private: static void process_event(const i_event &evt); diff --git a/repertory/librepertory/include/events/event_system.hpp b/repertory/librepertory/include/events/event_system.hpp index cefdfe14..53686257 100644 --- a/repertory/librepertory/include/events/event_system.hpp +++ b/repertory/librepertory/include/events/event_system.hpp @@ -27,7 +27,7 @@ class i_event; class event_system final { private: - static constexpr const std::uint8_t max_queue_retry{ + static constexpr std::uint8_t max_queue_retry{ 30U, }; @@ -35,7 +35,7 @@ private: std::thread::hardware_concurrency() * 4U, }; - static constexpr const std::chrono::seconds queue_wait_secs{ + static constexpr std::chrono::seconds queue_wait_secs{ 5s, }; diff --git a/repertory/librepertory/include/events/types/curl_error.hpp b/repertory/librepertory/include/events/types/curl_error.hpp index 6d6a547e..cb3bcee6 100644 --- a/repertory/librepertory/include/events/types/curl_error.hpp +++ b/repertory/librepertory/include/events/types/curl_error.hpp @@ -33,8 +33,8 @@ struct curl_error final : public i_event { function_name(std::string{function_name_}), url(std::move(url_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{"curl_error"}; + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{"curl_error"}; CURLcode code{}; std::string function_name; diff --git a/repertory/librepertory/include/events/types/debug_log.hpp b/repertory/librepertory/include/events/types/debug_log.hpp index a5a29da7..2642d003 100644 --- a/repertory/librepertory/include/events/types/debug_log.hpp +++ b/repertory/librepertory/include/events/types/debug_log.hpp @@ -31,8 +31,8 @@ struct debug_log final : public i_event { debug_log(std::string_view function_name_, std::string msg_) : function_name(std::string(function_name_)), msg(std::move(msg_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"debug_log"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"debug_log"}; std::string function_name; std::string msg; diff --git a/repertory/librepertory/include/events/types/directory_remove_failed.hpp b/repertory/librepertory/include/events/types/directory_remove_failed.hpp index b79316e2..a044ed75 100644 --- a/repertory/librepertory/include/events/types/directory_remove_failed.hpp +++ b/repertory/librepertory/include/events/types/directory_remove_failed.hpp @@ -34,8 +34,8 @@ struct directory_remove_failed final : public i_event { error(error_), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{"directory_remove_failed"}; + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{"directory_remove_failed"}; std::string api_path; api_error error{}; diff --git a/repertory/librepertory/include/events/types/directory_removed.hpp b/repertory/librepertory/include/events/types/directory_removed.hpp index 862d87fa..922e7047 100644 --- a/repertory/librepertory/include/events/types/directory_removed.hpp +++ b/repertory/librepertory/include/events/types/directory_removed.hpp @@ -32,8 +32,8 @@ struct directory_removed final : public i_event { : api_path(std::move(api_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"directory_removed"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"directory_removed"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/directory_removed_externally.hpp b/repertory/librepertory/include/events/types/directory_removed_externally.hpp index 483e376d..95b87ae7 100644 --- a/repertory/librepertory/include/events/types/directory_removed_externally.hpp +++ b/repertory/librepertory/include/events/types/directory_removed_externally.hpp @@ -35,8 +35,8 @@ struct directory_removed_externally final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"directory_removed_externally"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"directory_removed_externally"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/download_begin.hpp b/repertory/librepertory/include/events/types/download_begin.hpp index 26be0adf..0fa3d3dd 100644 --- a/repertory/librepertory/include/events/types/download_begin.hpp +++ b/repertory/librepertory/include/events/types/download_begin.hpp @@ -34,8 +34,8 @@ struct download_begin final : public i_event { dest_path(std::move(dest_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"download_begin"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"download_begin"}; std::string api_path; std::string dest_path; diff --git a/repertory/librepertory/include/events/types/download_end.hpp b/repertory/librepertory/include/events/types/download_end.hpp index ac74e33e..e4cebe2d 100644 --- a/repertory/librepertory/include/events/types/download_end.hpp +++ b/repertory/librepertory/include/events/types/download_end.hpp @@ -35,8 +35,8 @@ struct download_end final : public i_event { error(error_), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"download_end"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"download_end"}; std::string api_path; std::string dest_path; diff --git a/repertory/librepertory/include/events/types/download_progress.hpp b/repertory/librepertory/include/events/types/download_progress.hpp index 289cf6fb..1361ef19 100644 --- a/repertory/librepertory/include/events/types/download_progress.hpp +++ b/repertory/librepertory/include/events/types/download_progress.hpp @@ -35,8 +35,8 @@ struct download_progress final : public i_event { function_name(std::string(function_name_)), progress(progress_) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"download_progress"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"download_progress"}; std::string api_path; std::string dest_path; diff --git a/repertory/librepertory/include/events/types/download_restore_failed.hpp b/repertory/librepertory/include/events/types/download_restore_failed.hpp index f75b6b59..2c834967 100644 --- a/repertory/librepertory/include/events/types/download_restore_failed.hpp +++ b/repertory/librepertory/include/events/types/download_restore_failed.hpp @@ -35,8 +35,8 @@ struct download_restore_failed final : public i_event { error(std::move(error_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{"download_restore_failed"}; + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{"download_restore_failed"}; std::string api_path; std::string dest_path; diff --git a/repertory/librepertory/include/events/types/download_restored.hpp b/repertory/librepertory/include/events/types/download_restored.hpp index cfe17445..67536cf4 100644 --- a/repertory/librepertory/include/events/types/download_restored.hpp +++ b/repertory/librepertory/include/events/types/download_restored.hpp @@ -34,8 +34,8 @@ struct download_restored final : public i_event { dest_path(std::move(dest_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"download_restored"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"download_restored"}; std::string api_path; std::string dest_path; 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 6c044109..7741caa6 100644 --- a/repertory/librepertory/include/events/types/download_resume_add_failed.hpp +++ b/repertory/librepertory/include/events/types/download_resume_add_failed.hpp @@ -36,8 +36,8 @@ struct download_resume_add_failed final : public i_event { error(std::move(error_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{"download_resume_add_failed"}; + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{"download_resume_add_failed"}; std::string api_path; std::string dest_path; diff --git a/repertory/librepertory/include/events/types/download_resume_added.hpp b/repertory/librepertory/include/events/types/download_resume_added.hpp index 054e3f1e..a2935079 100644 --- a/repertory/librepertory/include/events/types/download_resume_added.hpp +++ b/repertory/librepertory/include/events/types/download_resume_added.hpp @@ -34,8 +34,8 @@ struct download_resume_added final : public i_event { dest_path(std::move(dest_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"download_resume_added"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"download_resume_added"}; std::string api_path; std::string dest_path; diff --git a/repertory/librepertory/include/events/types/download_resume_removed.hpp b/repertory/librepertory/include/events/types/download_resume_removed.hpp index f90f2df1..0ea3c0d9 100644 --- a/repertory/librepertory/include/events/types/download_resume_removed.hpp +++ b/repertory/librepertory/include/events/types/download_resume_removed.hpp @@ -34,8 +34,8 @@ struct download_resume_removed final : public i_event { dest_path(std::move(dest_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"download_resume_removed"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"download_resume_removed"}; std::string api_path; std::string dest_path; diff --git a/repertory/librepertory/include/events/types/download_type_selected.hpp b/repertory/librepertory/include/events/types/download_type_selected.hpp index 56cad897..92d15978 100644 --- a/repertory/librepertory/include/events/types/download_type_selected.hpp +++ b/repertory/librepertory/include/events/types/download_type_selected.hpp @@ -35,8 +35,8 @@ struct download_type_selected final : public i_event { function_name(std::string(function_name_)), type(type_) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"download_type_selected"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"download_type_selected"}; std::string api_path; std::string dest_path; diff --git a/repertory/librepertory/include/events/types/drive_mount_failed.hpp b/repertory/librepertory/include/events/types/drive_mount_failed.hpp index 90a8f8dd..ad76e9e0 100644 --- a/repertory/librepertory/include/events/types/drive_mount_failed.hpp +++ b/repertory/librepertory/include/events/types/drive_mount_failed.hpp @@ -35,8 +35,8 @@ struct drive_mount_failed final : public i_event { function_name(std::string(function_name_)), mount_location(std::move(mount_location_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{"drive_mount_failed"}; + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{"drive_mount_failed"}; NTSTATUS error{}; std::string function_name; diff --git a/repertory/librepertory/include/events/types/drive_mount_result.hpp b/repertory/librepertory/include/events/types/drive_mount_result.hpp index 5c240d77..ada57745 100644 --- a/repertory/librepertory/include/events/types/drive_mount_result.hpp +++ b/repertory/librepertory/include/events/types/drive_mount_result.hpp @@ -34,8 +34,8 @@ struct drive_mount_result final : public i_event { mount_location(std::move(mount_location_)), result(std::move(result_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"drive_mount_result"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"drive_mount_result"}; std::string function_name; std::string mount_location; diff --git a/repertory/librepertory/include/events/types/drive_mounted.hpp b/repertory/librepertory/include/events/types/drive_mounted.hpp index 44b5a157..67c7c07d 100644 --- a/repertory/librepertory/include/events/types/drive_mounted.hpp +++ b/repertory/librepertory/include/events/types/drive_mounted.hpp @@ -32,8 +32,8 @@ struct drive_mounted final : public i_event { : function_name(std::string(function_name_)), mount_location(std::move(mount_location_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"drive_mounted"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"drive_mounted"}; std::string function_name; std::string mount_location; 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 fb50eb62..4f54f7e1 100644 --- a/repertory/librepertory/include/events/types/drive_stop_timed_out.hpp +++ b/repertory/librepertory/include/events/types/drive_stop_timed_out.hpp @@ -31,8 +31,8 @@ struct drive_stop_timed_out final : public i_event { drive_stop_timed_out(std::string_view function_name_) : function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"drive_stop_timed_out"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"drive_stop_timed_out"}; std::string function_name; diff --git a/repertory/librepertory/include/events/types/drive_unmount_pending.hpp b/repertory/librepertory/include/events/types/drive_unmount_pending.hpp index f0d0c82b..75162598 100644 --- a/repertory/librepertory/include/events/types/drive_unmount_pending.hpp +++ b/repertory/librepertory/include/events/types/drive_unmount_pending.hpp @@ -33,8 +33,8 @@ struct drive_unmount_pending final : public i_event { : function_name(std::string(function_name_)), mount_location(std::move(mount_location_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"drive_unmount_pending"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"drive_unmount_pending"}; std::string function_name; std::string mount_location; diff --git a/repertory/librepertory/include/events/types/drive_unmounted.hpp b/repertory/librepertory/include/events/types/drive_unmounted.hpp index 8ae128a3..e9d69aad 100644 --- a/repertory/librepertory/include/events/types/drive_unmounted.hpp +++ b/repertory/librepertory/include/events/types/drive_unmounted.hpp @@ -32,8 +32,8 @@ struct drive_unmounted final : public i_event { : function_name(std::string(function_name_)), mount_location(std::move(mount_location_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"drive_unmounted"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"drive_unmounted"}; std::string function_name; std::string mount_location; diff --git a/repertory/librepertory/include/events/types/event_level_changed.hpp b/repertory/librepertory/include/events/types/event_level_changed.hpp index 4ebac75e..aca9122b 100644 --- a/repertory/librepertory/include/events/types/event_level_changed.hpp +++ b/repertory/librepertory/include/events/types/event_level_changed.hpp @@ -31,8 +31,8 @@ struct event_level_changed final : public i_event { event_level_changed(std::string_view function_name_, event_level new_level_) : function_name(std::string(function_name_)), new_level(new_level_) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"event_level_changed"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"event_level_changed"}; std::string function_name; event_level new_level{}; diff --git a/repertory/librepertory/include/events/types/file_pinned.hpp b/repertory/librepertory/include/events/types/file_pinned.hpp index 5551c54d..fdc742a8 100644 --- a/repertory/librepertory/include/events/types/file_pinned.hpp +++ b/repertory/librepertory/include/events/types/file_pinned.hpp @@ -32,8 +32,8 @@ struct file_pinned final : public i_event { : api_path(std::move(api_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"file_pinned"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"file_pinned"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/file_remove_failed.hpp b/repertory/librepertory/include/events/types/file_remove_failed.hpp index ecf7a8c7..37c2c6f3 100644 --- a/repertory/librepertory/include/events/types/file_remove_failed.hpp +++ b/repertory/librepertory/include/events/types/file_remove_failed.hpp @@ -34,8 +34,8 @@ struct file_remove_failed final : public i_event { error(error_), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{"file_remove_failed"}; + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{"file_remove_failed"}; std::string api_path; api_error error{}; diff --git a/repertory/librepertory/include/events/types/file_removed.hpp b/repertory/librepertory/include/events/types/file_removed.hpp index 081587ae..b1156b8b 100644 --- a/repertory/librepertory/include/events/types/file_removed.hpp +++ b/repertory/librepertory/include/events/types/file_removed.hpp @@ -32,8 +32,8 @@ struct file_removed final : public i_event { : api_path(std::move(api_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"file_removed"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"file_removed"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/file_removed_externally.hpp b/repertory/librepertory/include/events/types/file_removed_externally.hpp index 854f927c..079f3110 100644 --- a/repertory/librepertory/include/events/types/file_removed_externally.hpp +++ b/repertory/librepertory/include/events/types/file_removed_externally.hpp @@ -35,8 +35,8 @@ struct file_removed_externally final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"file_removed_externally"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"file_removed_externally"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/file_unpinned.hpp b/repertory/librepertory/include/events/types/file_unpinned.hpp index 2675a805..eb3b629f 100644 --- a/repertory/librepertory/include/events/types/file_unpinned.hpp +++ b/repertory/librepertory/include/events/types/file_unpinned.hpp @@ -32,8 +32,8 @@ struct file_unpinned final : public i_event { : api_path(std::move(api_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"file_unpinned"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"file_unpinned"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/file_upload_completed.hpp b/repertory/librepertory/include/events/types/file_upload_completed.hpp index 2e8fb101..3ecb7766 100644 --- a/repertory/librepertory/include/events/types/file_upload_completed.hpp +++ b/repertory/librepertory/include/events/types/file_upload_completed.hpp @@ -37,8 +37,8 @@ struct file_upload_completed final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"file_upload_completed"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"file_upload_completed"}; std::string api_path; bool cancelled{}; diff --git a/repertory/librepertory/include/events/types/file_upload_failed.hpp b/repertory/librepertory/include/events/types/file_upload_failed.hpp index d7232f5b..93800b8c 100644 --- a/repertory/librepertory/include/events/types/file_upload_failed.hpp +++ b/repertory/librepertory/include/events/types/file_upload_failed.hpp @@ -35,8 +35,8 @@ struct file_upload_failed final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"file_upload_failed"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"file_upload_failed"}; std::string api_path; std::string error; 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 90c42ed4..1b74330e 100644 --- a/repertory/librepertory/include/events/types/file_upload_not_found.hpp +++ b/repertory/librepertory/include/events/types/file_upload_not_found.hpp @@ -34,8 +34,8 @@ struct file_upload_not_found final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"file_upload_not_found"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"file_upload_not_found"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/file_upload_queued.hpp b/repertory/librepertory/include/events/types/file_upload_queued.hpp index efa3adae..41949302 100644 --- a/repertory/librepertory/include/events/types/file_upload_queued.hpp +++ b/repertory/librepertory/include/events/types/file_upload_queued.hpp @@ -34,8 +34,8 @@ struct file_upload_queued final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"file_upload_queued"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"file_upload_queued"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/file_upload_removed.hpp b/repertory/librepertory/include/events/types/file_upload_removed.hpp index e1b60dfd..04ba865e 100644 --- a/repertory/librepertory/include/events/types/file_upload_removed.hpp +++ b/repertory/librepertory/include/events/types/file_upload_removed.hpp @@ -32,8 +32,8 @@ struct file_upload_removed final : public i_event { : api_path(std::move(api_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"file_upload_removed"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"file_upload_removed"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/file_upload_retry.hpp b/repertory/librepertory/include/events/types/file_upload_retry.hpp index 50514b42..7296a364 100644 --- a/repertory/librepertory/include/events/types/file_upload_retry.hpp +++ b/repertory/librepertory/include/events/types/file_upload_retry.hpp @@ -35,8 +35,8 @@ struct file_upload_retry final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"file_upload_retry"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"file_upload_retry"}; std::string api_path; api_error error{}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_added.hpp b/repertory/librepertory/include/events/types/filesystem_item_added.hpp index 1b77df57..853da92b 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_added.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_added.hpp @@ -35,8 +35,8 @@ struct filesystem_item_added final : public i_event { directory(directory_), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"filesystem_item_added"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"filesystem_item_added"}; std::string api_parent; std::string api_path; diff --git a/repertory/librepertory/include/events/types/filesystem_item_closed.hpp b/repertory/librepertory/include/events/types/filesystem_item_closed.hpp index 22083891..b5d1340c 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_closed.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_closed.hpp @@ -37,8 +37,8 @@ struct filesystem_item_closed final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::trace}; - static constexpr const std::string_view name{"filesystem_item_closed"}; + static constexpr event_level level{event_level::trace}; + static constexpr std::string_view name{"filesystem_item_closed"}; std::string api_path; bool changed{}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_evicted.hpp b/repertory/librepertory/include/events/types/filesystem_item_evicted.hpp index c58bbace..5821d896 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_evicted.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_evicted.hpp @@ -35,8 +35,8 @@ struct filesystem_item_evicted final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"filesystem_item_evicted"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"filesystem_item_evicted"}; std::string api_path; std::string function_name; 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 8930b19b..b84627d9 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_handle_closed.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_handle_closed.hpp @@ -39,8 +39,8 @@ struct filesystem_item_handle_closed final : public i_event { handle(handle_), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::trace}; - static constexpr const std::string_view name{"filesystem_item_handle_closed"}; + static constexpr event_level level{event_level::trace}; + static constexpr std::string_view name{"filesystem_item_handle_closed"}; std::string api_path; bool changed{}; 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 e61d6539..0ea6f0ad 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_handle_opened.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_handle_opened.hpp @@ -37,8 +37,8 @@ struct filesystem_item_handle_opened final : public i_event { handle(handle_), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::trace}; - static constexpr const std::string_view name{"filesystem_item_handle_opened"}; + static constexpr event_level level{event_level::trace}; + static constexpr std::string_view name{"filesystem_item_handle_opened"}; std::string api_path; bool directory{}; diff --git a/repertory/librepertory/include/events/types/filesystem_item_opened.hpp b/repertory/librepertory/include/events/types/filesystem_item_opened.hpp index b9f508d4..5d19f839 100644 --- a/repertory/librepertory/include/events/types/filesystem_item_opened.hpp +++ b/repertory/librepertory/include/events/types/filesystem_item_opened.hpp @@ -36,8 +36,8 @@ struct filesystem_item_opened final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::trace}; - static constexpr const std::string_view name{"filesystem_item_opened"}; + static constexpr event_level level{event_level::trace}; + static constexpr std::string_view name{"filesystem_item_opened"}; std::string api_path; bool directory{}; diff --git a/repertory/librepertory/include/events/types/fuse_args_parsed.hpp b/repertory/librepertory/include/events/types/fuse_args_parsed.hpp index c38a71c2..795bf4e5 100644 --- a/repertory/librepertory/include/events/types/fuse_args_parsed.hpp +++ b/repertory/librepertory/include/events/types/fuse_args_parsed.hpp @@ -32,8 +32,8 @@ struct fuse_args_parsed final : public i_event { fuse_args_parsed(std::string_view args_, std::string_view function_name_) : args(std::move(args_)), function_name(std::string{function_name_}) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"fuse_args_parsed"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"fuse_args_parsed"}; std::string args; std::string function_name; diff --git a/repertory/librepertory/include/events/types/fuse_event.hpp b/repertory/librepertory/include/events/types/fuse_event.hpp index 5f50c7fa..a1f717ce 100644 --- a/repertory/librepertory/include/events/types/fuse_event.hpp +++ b/repertory/librepertory/include/events/types/fuse_event.hpp @@ -35,8 +35,8 @@ struct fuse_event final : public i_event { error(error_), function_name(std::string{function_name_}) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"fuse_event"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"fuse_event"}; std::string api_path; std::int32_t error{}; diff --git a/repertory/librepertory/include/events/types/info_log.hpp b/repertory/librepertory/include/events/types/info_log.hpp index 2eb56631..36e1e1cb 100644 --- a/repertory/librepertory/include/events/types/info_log.hpp +++ b/repertory/librepertory/include/events/types/info_log.hpp @@ -31,8 +31,8 @@ struct info_log final : public i_event { info_log(std::string_view function_name_, std::string msg_) : function_name(std::string(function_name_)), msg(std::move(msg_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"info_log"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"info_log"}; std::string function_name; std::string msg; diff --git a/repertory/librepertory/include/events/types/invalid_cache_size.hpp b/repertory/librepertory/include/events/types/invalid_cache_size.hpp index f47e1adb..b6f21ab7 100644 --- a/repertory/librepertory/include/events/types/invalid_cache_size.hpp +++ b/repertory/librepertory/include/events/types/invalid_cache_size.hpp @@ -34,8 +34,8 @@ struct invalid_cache_size final : public i_event { function_name(std::string{function_name_}), invalid_size(invalid_size_) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"invalid_cache_size"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"invalid_cache_size"}; std::uint64_t cache_size{}; std::string function_name; diff --git a/repertory/librepertory/include/events/types/item_timeout.hpp b/repertory/librepertory/include/events/types/item_timeout.hpp index f477e90b..ac128a16 100644 --- a/repertory/librepertory/include/events/types/item_timeout.hpp +++ b/repertory/librepertory/include/events/types/item_timeout.hpp @@ -32,8 +32,8 @@ struct item_timeout final : public i_event { : api_path(std::move(api_path_)), function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::trace}; - static constexpr const std::string_view name{"item_timeout"}; + static constexpr event_level level{event_level::trace}; + static constexpr std::string_view name{"item_timeout"}; std::string api_path; std::string function_name; 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 55d68dd3..3da04e59 100644 --- a/repertory/librepertory/include/events/types/max_cache_size_reached.hpp +++ b/repertory/librepertory/include/events/types/max_cache_size_reached.hpp @@ -35,8 +35,8 @@ struct max_cache_size_reached final : public i_event { function_name(std::string{function_name_}), max_cache_size(max_cache_size_) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"max_cache_size_reached"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"max_cache_size_reached"}; std::uint64_t cache_size{}; std::string function_name; diff --git a/repertory/librepertory/include/events/types/orphaned_file_detected.hpp b/repertory/librepertory/include/events/types/orphaned_file_detected.hpp index 99078f0b..d299a0a5 100644 --- a/repertory/librepertory/include/events/types/orphaned_file_detected.hpp +++ b/repertory/librepertory/include/events/types/orphaned_file_detected.hpp @@ -33,8 +33,8 @@ struct orphaned_file_detected final : public i_event { : function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"orphaned_file_detected"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"orphaned_file_detected"}; std::string function_name; std::string source_path; 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 0ec43dff..9476a972 100644 --- a/repertory/librepertory/include/events/types/orphaned_file_processing_failed.hpp +++ b/repertory/librepertory/include/events/types/orphaned_file_processing_failed.hpp @@ -36,8 +36,8 @@ struct orphaned_file_processing_failed final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{ + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{ "orphaned_file_processing_failed", }; 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 a51e6566..14aeb11a 100644 --- a/repertory/librepertory/include/events/types/orphaned_source_file_detected.hpp +++ b/repertory/librepertory/include/events/types/orphaned_source_file_detected.hpp @@ -33,8 +33,8 @@ struct orphaned_source_file_detected final : public i_event { : function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"orphaned_source_file_detected"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"orphaned_source_file_detected"}; std::string function_name; std::string source_path; 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 289a577f..22d81529 100644 --- a/repertory/librepertory/include/events/types/orphaned_source_file_removed.hpp +++ b/repertory/librepertory/include/events/types/orphaned_source_file_removed.hpp @@ -33,8 +33,8 @@ struct orphaned_source_file_removed final : public i_event { : function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"orphaned_source_file_removed"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"orphaned_source_file_removed"}; std::string function_name; std::string source_path; diff --git a/repertory/librepertory/include/events/types/packet_client_timeout.hpp b/repertory/librepertory/include/events/types/packet_client_timeout.hpp index 72596b60..1c36b242 100644 --- a/repertory/librepertory/include/events/types/packet_client_timeout.hpp +++ b/repertory/librepertory/include/events/types/packet_client_timeout.hpp @@ -34,8 +34,8 @@ struct packet_client_timeout final : public i_event { function_name(std::string(function_name_)), msg(std::move(msg_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"packet_client_timeout"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"packet_client_timeout"}; std::string event_name; std::string function_name; diff --git a/repertory/librepertory/include/events/types/polling_item_begin.hpp b/repertory/librepertory/include/events/types/polling_item_begin.hpp index e2ae2a9a..fd98cbe5 100644 --- a/repertory/librepertory/include/events/types/polling_item_begin.hpp +++ b/repertory/librepertory/include/events/types/polling_item_begin.hpp @@ -32,8 +32,8 @@ struct polling_item_begin final : public i_event { : function_name(std::string(function_name_)), item_name(std::move(item_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"polling_item_begin"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"polling_item_begin"}; std::string function_name; std::string item_name; diff --git a/repertory/librepertory/include/events/types/polling_item_end.hpp b/repertory/librepertory/include/events/types/polling_item_end.hpp index 3da7e18f..5bc6075e 100644 --- a/repertory/librepertory/include/events/types/polling_item_end.hpp +++ b/repertory/librepertory/include/events/types/polling_item_end.hpp @@ -32,8 +32,8 @@ struct polling_item_end final : public i_event { : function_name(std::string(function_name_)), item_name(std::move(item_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"polling_item_end"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"polling_item_end"}; std::string function_name; std::string item_name; diff --git a/repertory/librepertory/include/events/types/provider_invalid_version.hpp b/repertory/librepertory/include/events/types/provider_invalid_version.hpp index 4b535868..cc6e84b0 100644 --- a/repertory/librepertory/include/events/types/provider_invalid_version.hpp +++ b/repertory/librepertory/include/events/types/provider_invalid_version.hpp @@ -35,8 +35,8 @@ struct provider_invalid_version final : public i_event { required_version(std::move(required_version_)), returned_version(std::move(returned_version_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{"provider_invalid_version"}; + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{"provider_invalid_version"}; std::string function_name; std::string required_version; diff --git a/repertory/librepertory/include/events/types/provider_offline.hpp b/repertory/librepertory/include/events/types/provider_offline.hpp index d55a3e7c..e1f3b82e 100644 --- a/repertory/librepertory/include/events/types/provider_offline.hpp +++ b/repertory/librepertory/include/events/types/provider_offline.hpp @@ -34,8 +34,8 @@ struct provider_offline final : public i_event { host_name_or_ip(std::move(host_name_or_ip_)), port(port_) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"provider_offline"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"provider_offline"}; std::string function_name; std::string host_name_or_ip; diff --git a/repertory/librepertory/include/events/types/provider_upload_begin.hpp b/repertory/librepertory/include/events/types/provider_upload_begin.hpp index 9042e0b3..5a7fc5e2 100644 --- a/repertory/librepertory/include/events/types/provider_upload_begin.hpp +++ b/repertory/librepertory/include/events/types/provider_upload_begin.hpp @@ -34,8 +34,8 @@ struct provider_upload_begin final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"provider_upload_begin"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"provider_upload_begin"}; std::string api_path; std::string function_name; diff --git a/repertory/librepertory/include/events/types/provider_upload_end.hpp b/repertory/librepertory/include/events/types/provider_upload_end.hpp index 3cee2a89..7e69118a 100644 --- a/repertory/librepertory/include/events/types/provider_upload_end.hpp +++ b/repertory/librepertory/include/events/types/provider_upload_end.hpp @@ -35,8 +35,8 @@ struct provider_upload_end final : public i_event { function_name(std::string(function_name_)), source_path(std::move(source_path_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"provider_upload_end"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"provider_upload_end"}; std::string api_path; api_error error{}; diff --git a/repertory/librepertory/include/events/types/remote_server_event.hpp b/repertory/librepertory/include/events/types/remote_server_event.hpp index 52d456e6..d13d368a 100644 --- a/repertory/librepertory/include/events/types/remote_server_event.hpp +++ b/repertory/librepertory/include/events/types/remote_server_event.hpp @@ -35,8 +35,8 @@ struct remote_server_event final : public i_event { error(error_), function_name(std::string{function_name_}) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"remote_server_event"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"remote_server_event"}; std::string api_path; packet::error_type error{}; diff --git a/repertory/librepertory/include/events/types/repertory_exception.hpp b/repertory/librepertory/include/events/types/repertory_exception.hpp index 8ffa1ecb..6b901ec7 100644 --- a/repertory/librepertory/include/events/types/repertory_exception.hpp +++ b/repertory/librepertory/include/events/types/repertory_exception.hpp @@ -31,8 +31,8 @@ struct repertory_exception final : public i_event { repertory_exception(std::string_view function_name_, std::string msg_) : function_name(std::string(function_name_)), msg(std::move(msg_)) {} - static constexpr const event_level level{event_level::error}; - static constexpr const std::string_view name{"repertory_exception"}; + static constexpr event_level level{event_level::error}; + static constexpr std::string_view name{"repertory_exception"}; std::string function_name; std::string msg; diff --git a/repertory/librepertory/include/events/types/service_start_begin.hpp b/repertory/librepertory/include/events/types/service_start_begin.hpp index 74022c3e..384c437a 100644 --- a/repertory/librepertory/include/events/types/service_start_begin.hpp +++ b/repertory/librepertory/include/events/types/service_start_begin.hpp @@ -33,8 +33,8 @@ struct service_start_begin final : public i_event { : function_name(std::string(function_name_)), service_name(std::move(service_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"service_start_begin"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"service_start_begin"}; std::string function_name; std::string service_name; diff --git a/repertory/librepertory/include/events/types/service_start_end.hpp b/repertory/librepertory/include/events/types/service_start_end.hpp index 7e9c2633..470bdddd 100644 --- a/repertory/librepertory/include/events/types/service_start_end.hpp +++ b/repertory/librepertory/include/events/types/service_start_end.hpp @@ -32,8 +32,8 @@ struct service_start_end final : public i_event { : function_name(std::string(function_name_)), service_name(std::move(service_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"service_start_end"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"service_start_end"}; std::string function_name; std::string service_name; diff --git a/repertory/librepertory/include/events/types/service_stop_begin.hpp b/repertory/librepertory/include/events/types/service_stop_begin.hpp index 829bfe38..8b41a6f1 100644 --- a/repertory/librepertory/include/events/types/service_stop_begin.hpp +++ b/repertory/librepertory/include/events/types/service_stop_begin.hpp @@ -32,8 +32,8 @@ struct service_stop_begin final : public i_event { : function_name(std::string(function_name_)), service_name(std::move(service_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"service_stop_begin"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"service_stop_begin"}; std::string function_name; std::string service_name; diff --git a/repertory/librepertory/include/events/types/service_stop_end.hpp b/repertory/librepertory/include/events/types/service_stop_end.hpp index be0b0611..ad4c3a89 100644 --- a/repertory/librepertory/include/events/types/service_stop_end.hpp +++ b/repertory/librepertory/include/events/types/service_stop_end.hpp @@ -32,8 +32,8 @@ struct service_stop_end final : public i_event { : function_name(std::string(function_name_)), service_name(std::move(service_name_)) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"service_stop_end"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"service_stop_end"}; std::string function_name; std::string service_name; diff --git a/repertory/librepertory/include/events/types/trace_log.hpp b/repertory/librepertory/include/events/types/trace_log.hpp index db5a902c..7ad52be0 100644 --- a/repertory/librepertory/include/events/types/trace_log.hpp +++ b/repertory/librepertory/include/events/types/trace_log.hpp @@ -31,8 +31,8 @@ struct trace_log final : public i_event { trace_log(std::string_view function_name_, std::string msg_) : function_name(std::string(function_name_)), msg(std::move(msg_)) {} - static constexpr const event_level level{event_level::trace}; - static constexpr const std::string_view name{"trace_log"}; + static constexpr event_level level{event_level::trace}; + static constexpr std::string_view name{"trace_log"}; std::string function_name; std::string msg; diff --git a/repertory/librepertory/include/events/types/unmount_requested.hpp b/repertory/librepertory/include/events/types/unmount_requested.hpp index b1f274c8..ab470889 100644 --- a/repertory/librepertory/include/events/types/unmount_requested.hpp +++ b/repertory/librepertory/include/events/types/unmount_requested.hpp @@ -31,8 +31,8 @@ struct unmount_requested final : public i_event { unmount_requested(std::string_view function_name_) : function_name(std::string(function_name_)) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"unmount_requested"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"unmount_requested"}; std::string function_name; diff --git a/repertory/librepertory/include/events/types/unmount_result.hpp b/repertory/librepertory/include/events/types/unmount_result.hpp index a08da22f..1ae99aea 100644 --- a/repertory/librepertory/include/events/types/unmount_result.hpp +++ b/repertory/librepertory/include/events/types/unmount_result.hpp @@ -35,8 +35,8 @@ struct unmount_result final : public i_event { mount_location(std::move(mount_location_)), result(result_) {} - static constexpr const event_level level{event_level::info}; - static constexpr const std::string_view name{"unmount_result"}; + static constexpr event_level level{event_level::info}; + static constexpr std::string_view name{"unmount_result"}; std::string function_name; std::string mount_location; diff --git a/repertory/librepertory/include/events/types/warn_log.hpp b/repertory/librepertory/include/events/types/warn_log.hpp index b39279b7..f75d48ad 100644 --- a/repertory/librepertory/include/events/types/warn_log.hpp +++ b/repertory/librepertory/include/events/types/warn_log.hpp @@ -31,8 +31,8 @@ struct warn_log final : public i_event { warn_log(std::string_view function_name_, std::string msg_) : function_name(std::string(function_name_)), msg(std::move(msg_)) {} - static constexpr const event_level level{event_level::warn}; - static constexpr const std::string_view name{"warn_log"}; + static constexpr event_level level{event_level::warn}; + static constexpr std::string_view name{"warn_log"}; std::string function_name; std::string msg; diff --git a/repertory/librepertory/include/events/types/winfsp_event.hpp b/repertory/librepertory/include/events/types/winfsp_event.hpp index 638e2ce3..21fb01df 100644 --- a/repertory/librepertory/include/events/types/winfsp_event.hpp +++ b/repertory/librepertory/include/events/types/winfsp_event.hpp @@ -35,8 +35,8 @@ struct winfsp_event final : public i_event { error(error_), function_name(std::string{function_name_}) {} - static constexpr const event_level level{event_level::debug}; - static constexpr const std::string_view name{"winfsp_event"}; + static constexpr event_level level{event_level::debug}; + static constexpr std::string_view name{"winfsp_event"}; std::string api_path; NTSTATUS error{}; diff --git a/repertory/librepertory/include/file_manager/cache_size_mgr.hpp b/repertory/librepertory/include/file_manager/cache_size_mgr.hpp index 7da3f278..b621e875 100644 --- a/repertory/librepertory/include/file_manager/cache_size_mgr.hpp +++ b/repertory/librepertory/include/file_manager/cache_size_mgr.hpp @@ -29,7 +29,7 @@ class app_config; class cache_size_mgr final { private: - static constexpr const std::chrono::seconds cache_wait_secs{ + static constexpr std::chrono::seconds cache_wait_secs{ 5s, }; diff --git a/repertory/librepertory/include/file_manager/file_manager.hpp b/repertory/librepertory/include/file_manager/file_manager.hpp index b27aee71..1c2b0f98 100644 --- a/repertory/librepertory/include/file_manager/file_manager.hpp +++ b/repertory/librepertory/include/file_manager/file_manager.hpp @@ -40,7 +40,7 @@ class file_manager final : public i_file_manager, public i_upload_manager { E_CONSUMER(); private: - static constexpr const std::chrono::seconds queue_wait_secs{ + static constexpr std::chrono::seconds queue_wait_secs{ 5s, }; diff --git a/repertory/librepertory/include/file_manager/ring_buffer_base.hpp b/repertory/librepertory/include/file_manager/ring_buffer_base.hpp index 863f7a53..7da05a35 100644 --- a/repertory/librepertory/include/file_manager/ring_buffer_base.hpp +++ b/repertory/librepertory/include/file_manager/ring_buffer_base.hpp @@ -48,7 +48,7 @@ public: -> ring_buffer_base & = delete; public: - static constexpr const auto min_ring_size{5U}; + static constexpr auto min_ring_size{5U}; private: boost::dynamic_bitset<> read_state_; diff --git a/repertory/librepertory/include/types/remote.hpp b/repertory/librepertory/include/types/remote.hpp index b362d1d1..0bc92b40 100644 --- a/repertory/librepertory/include/types/remote.hpp +++ b/repertory/librepertory/include/types/remote.hpp @@ -24,20 +24,20 @@ #include "types/repertory.hpp" -inline constexpr const auto PACKET_SERVICE_FUSE{1U}; -inline constexpr const auto PACKET_SERVICE_WINFSP{2U}; +inline constexpr auto PACKET_SERVICE_FUSE{1U}; +inline constexpr auto PACKET_SERVICE_WINFSP{2U}; #if defined(_WIN32) -inline constexpr const auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_WINFSP}; +inline constexpr auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_WINFSP}; #else // !defined(_WIN32) -inline constexpr const auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_FUSE}; +inline constexpr auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_FUSE}; #endif // defined(_WIN32) -constexpr const auto default_remote_directory_page_size{std::size_t(100U)}; -constexpr const auto default_remote_client_pool_size{20U}; -constexpr const auto default_remote_max_connections{20U}; -constexpr const auto default_remote_receive_timeout_ms{120U * 1000U}; -constexpr const auto default_remote_send_timeout_ms{30U * 1000U}; +inline constexpr auto default_remote_directory_page_size{std::size_t(100U)}; +inline constexpr auto default_remote_client_pool_size{20U}; +inline constexpr auto default_remote_max_connections{20U}; +inline constexpr auto default_remote_receive_timeout_ms{120U * 1000U}; +inline constexpr auto default_remote_send_timeout_ms{30U * 1000U}; namespace repertory::remote { struct remote_config final { diff --git a/repertory/librepertory/include/types/repertory.hpp b/repertory/librepertory/include/types/repertory.hpp index 243294db..0021f1c4 100644 --- a/repertory/librepertory/include/types/repertory.hpp +++ b/repertory/librepertory/include/types/repertory.hpp @@ -23,36 +23,36 @@ #define REPERTORY_INCLUDE_TYPES_REPERTORY_HPP_ namespace repertory { -inline constexpr const auto default_api_password_size{48U}; -inline constexpr const auto default_download_timeout_secs{30U}; -inline constexpr const auto default_eviction_delay_mins{1U}; -inline constexpr const auto default_high_freq_interval_secs{std::uint16_t{30U}}; -inline constexpr const auto default_low_freq_interval_secs{ +inline constexpr auto default_api_password_size{48U}; +inline constexpr auto default_download_timeout_secs{30U}; +inline constexpr auto default_eviction_delay_mins{1U}; +inline constexpr auto default_high_freq_interval_secs{std::uint16_t{30U}}; +inline constexpr auto default_low_freq_interval_secs{ std::uint16_t(60U * 60U), }; -inline constexpr const auto default_max_cache_size_bytes{ +inline constexpr auto default_max_cache_size_bytes{ std::uint64_t(20ULL * 1024ULL * 1024ULL * 1024ULL), }; -inline constexpr const auto default_max_upload_count{5U}; -inline constexpr const auto default_med_freq_interval_secs{ +inline constexpr auto default_max_upload_count{5U}; +inline constexpr auto default_med_freq_interval_secs{ std::uint16_t{2U * 60U}, }; -inline constexpr const auto default_online_check_retry_secs{60U}; -inline constexpr const auto default_retry_read_count{6U}; -inline constexpr const auto default_ring_buffer_file_size{512U}; -inline constexpr const auto default_task_wait_ms{100U}; -inline constexpr const auto default_timeout_ms{60000U}; -inline constexpr const auto default_ui_mgmt_port{std::uint16_t{30000U}}; -inline constexpr const auto max_ring_buffer_file_size{std::uint16_t(1024U)}; -inline constexpr const auto max_s3_object_name_length{1024U}; -inline constexpr const auto min_cache_size_bytes{ +inline constexpr auto default_online_check_retry_secs{60U}; +inline constexpr auto default_retry_read_count{6U}; +inline constexpr auto default_ring_buffer_file_size{512U}; +inline constexpr auto default_task_wait_ms{100U}; +inline constexpr auto default_timeout_ms{60000U}; +inline constexpr auto default_ui_mgmt_port{std::uint16_t{30000U}}; +inline constexpr auto max_ring_buffer_file_size{std::uint16_t(1024U)}; +inline constexpr auto max_s3_object_name_length{1024U}; +inline constexpr auto min_cache_size_bytes{ std::uint64_t(100ULL * 1024ULL * 1024ULL), }; -inline constexpr const auto min_download_timeout_secs{std::uint8_t(5U)}; -inline constexpr const auto min_online_check_retry_secs{std::uint16_t(15U)}; -inline constexpr const auto min_retry_read_count{std::uint16_t(2U)}; -inline constexpr const auto min_ring_buffer_file_size{std::uint16_t(64U)}; -inline constexpr const auto min_task_wait_ms{std::uint16_t(50U)}; +inline constexpr auto min_download_timeout_secs{std::uint8_t(5U)}; +inline constexpr auto min_online_check_retry_secs{std::uint16_t(15U)}; +inline constexpr auto min_retry_read_count{std::uint16_t(2U)}; +inline constexpr auto min_ring_buffer_file_size{std::uint16_t(64U)}; +inline constexpr auto min_task_wait_ms{std::uint16_t(50U)}; template class atomic final { public: @@ -143,28 +143,28 @@ public: [[nodiscard]] operator data_t() const { return load(); } }; -inline constexpr const auto max_time{ +inline constexpr auto max_time{ std::numeric_limits::max(), }; -inline constexpr const std::string META_ACCESSED{"accessed"}; -inline constexpr const std::string META_ATTRIBUTES{"attributes"}; -inline constexpr const std::string META_BACKUP{"backup"}; -inline constexpr const std::string META_CHANGED{"changed"}; -inline constexpr const std::string META_CREATION{"creation"}; -inline constexpr const std::string META_DIRECTORY{"directory"}; -inline constexpr const std::string META_GID{"gid"}; -inline constexpr const std::string META_KEY{"key"}; -inline constexpr const std::string META_MODE{"mode"}; -inline constexpr const std::string META_MODIFIED{"modified"}; -inline constexpr const std::string META_OSXFLAGS{"flags"}; -inline constexpr const std::string META_PINNED{"pinned"}; -inline constexpr const std::string META_SIZE{"size"}; -inline constexpr const std::string META_SOURCE{"source"}; -inline constexpr const std::string META_UID{"uid"}; -inline constexpr const std::string META_WRITTEN{"written"}; +inline constexpr std::string META_ACCESSED{"accessed"}; +inline constexpr std::string META_ATTRIBUTES{"attributes"}; +inline constexpr std::string META_BACKUP{"backup"}; +inline constexpr std::string META_CHANGED{"changed"}; +inline constexpr std::string META_CREATION{"creation"}; +inline constexpr std::string META_DIRECTORY{"directory"}; +inline constexpr std::string META_GID{"gid"}; +inline constexpr std::string META_KEY{"key"}; +inline constexpr std::string META_MODE{"mode"}; +inline constexpr std::string META_MODIFIED{"modified"}; +inline constexpr std::string META_OSXFLAGS{"flags"}; +inline constexpr std::string META_PINNED{"pinned"}; +inline constexpr std::string META_SIZE{"size"}; +inline constexpr std::string META_SOURCE{"source"}; +inline constexpr std::string META_UID{"uid"}; +inline constexpr std::string META_WRITTEN{"written"}; -inline constexpr const std::array META_USED_NAMES = { +inline constexpr std::array META_USED_NAMES = { META_ACCESSED, META_ATTRIBUTES, META_BACKUP, META_CHANGED, META_CREATION, META_DIRECTORY, META_GID, META_KEY, META_MODE, META_MODIFIED, META_OSXFLAGS, META_PINNED, @@ -471,66 +471,58 @@ using api_item_added_callback = std::function; using directory_item_list = std::vector; using meta_provider_callback = std::function; -inline constexpr const auto JSON_ACCESS_KEY{"AccessKey"}; -inline constexpr const auto JSON_AGENT_STRING{"AgentString"}; -inline constexpr const auto JSON_API_PARENT{"ApiParent"}; -inline constexpr const auto JSON_API_PASSWORD{"ApiPassword"}; -inline constexpr const auto JSON_API_PATH{"ApiPath"}; -inline constexpr const auto JSON_API_PORT{"ApiPort"}; -inline constexpr const auto JSON_API_USER{"ApiUser"}; -inline constexpr const auto JSON_BUCKET{"Bucket"}; -inline constexpr const auto JSON_CLIENT_POOL_SIZE{"ClientPoolSize"}; -inline constexpr const auto JSON_DATABASE_TYPE{"DatabaseType"}; -inline constexpr const auto JSON_DIRECTORY{"Directory"}; -inline constexpr const auto JSON_DOWNLOAD_TIMEOUT_SECS{ - "DownloadTimeoutSeconds"}; -inline constexpr const auto JSON_ENABLE_DRIVE_EVENTS{"EnableDriveEvents"}; -inline constexpr const auto JSON_ENABLE_DOWNLOAD_TIMEOUT{ - "EnableDownloadTimeout"}; -inline constexpr const auto JSON_ENABLE_MOUNT_MANAGER{"EnableMountManager"}; -inline constexpr const auto JSON_ENABLE_REMOTE_MOUNT{"Enable"}; -inline constexpr const auto JSON_ENCRYPTION_TOKEN{"EncryptionToken"}; -inline constexpr const auto JSON_ENCRYPT_CONFIG{"EncryptConfig"}; -inline constexpr const auto JSON_EVENT_LEVEL{"EventLevel"}; -inline constexpr const auto JSON_EVICTION_DELAY_MINS{"EvictionDelayMinutes"}; -inline constexpr const auto JSON_EVICTION_USE_ACCESS_TIME{ - "EvictionUseAccessedTime"}; -inline constexpr const auto JSON_HIGH_FREQ_INTERVAL_SECS{ - "HighFreqIntervalSeconds"}; -inline constexpr const auto JSON_HOST_CONFIG{"HostConfig"}; -inline constexpr const auto JSON_HOST_NAME_OR_IP{"HostNameOrIp"}; -inline constexpr const auto JSON_LOW_FREQ_INTERVAL_SECS{ - "LowFreqIntervalSeconds"}; -inline constexpr const auto JSON_MAX_CACHE_SIZE_BYTES{"MaxCacheSizeBytes"}; -inline constexpr const auto JSON_MAX_CONNECTIONS{"MaxConnections"}; -inline constexpr const auto JSON_MAX_UPLOAD_COUNT{"MaxUploadCount"}; -inline constexpr const auto JSON_MED_FREQ_INTERVAL_SECS{ - "MedFreqIntervalSeconds"}; -inline constexpr const auto JSON_META{"Meta"}; -inline constexpr const auto JSON_MOUNT_LOCATIONS{"MountLocations"}; -inline constexpr const auto JSON_ONLINE_CHECK_RETRY_SECS{ - "OnlineCheckRetrySeconds"}; -inline constexpr const auto JSON_PATH{"Path"}; -inline constexpr const auto JSON_PREFERRED_DOWNLOAD_TYPE{ - "PreferredDownloadType"}; -inline constexpr const auto JSON_PROTOCOL{"Protocol"}; -inline constexpr const auto JSON_RECV_TIMEOUT_MS{"ReceiveTimeoutMs"}; -inline constexpr const auto JSON_REGION{"Region"}; -inline constexpr const auto JSON_REMOTE_CONFIG{"RemoteConfig"}; -inline constexpr const auto JSON_REMOTE_MOUNT{"RemoteMount"}; -inline constexpr const auto JSON_RETRY_READ_COUNT{"RetryReadCount"}; -inline constexpr const auto JSON_RING_BUFFER_FILE_SIZE{"RingBufferFileSize"}; -inline constexpr const auto JSON_S3_CONFIG{"S3Config"}; -inline constexpr const auto JSON_SECRET_KEY{"SecretKey"}; -inline constexpr const auto JSON_SEND_TIMEOUT_MS{"SendTimeoutMs"}; -inline constexpr const auto JSON_SIA_CONFIG{"SiaConfig"}; -inline constexpr const auto JSON_SIZE{"Size"}; -inline constexpr const auto JSON_TASK_WAIT_MS{"TaskWaitMs"}; -inline constexpr const auto JSON_TIMEOUT_MS{"TimeoutMs"}; -inline constexpr const auto JSON_URL{"URL"}; -inline constexpr const auto JSON_USE_PATH_STYLE{"UsePathStyle"}; -inline constexpr const auto JSON_USE_REGION_IN_URL{"UseRegionInURL"}; -inline constexpr const auto JSON_VERSION{"Version"}; +inline constexpr auto JSON_ACCESS_KEY{"AccessKey"}; +inline constexpr auto JSON_AGENT_STRING{"AgentString"}; +inline constexpr auto JSON_API_PARENT{"ApiParent"}; +inline constexpr auto JSON_API_PASSWORD{"ApiPassword"}; +inline constexpr auto JSON_API_PATH{"ApiPath"}; +inline constexpr auto JSON_API_PORT{"ApiPort"}; +inline constexpr auto JSON_API_USER{"ApiUser"}; +inline constexpr auto JSON_BUCKET{"Bucket"}; +inline constexpr auto JSON_CLIENT_POOL_SIZE{"ClientPoolSize"}; +inline constexpr auto JSON_DATABASE_TYPE{"DatabaseType"}; +inline constexpr auto JSON_DIRECTORY{"Directory"}; +inline constexpr auto JSON_DOWNLOAD_TIMEOUT_SECS{"DownloadTimeoutSeconds"}; +inline constexpr auto JSON_ENABLE_DRIVE_EVENTS{"EnableDriveEvents"}; +inline constexpr auto JSON_ENABLE_DOWNLOAD_TIMEOUT{"EnableDownloadTimeout"}; +inline constexpr auto JSON_ENABLE_MOUNT_MANAGER{"EnableMountManager"}; +inline constexpr auto JSON_ENABLE_REMOTE_MOUNT{"Enable"}; +inline constexpr auto JSON_ENCRYPTION_TOKEN{"EncryptionToken"}; +inline constexpr auto JSON_ENCRYPT_CONFIG{"EncryptConfig"}; +inline constexpr auto JSON_EVENT_LEVEL{"EventLevel"}; +inline constexpr auto JSON_EVICTION_DELAY_MINS{"EvictionDelayMinutes"}; +inline constexpr auto JSON_EVICTION_USE_ACCESS_TIME{"EvictionUseAccessedTime"}; +inline constexpr auto JSON_HIGH_FREQ_INTERVAL_SECS{"HighFreqIntervalSeconds"}; +inline constexpr auto JSON_HOST_CONFIG{"HostConfig"}; +inline constexpr auto JSON_HOST_NAME_OR_IP{"HostNameOrIp"}; +inline constexpr auto JSON_LOW_FREQ_INTERVAL_SECS{"LowFreqIntervalSeconds"}; +inline constexpr auto JSON_MAX_CACHE_SIZE_BYTES{"MaxCacheSizeBytes"}; +inline constexpr auto JSON_MAX_CONNECTIONS{"MaxConnections"}; +inline constexpr auto JSON_MAX_UPLOAD_COUNT{"MaxUploadCount"}; +inline constexpr auto JSON_MED_FREQ_INTERVAL_SECS{"MedFreqIntervalSeconds"}; +inline constexpr auto JSON_META{"Meta"}; +inline constexpr auto JSON_MOUNT_LOCATIONS{"MountLocations"}; +inline constexpr auto JSON_ONLINE_CHECK_RETRY_SECS{"OnlineCheckRetrySeconds"}; +inline constexpr auto JSON_PATH{"Path"}; +inline constexpr auto JSON_PREFERRED_DOWNLOAD_TYPE{"PreferredDownloadType"}; +inline constexpr auto JSON_PROTOCOL{"Protocol"}; +inline constexpr auto JSON_RECV_TIMEOUT_MS{"ReceiveTimeoutMs"}; +inline constexpr auto JSON_REGION{"Region"}; +inline constexpr auto JSON_REMOTE_CONFIG{"RemoteConfig"}; +inline constexpr auto JSON_REMOTE_MOUNT{"RemoteMount"}; +inline constexpr auto JSON_RETRY_READ_COUNT{"RetryReadCount"}; +inline constexpr auto JSON_RING_BUFFER_FILE_SIZE{"RingBufferFileSize"}; +inline constexpr auto JSON_S3_CONFIG{"S3Config"}; +inline constexpr auto JSON_SECRET_KEY{"SecretKey"}; +inline constexpr auto JSON_SEND_TIMEOUT_MS{"SendTimeoutMs"}; +inline constexpr auto JSON_SIA_CONFIG{"SiaConfig"}; +inline constexpr auto JSON_SIZE{"Size"}; +inline constexpr auto JSON_TASK_WAIT_MS{"TaskWaitMs"}; +inline constexpr auto JSON_TIMEOUT_MS{"TimeoutMs"}; +inline constexpr auto JSON_URL{"URL"}; +inline constexpr auto JSON_USE_PATH_STYLE{"UsePathStyle"}; +inline constexpr auto JSON_USE_REGION_IN_URL{"UseRegionInURL"}; +inline constexpr auto JSON_VERSION{"Version"}; } // namespace repertory NLOHMANN_JSON_NAMESPACE_BEGIN diff --git a/repertory/librepertory/src/comm/curl/curl_comm.cpp b/repertory/librepertory/src/comm/curl/curl_comm.cpp index ee795dc7..727c5fab 100644 --- a/repertory/librepertory/src/comm/curl/curl_comm.cpp +++ b/repertory/librepertory/src/comm/curl/curl_comm.cpp @@ -62,8 +62,8 @@ curl_comm::curl_comm(s3_config cfg) auto curl_comm::construct_url(CURL *curl, const std::string &relative_path, const host_config &cfg) -> std::string { - static constexpr const auto http = 80U; - static constexpr const auto https = 443U; + static constexpr auto http{80U}; + static constexpr auto https{443U}; auto custom_port = (((cfg.protocol == "http") && (cfg.api_port == http || cfg.api_port == 0U)) || diff --git a/repertory/librepertory/src/comm/curl/multi_request.cpp b/repertory/librepertory/src/comm/curl/multi_request.cpp index 63efa2d1..263253a4 100644 --- a/repertory/librepertory/src/comm/curl/multi_request.cpp +++ b/repertory/librepertory/src/comm/curl/multi_request.cpp @@ -39,7 +39,7 @@ multi_request::~multi_request() { } void multi_request::get_result(CURLcode &curl_code, long &http_code) { - static constexpr const auto timeout_ms = 100; + static constexpr auto timeout_ms{100}; curl_code = CURLcode::CURLE_ABORTED_BY_CALLBACK; http_code = -1; diff --git a/repertory/librepertory/src/comm/packet/packet_client.cpp b/repertory/librepertory/src/comm/packet/packet_client.cpp index 8a6ca3a4..80fa5abe 100644 --- a/repertory/librepertory/src/comm/packet/packet_client.cpp +++ b/repertory/librepertory/src/comm/packet/packet_client.cpp @@ -173,7 +173,7 @@ auto packet_client::send(std::string_view method, packet &request, request.encode_top(PACKET_SERVICE_FLAGS); request.encode_top(std::string{project_get_version()}); - static constexpr const std::uint8_t max_attempts{5U}; + static constexpr std::uint8_t max_attempts{5U}; for (std::uint8_t i = 1U; allow_connections_ && not success && (i <= max_attempts); i++) { auto current_client = get_client(); diff --git a/repertory/librepertory/src/initialize.cpp b/repertory/librepertory/src/initialize.cpp index 37179b06..cc4cddad 100644 --- a/repertory/librepertory/src/initialize.cpp +++ b/repertory/librepertory/src/initialize.cpp @@ -52,8 +52,8 @@ namespace repertory { auto project_initialize() -> bool { #if defined(PROJECT_REQUIRE_ALPINE) && !defined(PROJECT_IS_MINGW) { - static constexpr const auto guard_size{4096U}; - static constexpr const auto stack_size{8U * 1024U * 1024U}; + static constexpr auto guard_size{4096U}; + static constexpr auto stack_size{8U * 1024U * 1024U}; pthread_attr_t attr{}; pthread_attr_setstacksize(&attr, stack_size); diff --git a/repertory/librepertory/src/platform/unix_platform.cpp b/repertory/librepertory/src/platform/unix_platform.cpp index 9dd3dd70..3f0ca168 100644 --- a/repertory/librepertory/src/platform/unix_platform.cpp +++ b/repertory/librepertory/src/platform/unix_platform.cpp @@ -183,7 +183,7 @@ auto lock_data::set_mount_state(bool active, std::string_view mount_location, } auto lock_data::wait_for_lock(int handle, std::uint8_t retry_count) -> int { - static constexpr const std::uint32_t max_sleep{100U}; + static constexpr std::uint32_t max_sleep{100U}; auto lock_status{EWOULDBLOCK}; auto remain{static_cast(retry_count * max_sleep)}; diff --git a/repertory/librepertory/src/platform/win32_platform.cpp b/repertory/librepertory/src/platform/win32_platform.cpp index 547644f5..c2f26a05 100644 --- a/repertory/librepertory/src/platform/win32_platform.cpp +++ b/repertory/librepertory/src/platform/win32_platform.cpp @@ -90,7 +90,7 @@ auto lock_data::get_mount_state(json &mount_state) -> bool { } auto lock_data::grab_lock(std::uint8_t retry_count) -> lock_result { - static constexpr const std::uint32_t max_sleep{100U}; + static constexpr std::uint32_t max_sleep{100U}; if (mutex_handle_ == INVALID_HANDLE_VALUE) { return lock_result::failure; diff --git a/repertory/repertory/include/ui/handlers.hpp b/repertory/repertory/include/ui/handlers.hpp index c816b8fb..a427ee99 100644 --- a/repertory/repertory/include/ui/handlers.hpp +++ b/repertory/repertory/include/ui/handlers.hpp @@ -30,8 +30,8 @@ class mgmt_app_config; class handlers final { private: - static constexpr const auto nonce_length{128U}; - static constexpr const auto nonce_timeout{15U}; + static constexpr auto nonce_length{128U}; + static constexpr auto nonce_timeout{15U}; struct nonce_data final { std::chrono::system_clock::time_point creation{ diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index ccb001c0..c6c5f933 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -381,7 +381,7 @@ void handlers::handle_put_mount_location(const httplib::Request &req, void handlers::handle_get_available_locations(httplib::Response &res) { #if defined(_WIN32) - constexpr const std::array letters{ + constexpr std::array letters{ "a:", "b:", "c:", "d:", "e:", "f:", "g:", "h:", "i:", "j:", "k:", "l:", "m:", "n:", "o:", "p:", "q:", "r:", "s:", "t:", "u:", "v:", "w:", "x:", "y:", "z:", diff --git a/repertory/repertory_test/include/fixtures/fuse_fixture.hpp b/repertory/repertory_test/include/fixtures/fuse_fixture.hpp index a95c9d18..eaa59662 100644 --- a/repertory/repertory_test/include/fixtures/fuse_fixture.hpp +++ b/repertory/repertory_test/include/fixtures/fuse_fixture.hpp @@ -47,38 +47,38 @@ namespace { std::atomic provider_idx{0U}; -constexpr const auto SLEEP_SECONDS{1.5s}; +constexpr auto SLEEP_SECONDS{1.5s}; } // namespace namespace repertory { struct local_s3 final { - static constexpr const provider_type type{provider_type::s3}; - static constexpr const provider_type type2{provider_type::s3}; - static constexpr const std::uint16_t port{0U}; + static constexpr provider_type type{provider_type::s3}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t port{0U}; }; struct local_sia final { - static constexpr const provider_type type{provider_type::sia}; - static constexpr const provider_type type2{provider_type::sia}; - static constexpr const std::uint16_t port{0U}; + static constexpr provider_type type{provider_type::sia}; + static constexpr provider_type type2{provider_type::sia}; + static constexpr std::uint16_t port{0U}; }; struct remote_s3 final { - static constexpr const provider_type type{provider_type::remote}; - static constexpr const provider_type type2{provider_type::s3}; - static constexpr const std::uint16_t port{0U}; + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t port{0U}; }; struct remote_sia final { - static constexpr const provider_type type{provider_type::remote}; - static constexpr const provider_type type2{provider_type::sia}; - static constexpr const std::uint16_t port{0U}; + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::sia}; + static constexpr std::uint16_t port{0U}; }; struct remote_linux_to_winfsp final { - static constexpr const provider_type type{provider_type::remote}; - static constexpr const provider_type type2{provider_type::unknown}; - static constexpr const std::uint16_t port{40001U}; + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::unknown}; + static constexpr std::uint16_t port{40001U}; }; template class fuse_test : public ::testing::Test { diff --git a/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp b/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp index fcddb3e1..64aba1af 100644 --- a/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp +++ b/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp @@ -38,38 +38,38 @@ namespace { std::atomic idx{0U}; -constexpr const auto SLEEP_SECONDS{1.5s}; +constexpr auto SLEEP_SECONDS{1.5s}; } // namespace namespace repertory { struct local_s3 final { - static constexpr const provider_type type{provider_type::s3}; - static constexpr const provider_type type2{provider_type::s3}; - static constexpr const std::uint16_t port{0U}; + static constexpr provider_type type{provider_type::s3}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t port{0U}; }; struct local_sia final { - static constexpr const provider_type type{provider_type::sia}; - static constexpr const provider_type type2{provider_type::sia}; - static constexpr const std::uint16_t port{0U}; + static constexpr provider_type type{provider_type::sia}; + static constexpr provider_type type2{provider_type::sia}; + static constexpr std::uint16_t port{0U}; }; struct remote_s3 final { - static constexpr const provider_type type{provider_type::remote}; - static constexpr const provider_type type2{provider_type::s3}; - static constexpr const std::uint16_t port{0U}; + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t port{0U}; }; struct remote_sia final { - static constexpr const provider_type type{provider_type::remote}; - static constexpr const provider_type type2{provider_type::sia}; - static constexpr const std::uint16_t port{0U}; + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::sia}; + static constexpr std::uint16_t port{0U}; }; struct remote_winfsp_to_linux final { - static constexpr const provider_type type{provider_type::remote}; - static constexpr const provider_type type2{provider_type::unknown}; - static constexpr const std::uint16_t port{40001U}; + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::unknown}; + static constexpr std::uint16_t port{40001U}; }; template class winfsp_test : public ::testing::Test { diff --git a/repertory/repertory_test/src/direct_open_file_test.cpp b/repertory/repertory_test/src/direct_open_file_test.cpp index 97dbc5ef..ba0751fb 100644 --- a/repertory/repertory_test/src/direct_open_file_test.cpp +++ b/repertory/repertory_test/src/direct_open_file_test.cpp @@ -25,7 +25,7 @@ #include "mocks/mock_provider.hpp" namespace { -constexpr const std::size_t test_chunk_size{1024U}; +constexpr std::size_t test_chunk_size{1024U}; } // namespace namespace repertory { @@ -35,13 +35,9 @@ public: mock_provider provider; protected: - void SetUp() override { - event_system::instance().start(); - } + void SetUp() override { event_system::instance().start(); } - void TearDown() override { - event_system::instance().stop(); - } + void TearDown() override { event_system::instance().stop(); } }; TEST_F(direct_open_file_test, read_full_file) { diff --git a/repertory/repertory_test/src/open_file_test.cpp b/repertory/repertory_test/src/open_file_test.cpp index 3b07488a..1eb5be9a 100644 --- a/repertory/repertory_test/src/open_file_test.cpp +++ b/repertory/repertory_test/src/open_file_test.cpp @@ -35,7 +35,7 @@ #include "utils/path.hpp" namespace { -constexpr const std::size_t test_chunk_size{1024U}; +constexpr std::size_t test_chunk_size{1024U}; } namespace repertory { diff --git a/repertory/repertory_test/src/ring_buffer_open_file_test.cpp b/repertory/repertory_test/src/ring_buffer_open_file_test.cpp index c67ba66b..1f0ca6c9 100644 --- a/repertory/repertory_test/src/ring_buffer_open_file_test.cpp +++ b/repertory/repertory_test/src/ring_buffer_open_file_test.cpp @@ -29,7 +29,7 @@ #include "utils/path.hpp" namespace { -constexpr const std::size_t test_chunk_size{1024U}; +constexpr std::size_t test_chunk_size{1024U}; const auto ring_buffer_dir{ repertory::utils::path::combine( @@ -45,13 +45,9 @@ public: mock_provider provider; protected: - void SetUp() override { - event_system::instance().start(); - } + void SetUp() override { event_system::instance().start(); } - void TearDown() override { - event_system::instance().stop(); - } + void TearDown() override { event_system::instance().stop(); } }; TEST_F(ring_buffer_open_file_test, can_forward_to_last_chunk) { diff --git a/repertory/repertory_test/src/upload_test.cpp b/repertory/repertory_test/src/upload_test.cpp index 1f45d10b..c4b72b3b 100644 --- a/repertory/repertory_test/src/upload_test.cpp +++ b/repertory/repertory_test/src/upload_test.cpp @@ -27,7 +27,7 @@ #include "utils/event_capture.hpp" namespace repertory { -static constexpr const std::size_t test_chunk_size{1024U}; +static constexpr std::size_t test_chunk_size{1024U}; TEST(upload_test, can_upload_a_valid_file) { console_consumer con; diff --git a/repertory/repertory_test/src/winfsp_drive_info_test.cpp b/repertory/repertory_test/src/winfsp_drive_info_test.cpp index 8546391c..cdade53a 100644 --- a/repertory/repertory_test/src/winfsp_drive_info_test.cpp +++ b/repertory/repertory_test/src/winfsp_drive_info_test.cpp @@ -291,7 +291,7 @@ TYPED_TEST(winfsp_test, info_can_set_creation_file_time) { BY_HANDLE_FILE_INFORMATION orig_file_info{}; EXPECT_TRUE(::GetFileInformationByHandle(handle, &orig_file_info)); - static constexpr const UINT64 file_time{ + static constexpr UINT64 file_time{ 116444736000000000ULL + 0x4200000042ULL, }; @@ -325,7 +325,7 @@ TYPED_TEST(winfsp_test, info_can_set_accessed_file_time) { BY_HANDLE_FILE_INFORMATION orig_file_info{}; EXPECT_TRUE(::GetFileInformationByHandle(handle, &orig_file_info)); - static constexpr const UINT64 file_time{ + static constexpr UINT64 file_time{ 116444736000000000ULL + 0x4200000042ULL, }; @@ -358,7 +358,7 @@ TYPED_TEST(winfsp_test, info_can_set_written_file_time) { BY_HANDLE_FILE_INFORMATION orig_file_info{}; EXPECT_TRUE(::GetFileInformationByHandle(handle, &orig_file_info)); - static constexpr const UINT64 file_time{ + static constexpr UINT64 file_time{ 116444736000000000ULL + 0x4200000042ULL, }; diff --git a/repertory/version.cpp.in b/repertory/version.cpp.in index c377d456..e0477fbe 100644 --- a/repertory/version.cpp.in +++ b/repertory/version.cpp.in @@ -1,14 +1,14 @@ #include "version.hpp" namespace { -static constexpr const std::string_view git_rev = "@PROJECT_GIT_REV@"; -static constexpr const std::string_view version = +constexpr std::string_view git_rev = "@PROJECT_GIT_REV@"; +constexpr std::string_view version = "@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_REVISION_VERSION@" "-@PROJECT_RELEASE_ITER@"; } // namespace -namespace repertory { +namespace % PROJECT_NAME % { auto project_get_git_rev() -> std::string_view { return git_rev; } auto project_get_version() -> std::string_view { return version; } -} // namespace repertory +} // namespace %PROJECT_NAME % diff --git a/support/include/utils/collection.hpp b/support/include/utils/collection.hpp index d6a4f0e4..e6a0b07d 100644 --- a/support/include/utils/collection.hpp +++ b/support/include/utils/collection.hpp @@ -75,7 +75,7 @@ template -> bool { REPERTORY_USES_FUNCTION_NAME(); - static constexpr const auto base16{16}; + static constexpr auto base16{16}; try { val.clear(); @@ -158,7 +158,7 @@ template inline auto to_hex_string(const col_t &collection) -> std::string { static_assert(sizeof(typename col_t::value_type) == 1U, "value_type must be 1 byte in size"); - static constexpr const auto mask = 0xFF; + static constexpr auto mask{0xFF}; std::stringstream stream{}; for (auto &&val : collection) { diff --git a/support/include/utils/config.hpp b/support/include/utils/config.hpp index 4173d1a3..47666a5b 100644 --- a/support/include/utils/config.hpp +++ b/support/include/utils/config.hpp @@ -429,14 +429,14 @@ using unique_recur_mutex_lock = std::unique_lock; #if defined(_WIN32) #if defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES) -inline constexpr const auto max_path_length = std::size_t{32767U}; +inline constexpr auto max_path_length = std::size_t{32767U}; #else // !defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES) -inline constexpr const auto max_path_length = std::size_t{MAX_PATH}; +inline constexpr auto max_path_length = std::size_t{MAX_PATH}; #endif // defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES) using native_handle = HANDLE; #else // !defined(_WIN32) -inline constexpr const auto max_path_length = std::size_t{PATH_MAX}; +inline constexpr auto max_path_length = std::size_t{PATH_MAX}; using native_handle = int; #if !defined(INVALID_HANDLE_VALUE) #define INVALID_HANDLE_VALUE (-1) @@ -482,7 +482,7 @@ using http_ranges = std::vector; #endif // defined(__cplusplus) #define REPERTORY_USES_FUNCTION_NAME() \ - static constexpr const std::string_view function_name { \ + static constexpr std::string_view function_name { \ static_cast(__FUNCTION__), \ } diff --git a/support/include/utils/encryption.hpp b/support/include/utils/encryption.hpp index fd440c0a..f19370ad 100644 --- a/support/include/utils/encryption.hpp +++ b/support/include/utils/encryption.hpp @@ -29,7 +29,7 @@ #include "utils/hash.hpp" namespace repertory::utils::encryption { -inline constexpr const std::uint32_t encryption_header_size{ +inline constexpr std::uint32_t encryption_header_size{ crypto_aead_xchacha20poly1305_IETF_NPUBBYTES + crypto_aead_xchacha20poly1305_IETF_ABYTES, }; diff --git a/support/include/utils/path.hpp b/support/include/utils/path.hpp index a32bac2a..0c945269 100644 --- a/support/include/utils/path.hpp +++ b/support/include/utils/path.hpp @@ -26,30 +26,30 @@ #include "utils/string.hpp" namespace repertory::utils::path { -inline constexpr const std::string_view backslash{"\\"}; -inline constexpr const std::wstring_view backslash_w{L"\\"}; -inline constexpr const std::string_view dot{"."}; -inline constexpr const std::wstring_view dot_w{L"."}; -inline constexpr const std::string_view dot_backslash{".\\"}; -inline constexpr const std::wstring_view dot_backslash_w{L".\\"}; -inline constexpr const std::string_view dot_slash{"./"}; -inline constexpr const std::wstring_view dot_slash_w{L"./"}; -inline constexpr const std::string_view long_notation{"\\\\?\\"}; -inline constexpr const std::wstring_view long_notation_w{L"\\\\?\\"}; -inline constexpr const std::string_view slash{"/"}; -inline constexpr const std::wstring_view slash_w{L"/"}; +inline constexpr std::string_view backslash{"\\"}; +inline constexpr std::wstring_view backslash_w{L"\\"}; +inline constexpr std::string_view dot{"."}; +inline constexpr std::wstring_view dot_w{L"."}; +inline constexpr std::string_view dot_backslash{".\\"}; +inline constexpr std::wstring_view dot_backslash_w{L".\\"}; +inline constexpr std::string_view dot_slash{"./"}; +inline constexpr std::wstring_view dot_slash_w{L"./"}; +inline constexpr std::string_view long_notation{"\\\\?\\"}; +inline constexpr std::wstring_view long_notation_w{L"\\\\?\\"}; +inline constexpr std::string_view slash{"/"}; +inline constexpr std::wstring_view slash_w{L"/"}; #if defined(_WIN32) -inline constexpr const std::string_view directory_seperator{backslash}; -inline constexpr const std::wstring_view directory_seperator_w{backslash_w}; -inline constexpr const std::string_view not_directory_seperator{slash}; -inline constexpr const std::wstring_view not_directory_seperator_w{slash_w}; -inline constexpr const std::string_view unc_notation{"\\\\"}; -inline constexpr const std::wstring_view unc_notation_w{L"\\\\"}; +inline constexpr std::string_view directory_seperator{backslash}; +inline constexpr std::wstring_view directory_seperator_w{backslash_w}; +inline constexpr std::string_view not_directory_seperator{slash}; +inline constexpr std::wstring_view not_directory_seperator_w{slash_w}; +inline constexpr std::string_view unc_notation{"\\\\"}; +inline constexpr std::wstring_view unc_notation_w{L"\\\\"}; #else // !defined(_WIN32) -inline constexpr const std::string_view directory_seperator{slash}; -inline constexpr const std::wstring_view directory_seperator_w{slash_w}; -inline constexpr const std::string_view not_directory_seperator{backslash}; -inline constexpr const std::wstring_view not_directory_seperator_w{backslash_w}; +inline constexpr std::string_view directory_seperator{slash}; +inline constexpr std::wstring_view directory_seperator_w{slash_w}; +inline constexpr std::string_view not_directory_seperator{backslash}; +inline constexpr std::wstring_view not_directory_seperator_w{backslash_w}; #endif // defined(_WIN32) template diff --git a/support/include/utils/time.hpp b/support/include/utils/time.hpp index 27b9de90..ff49965e 100644 --- a/support/include/utils/time.hpp +++ b/support/include/utils/time.hpp @@ -25,9 +25,9 @@ #include "utils/config.hpp" namespace repertory::utils::time { -inline constexpr const auto NANOS_PER_SECOND{1000000000ULL}; -inline constexpr const auto WIN32_TIME_CONVERSION{116444736000000000ULL}; -inline constexpr const auto WIN32_TIME_NANOS_PER_TICK{100ULL}; +inline constexpr auto NANOS_PER_SECOND{1000000000ULL}; +inline constexpr auto WIN32_TIME_CONVERSION{116444736000000000ULL}; +inline constexpr auto WIN32_TIME_NANOS_PER_TICK{100ULL}; #if defined(PROJECT_ENABLE_SPDLOG) || defined(PROJECT_ENABLE_FMT) [[nodiscard]] inline auto convert_to_utc(time_t time) -> std::time_t { diff --git a/support/src/utils/file.cpp b/support/src/utils/file.cpp index 8727918d..83ab0c72 100644 --- a/support/src/utils/file.cpp +++ b/support/src/utils/file.cpp @@ -119,8 +119,8 @@ auto get_free_drive_space(std::string_view path) try { #if defined(_WIN32) ULARGE_INTEGER li{}; - if (not::GetDiskFreeSpaceEx(std::string{path}.c_str(), &li, nullptr, - nullptr)) { + if (not ::GetDiskFreeSpaceEx(std::string{path}.c_str(), &li, nullptr, + nullptr)) { throw utils::error::create_exception( function_name, { "failed to get free disk space", @@ -276,8 +276,8 @@ auto get_total_drive_space(std::string_view path) try { #if defined(_WIN32) ULARGE_INTEGER li{}; - if (not::GetDiskFreeSpaceEx(std::string{path}.c_str(), nullptr, &li, - nullptr)) { + if (not ::GetDiskFreeSpaceEx(std::string{path}.c_str(), nullptr, &li, + nullptr)) { throw utils::error::create_exception( function_name, { "failed to get total disk space", @@ -376,7 +376,7 @@ auto read_json_file(std::string_view path, nlohmann::json &data) -> bool { try { auto abs_path = utils::path::absolute(path); auto file = file::open_file(abs_path); - if (not*file) { + if (not *file) { return false; } @@ -498,7 +498,7 @@ auto write_json_file(std::wstring_view path, const nlohmann::json &data) #endif // defined(PROJECT_ENABLE_JSON) #if defined(PROJECT_ENABLE_LIBDSM) -static constexpr const auto validate_smb_path = +static constexpr auto validate_smb_path = [](std::string_view path) -> bool { return (not utils::string::begins_with(path, "///") && utils::string::begins_with(path, "//") && diff --git a/support/src/utils/path.cpp b/support/src/utils/path.cpp index 3e730496..e893f615 100644 --- a/support/src/utils/path.cpp +++ b/support/src/utils/path.cpp @@ -152,19 +152,19 @@ auto find_program_in_path(const std::string &name_without_extension) } #if defined(_WIN32) - static constexpr const std::array extension_list{ + static constexpr std::array extension_list{ ".bat", ".cmd", ".exe", ".ps1", }; - static constexpr const auto split_char = ';'; + static constexpr auto split_char = ';'; #else // !defined(_WIN32) - static constexpr const std::array extension_list{ + static constexpr std::array extension_list{ "", ".sh", }; - static constexpr const auto split_char = ':'; + static constexpr auto split_char = ':'; #endif // defined(_WIN32) auto search_path_list = utils::string::split(path, split_char, false); @@ -274,18 +274,18 @@ auto strip_to_file_name(std::wstring path) -> std::wstring { } auto unmake_file_uri(std::string_view uri) -> std::string { - static constexpr const std::array escape_characters = { + static constexpr std::array escape_characters = { { " ", "<", ">", "#", "%", "+", "{", "}", "|", "\\", "^", "~", "[", "]", "`", ";", "/", "?", ":", "@", "=", "&", "$", }}; - static constexpr const std::array + static constexpr std::array escape_sequences_lower = {{ "%20", "%3c", "%3e", "%23", "%25", "%2b", "%7b", "%7d", "%7c", "%5c", "%5e", "%7e", "%5b", "%5d", "%60", "%3b", "%2f", "%3f", "%3a", "%40", "%3d", "%26", "%24", }}; - static constexpr const std::array + static constexpr std::array escape_sequences_upper = {{ "%20", "%3C", "%3E", "%23", "%25", "%2B", "%7B", "%7D", "%7C", "%5C", "%5E", "%7E", "%5B", "%5D", "%60", "%3B", diff --git a/support/test/src/utils/common_test.cpp b/support/test/src/utils/common_test.cpp index 27cf7700..55558872 100644 --- a/support/test/src/utils/common_test.cpp +++ b/support/test/src/utils/common_test.cpp @@ -183,7 +183,7 @@ TEST(utils_common, divide_with_ceiling) { } TEST(utils_common, generate_random_between_for_signed_integers) { - static constexpr const auto max_iterations{1000000UL}; + static constexpr auto max_iterations{1000000UL}; for (std::size_t idx = 0U; idx < max_iterations; ++idx) { auto res = utils::generate_random_between(5, 12); @@ -205,7 +205,7 @@ TEST(utils_common, generate_random_between_for_signed_integers) { } TEST(utils_common, generate_random_between_for_unsigned_integers) { - static constexpr const auto max_iterations{1000000UL}; + static constexpr auto max_iterations{1000000UL}; for (std::size_t idx = 0U; idx < max_iterations; ++idx) { auto res = utils::generate_random_between(5U, 12U); @@ -239,7 +239,7 @@ TEST(utils_common, generate_random_between_throws_error_on_invalid_range) { } TEST(utils_common, generate_random_string) { - static constexpr const auto max_iterations{10000L}; + static constexpr auto max_iterations{10000L}; const auto test_string = [](auto str) { static std::vector list{}; @@ -267,7 +267,7 @@ TEST(utils_common, generate_random_string_for_zero_length) { } TEST(utils_common, get_environment_variable) { - static constexpr const std::string path_env{"PATH"}; + static constexpr std::string path_env{"PATH"}; std::string path; #if defined(_WIN32) diff --git a/support/test/src/utils/encryption_test.cpp b/support/test/src/utils/encryption_test.cpp index a07b60f4..efd18dfc 100644 --- a/support/test/src/utils/encryption_test.cpp +++ b/support/test/src/utils/encryption_test.cpp @@ -28,8 +28,8 @@ const auto get_stop_requested = []() -> bool { return false; }; } // namespace namespace repertory { -static constexpr const std::string_view token{"moose"}; -static constexpr const std::wstring_view token_w{L"moose"}; +static constexpr std::string_view token{"moose"}; +static constexpr std::wstring_view token_w{L"moose"}; TEST(utils_encryption, generate_key) { auto key1 = diff --git a/support/test/src/utils/file_test.cpp b/support/test/src/utils/file_test.cpp index c31fb194..a3748e9a 100644 --- a/support/test/src/utils/file_test.cpp +++ b/support/test/src/utils/file_test.cpp @@ -24,9 +24,9 @@ namespace { #if defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST) #include "utils/file_enc_file.hpp" -constexpr const auto file_type_count{3U}; +constexpr auto file_type_count{3U}; #else -constexpr const auto file_type_count{2U}; +constexpr auto file_type_count{2U}; #endif [[nodiscard]] auto create_file(auto idx, auto path, bool read_only = false)