refactor 'constexpr const'->'constexpr'
This commit is contained in:
parent
a09fd441d3
commit
d86e40ab15
@ -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)
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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{};
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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",
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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{};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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_;
|
||||
|
@ -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 {
|
||||
|
@ -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 <typename data_t> 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<std::uint64_t>::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<std::string, 16U> META_USED_NAMES = {
|
||||
inline constexpr std::array<std::string, 16U> 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<api_error(bool, api_file &)>;
|
||||
using directory_item_list = std::vector<directory_item>;
|
||||
using meta_provider_callback = std::function<void(directory_item &)>;
|
||||
|
||||
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
|
||||
|
@ -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)) ||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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<std::uint32_t>(retry_count * max_sleep)};
|
||||
|
@ -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;
|
||||
|
@ -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{
|
||||
|
@ -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<std::string_view, 26U> letters{
|
||||
constexpr std::array<std::string_view, 26U> 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:",
|
||||
|
@ -47,38 +47,38 @@
|
||||
namespace {
|
||||
std::atomic<std::size_t> 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 <typename provider_t> class fuse_test : public ::testing::Test {
|
||||
|
@ -38,38 +38,38 @@
|
||||
|
||||
namespace {
|
||||
std::atomic<std::size_t> 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 <typename provider_t> class winfsp_test : public ::testing::Test {
|
||||
|
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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 %
|
||||
|
@ -75,7 +75,7 @@ template <typename val_t>
|
||||
-> bool {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
|
||||
static constexpr const auto base16{16};
|
||||
static constexpr auto base16{16};
|
||||
|
||||
try {
|
||||
val.clear();
|
||||
@ -158,7 +158,7 @@ template <typename col_t>
|
||||
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) {
|
||||
|
@ -429,14 +429,14 @@ using unique_recur_mutex_lock = std::unique_lock<std::recursive_mutex>;
|
||||
|
||||
#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<http_range>;
|
||||
#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<const char *>(__FUNCTION__), \
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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 <typename char_t>
|
||||
|
@ -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 {
|
||||
|
@ -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, "//") &&
|
||||
|
@ -152,19 +152,19 @@ auto find_program_in_path(const std::string &name_without_extension)
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
static constexpr const std::array<std::string_view, 4U> extension_list{
|
||||
static constexpr std::array<std::string_view, 4U> 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<std::string_view, 2U> extension_list{
|
||||
static constexpr std::array<std::string_view, 2U> 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<std::string_view, 23U> escape_characters = {
|
||||
static constexpr std::array<std::string_view, 23U> escape_characters = {
|
||||
{
|
||||
" ", "<", ">", "#", "%", "+", "{", "}", "|", "\\", "^", "~",
|
||||
"[", "]", "`", ";", "/", "?", ":", "@", "=", "&", "$",
|
||||
}};
|
||||
static constexpr const std::array<std::string_view, 23U>
|
||||
static constexpr std::array<std::string_view, 23U>
|
||||
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<std::string_view, 23U>
|
||||
static constexpr std::array<std::string_view, 23U>
|
||||
escape_sequences_upper = {{
|
||||
"%20", "%3C", "%3E", "%23", "%25", "%2B", "%7B", "%7D",
|
||||
"%7C", "%5C", "%5E", "%7E", "%5B", "%5D", "%60", "%3B",
|
||||
|
@ -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<decltype(str)> 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)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user