diff --git a/repertory/librepertory/src/comm/packet/packet_client.cpp b/repertory/librepertory/src/comm/packet/packet_client.cpp index 814236e2..e3db617e 100644 --- a/repertory/librepertory/src/comm/packet/packet_client.cpp +++ b/repertory/librepertory/src/comm/packet/packet_client.cpp @@ -25,6 +25,7 @@ #include "types/repertory.hpp" #include "utils/error_utils.hpp" #include "utils/timeout.hpp" +#include "version.hpp" namespace repertory { // clang-format off @@ -116,8 +117,8 @@ void packet_client::put_client(std::shared_ptr &cli) { } } -auto packet_client::read_packet(client &cli, packet &response) - -> packet::error_type { +auto packet_client::read_packet(client &cli, + packet &response) -> packet::error_type { data_buffer buffer(sizeof(std::uint32_t)); const auto read_buffer = [&]() { std::uint32_t offset{}; @@ -168,8 +169,8 @@ auto packet_client::send(const std::string &method, packet &request, } auto packet_client::send(const std::string &method, packet &request, - packet &response, std::uint32_t &service_flags) - -> packet::error_type { + packet &response, + std::uint32_t &service_flags) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); auto success = false; @@ -178,7 +179,7 @@ auto packet_client::send(const std::string &method, packet &request, request.encode_top(utils::get_thread_id()); request.encode_top(unique_id_); request.encode_top(PACKET_SERVICE_FLAGS); - request.encode_top(get_repertory_version()); + request.encode_top(project_get_version()); static const std::uint8_t max_attempts{5U}; for (std::uint8_t i = 1U; diff --git a/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_client.cpp b/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_client.cpp index 87e7d6bd..e97a485f 100644 --- a/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_client.cpp +++ b/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_client.cpp @@ -52,8 +52,8 @@ remote_client::remote_client(const app_config &config) config.get_remote_receive_timeout_secs(), config.get_remote_send_timeout_secs(), config.get_remote_token()) {} -auto remote_client::winfsp_can_delete(PVOID file_desc, PWSTR file_name) - -> packet::error_type { +auto remote_client::winfsp_can_delete(PVOID file_desc, + PWSTR file_name) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -68,9 +68,8 @@ auto remote_client::winfsp_can_delete(PVOID file_desc, PWSTR file_name) return ret; } -auto remote_client::json_create_directory_snapshot(const std::string &path, - json &json_data) - -> packet::error_type { +auto remote_client::json_create_directory_snapshot( + const std::string &path, json &json_data) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -111,8 +110,8 @@ auto remote_client::json_read_directory_snapshot( } auto remote_client::json_release_directory_snapshot( - const std::string &path, const remote::file_handle &handle) - -> packet::error_type { + const std::string &path, + const remote::file_handle &handle) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -127,8 +126,8 @@ auto remote_client::json_release_directory_snapshot( } auto remote_client::winfsp_cleanup(PVOID file_desc, PWSTR file_name, - UINT32 flags, BOOLEAN &was_closed) - -> packet::error_type { + UINT32 flags, + BOOLEAN &was_closed) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); auto handle = to_handle(file_desc); @@ -177,8 +176,8 @@ auto remote_client::winfsp_create(PWSTR file_name, UINT32 create_options, UINT32 granted_access, UINT32 attributes, UINT64 allocation_size, PVOID *file_desc, remote::file_info *file_info, - std::string &normalized_name, BOOLEAN &exists) - -> packet::error_type { + std::string &normalized_name, + BOOLEAN &exists) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -245,9 +244,8 @@ auto remote_client::winfsp_get_dir_buffer([[maybe_unused]] PVOID file_desc, return STATUS_INVALID_HANDLE; } -auto remote_client::winfsp_get_file_info(PVOID file_desc, - remote::file_info *file_info) - -> packet::error_type { +auto remote_client::winfsp_get_file_info( + PVOID file_desc, remote::file_info *file_info) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -264,11 +262,9 @@ auto remote_client::winfsp_get_file_info(PVOID file_desc, return ret; } -auto remote_client::winfsp_get_security_by_name(PWSTR file_name, - PUINT32 attributes, - std::uint64_t *descriptor_size, - std::wstring &string_descriptor) - -> packet::error_type { +auto remote_client::winfsp_get_security_by_name( + PWSTR file_name, PUINT32 attributes, std::uint64_t *descriptor_size, + std::wstring &string_descriptor) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -297,10 +293,9 @@ auto remote_client::winfsp_get_security_by_name(PWSTR file_name, return ret; } -auto remote_client::winfsp_get_volume_info(UINT64 &total_size, - UINT64 &free_size, - std::string &volume_label) - -> packet::error_type { +auto remote_client::winfsp_get_volume_info( + UINT64 &total_size, UINT64 &free_size, + std::string &volume_label) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -320,7 +315,7 @@ auto remote_client::winfsp_mounted(const std::wstring &location) constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; - request.encode(get_repertory_version()); + request.encode(project_get_version()); request.encode(location); std::uint32_t service_flags{}; @@ -332,11 +327,10 @@ auto remote_client::winfsp_mounted(const std::wstring &location) return ret; } -auto remote_client::winfsp_open(PWSTR file_name, UINT32 create_options, - UINT32 granted_access, PVOID *file_desc, - remote::file_info *file_info, - std::string &normalized_name) - -> packet::error_type { +auto remote_client::winfsp_open( + PWSTR file_name, UINT32 create_options, UINT32 granted_access, + PVOID *file_desc, remote::file_info *file_info, + std::string &normalized_name) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -367,11 +361,10 @@ auto remote_client::winfsp_open(PWSTR file_name, UINT32 create_options, return ret; } -auto remote_client::winfsp_overwrite(PVOID file_desc, UINT32 attributes, - BOOLEAN replace_attributes, - UINT64 allocation_size, - remote::file_info *file_info) - -> packet::error_type { +auto remote_client::winfsp_overwrite( + PVOID file_desc, UINT32 attributes, BOOLEAN replace_attributes, + UINT64 allocation_size, + remote::file_info *file_info) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -447,10 +440,9 @@ auto remote_client::winfsp_read_directory(PVOID file_desc, PWSTR pattern, return ret; } -auto remote_client::winfsp_rename(PVOID file_desc, PWSTR file_name, - PWSTR new_file_name, - BOOLEAN replace_if_exists) - -> packet::error_type { +auto remote_client::winfsp_rename( + PVOID file_desc, PWSTR file_name, PWSTR new_file_name, + BOOLEAN replace_if_exists) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -494,10 +486,9 @@ auto remote_client::winfsp_set_basic_info( return ret; } -auto remote_client::winfsp_set_file_size(PVOID file_desc, UINT64 new_size, - BOOLEAN set_allocation_size, - remote::file_info *file_info) - -> packet::error_type { +auto remote_client::winfsp_set_file_size( + PVOID file_desc, UINT64 new_size, BOOLEAN set_allocation_size, + remote::file_info *file_info) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; @@ -533,12 +524,10 @@ auto remote_client::winfsp_unmounted(const std::wstring &location) return ret; } -auto remote_client::winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, - UINT32 length, BOOLEAN write_to_end, - BOOLEAN constrained_io, - PUINT32 bytes_transferred, - remote::file_info *file_info) - -> packet::error_type { +auto remote_client::winfsp_write( + PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length, + BOOLEAN write_to_end, BOOLEAN constrained_io, PUINT32 bytes_transferred, + remote::file_info *file_info) -> packet::error_type { constexpr const auto *function_name = static_cast(__FUNCTION__); packet request; diff --git a/repertory/repertory/include/cli/version.hpp b/repertory/repertory/include/cli/version.hpp index 7d0e6828..fa74f07d 100644 --- a/repertory/repertory/include/cli/version.hpp +++ b/repertory/repertory/include/cli/version.hpp @@ -22,12 +22,12 @@ #ifndef INCLUDE_CLI_VERSION_HPP_ #define INCLUDE_CLI_VERSION_HPP_ +#include "version.hpp" + namespace repertory::cli::actions { template inline void version(std::vector args) { - std::cout << "Repertory core version: " << get_repertory_version() - << std::endl; - std::cout << "Repertory Git revision: " << get_repertory_git_revision() - << std::endl; + std::cout << "Repertory core version: " << project_get_version() << std::endl; + std::cout << "Repertory Git revision: " << project_get_git_rev() << std::endl; drive::display_version_information(args); } } // namespace repertory::cli::actions