From 3510b3a4c2644b804f84f5f5b9a3d0bda2b67ede Mon Sep 17 00:00:00 2001 From: Sergey Avseyev Date: Mon, 13 Jan 2025 23:12:20 +0000 Subject: [PATCH] CXXCBC-638: switch SDK to use bundled fmtlib for spdlog (#705) --- .github/workflows/linters.yml | 10 +++--- CMakeLists.txt | 1 - bin/check-clang-format | 1 + cmake/CPM.cmake | 2 +- cmake/Testing.cmake | 4 --- cmake/ThirdPartyDependencies.cmake | 31 ++++--------------- core/agent_config.cxx | 2 +- core/agent_group_config.cxx | 2 +- core/bucket.cxx | 18 +++++------ core/cluster.cxx | 2 -- core/cluster_agent_config.cxx | 2 +- core/collections_component.cxx | 2 +- core/columnar/agent_config.cxx | 4 +-- core/columnar/error.hxx | 1 - core/columnar/query_component.cxx | 4 +-- core/config_profiles.cxx | 2 +- core/core_sdk_shim.cxx | 2 +- core/crud_component.cxx | 2 +- core/design_document_namespace_fmt.hxx | 2 +- core/diagnostics_fmt.hxx | 2 +- core/document_id.cxx | 2 +- core/document_id_fmt.hxx | 2 +- core/error_context/analytics_json.hxx | 4 ++- core/error_context/key_value_json.hxx | 2 +- core/error_context/query_public_json.hxx | 2 +- core/error_context/subdocument_json.hxx | 2 +- core/fmt/key_value_error_map_attribute.hxx | 2 +- core/fmt/key_value_extended_error_info.hxx | 2 +- core/fmt/key_value_status_code.hxx | 2 +- core/http_component.cxx | 6 ++-- core/impl/best_effort_retry_strategy.cxx | 2 +- core/impl/collection.cxx | 2 +- core/impl/date_range.cxx | 4 +-- core/impl/date_range_query.cxx | 4 +-- core/impl/dns_srv_tracker.cxx | 2 +- core/impl/error.cxx | 4 ++- core/impl/expiry.cxx | 4 +-- core/impl/fail_fast_retry_strategy.cxx | 3 +- core/impl/key_value_error_context.cxx | 10 +++--- core/impl/numeric_range.cxx | 2 +- core/impl/query_error_context.cxx | 5 +-- core/impl/scope.cxx | 11 +++---- core/impl/search.cxx | 2 +- core/io/config_tracker.cxx | 2 +- core/io/dns_client.cxx | 4 +-- core/io/http_parser.cxx | 2 +- core/io/http_session.cxx | 4 +++ core/io/http_session.hxx | 6 ++-- core/io/mcbp_command.hxx | 2 +- core/key_value_config.cxx | 4 +-- core/logger/logger.hxx | 2 +- core/management/rbac_fmt.hxx | 2 +- core/mcbp/operation_queue.cxx | 2 +- core/mcbp/packet.cxx | 2 +- core/meta/version.cxx | 2 +- core/operations/management/CMakeLists.txt | 1 - .../management/analytics_dataset_create.cxx | 2 +- .../management/analytics_dataset_drop.cxx | 2 +- .../management/analytics_dataverse_create.cxx | 2 +- .../management/analytics_dataverse_drop.cxx | 2 +- .../analytics_get_pending_mutations.cxx | 2 +- .../management/analytics_index_drop.cxx | 2 +- .../management/analytics_link_connect.cxx | 2 +- .../management/analytics_link_disconnect.cxx | 2 +- .../management/analytics_link_drop.cxx | 2 +- .../management/analytics_link_get_all.cxx | 2 +- .../management/analytics_link_utils.hxx | 7 +++-- .../operations/management/bucket_describe.cxx | 2 +- core/operations/management/bucket_drop.cxx | 2 +- core/operations/management/bucket_flush.cxx | 2 +- core/operations/management/bucket_get.cxx | 2 +- .../operations/management/change_password.cxx | 2 +- .../management/collection_create.cxx | 2 +- .../operations/management/collection_drop.cxx | 2 +- .../management/collection_update.cxx | 2 +- .../management/eventing_deploy_function.cxx | 2 +- .../management/eventing_drop_function.cxx | 2 +- .../management/eventing_get_function.cxx | 2 +- .../management/eventing_pause_function.cxx | 2 +- .../management/eventing_resume_function.cxx | 2 +- .../management/eventing_undeploy_function.cxx | 2 +- .../management/eventing_upsert_function.cxx | 3 +- core/operations/management/group_drop.cxx | 2 +- core/operations/management/group_get.cxx | 2 +- .../management/query_index_build.hxx | 10 +++--- .../management/query_index_create.cxx | 2 +- .../management/query_index_drop.cxx | 2 +- core/operations/management/scope_create.cxx | 2 +- core/operations/management/scope_drop.cxx | 2 +- core/operations/management/scope_get_all.cxx | 2 +- .../search_index_analyze_document.cxx | 2 +- .../search_index_control_ingest.cxx | 2 +- .../search_index_control_plan_freeze.cxx | 2 +- .../management/search_index_control_query.cxx | 2 +- .../management/search_index_drop.cxx | 2 +- .../management/search_index_get.cxx | 2 +- .../management/search_index_get_all.cxx | 2 +- .../search_index_get_documents_count.cxx | 2 +- .../management/search_index_get_stats.cxx | 2 +- .../management/search_index_upsert.cxx | 2 +- .../operations/management/view_index_drop.cxx | 2 +- core/operations/management/view_index_get.cxx | 2 +- .../management/view_index_get_all.cxx | 2 +- .../management/view_index_upsert.cxx | 2 +- core/origin.cxx | 4 +-- core/platform/base64.h | 16 +++++----- core/protocol/client_opcode_fmt.hxx | 2 +- core/protocol/client_response.hxx | 2 +- core/protocol/frame_info_id_fmt.hxx | 2 +- core/protocol/hello_feature_fmt.hxx | 2 +- core/protocol/magic_fmt.hxx | 2 +- core/protocol/server_opcode_fmt.hxx | 2 +- core/query_context.hxx | 13 ++++---- core/retry_orchestrator.cxx | 2 +- core/sasl/CMakeLists.txt | 1 - core/sasl/error_fmt.h | 2 +- core/seed_config.cxx | 4 +-- core/service_type_fmt.hxx | 2 +- core/topology/capabilities_fmt.hxx | 2 +- core/topology/collections_manifest_fmt.hxx | 3 +- core/topology/configuration_fmt.hxx | 2 +- core/transactions/async_attempt_context.cxx | 2 +- core/transactions/async_attempt_context.hxx | 1 - core/transactions/attempt_context.cxx | 2 +- core/transactions/exceptions_fmt.hxx | 2 +- .../internal/atr_cleanup_entry.hxx | 2 +- core/transactions/internal/client_record.hxx | 7 +++-- core/transactions/internal/doc_record_fmt.hxx | 2 +- .../internal/exceptions_internal.hxx | 2 -- .../internal/exceptions_internal_fmt.hxx | 2 +- core/transactions/internal/logging.hxx | 2 ++ core/transactions/result_fmt.hxx | 2 +- core/transactions/transaction_links.hxx | 2 +- core/utils/join_strings.hxx | 4 +-- core/utils/keyspace.hxx | 3 +- core/utils/url_codec.cxx | 2 +- couchbase-sdk-cxx-black-duck-manifest.yaml | 3 -- couchbase/fmt/analytics_scan_consistency.hxx | 2 -- couchbase/fmt/analytics_status.hxx | 2 -- couchbase/fmt/cas.hxx | 2 -- couchbase/fmt/durability_level.hxx | 2 -- couchbase/fmt/error.hxx | 2 -- couchbase/fmt/error_context.hxx | 2 -- couchbase/fmt/mutation_token.hxx | 2 -- couchbase/fmt/query_profile.hxx | 2 -- couchbase/fmt/query_scan_consistency.hxx | 2 -- couchbase/fmt/query_status.hxx | 2 -- couchbase/fmt/retry_reason.hxx | 6 +++- couchbase/fmt/search_scan_consistency.hxx | 2 -- couchbase/fmt/tls_verify_mode.hxx | 2 -- couchbase/fmt/transaction_keyspace.hxx | 2 -- examples/CMakeLists.txt | 1 - examples/async_game_server.cxx | 5 ++- examples/bulk_base_api.cxx | 5 +-- examples/bulk_transactional_api.cxx | 7 +++-- examples/bulk_transactional_get_replace.cxx | 7 +++-- examples/distributed_mutex.cxx | 9 +++--- examples/game_server.cxx | 3 +- examples/minimal.cxx | 5 ++- test/test_integration_examples.cxx | 8 ++--- test/test_transaction_examples.cxx | 25 ++++++++------- test/test_transaction_simple.cxx | 1 - test/test_transaction_simple_async.cxx | 2 -- test/utils/CMakeLists.txt | 1 - test/utils/test_data.cxx | 4 +-- test/utils/wait_until.cxx | 2 +- tools/CMakeLists.txt | 1 - tools/analytics.cxx | 2 +- tools/beam.cxx | 7 +++-- tools/cbc.cxx | 2 +- tools/get.cxx | 7 +++-- tools/pillowfight.cxx | 9 +++--- tools/query.cxx | 2 +- tools/utils.cxx | 2 +- tools/utils.hxx | 4 +-- tools/version.cxx | 2 +- 176 files changed, 272 insertions(+), 308 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 5aac3e426..f51781946 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -12,7 +12,7 @@ concurrency: jobs: clang_format: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: @@ -22,14 +22,14 @@ jobs: sudo apt-get update -y sudo apt-get install -y wget gnupg2 git wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo bash -c "echo 'deb https://apt.llvm.org/focal/ llvm-toolchain-focal-18 main' >> /etc/apt/sources.list" + sudo bash -c "echo 'deb https://apt.llvm.org/noble/ llvm-toolchain-noble-19 main' >> /etc/apt/sources.list" sudo apt-get update -y - sudo apt-get install -y clang-format-18 + sudo apt-get install -y clang-format-19 - name: Run clang-format run: ./bin/check-clang-format env: - CB_GIT_CLANG_FORMAT: /usr/bin/git-clang-format-18 - CB_CLANG_FORMAT: /usr/bin/clang-format-18 + CB_GIT_CLANG_FORMAT: /usr/bin/git-clang-format-19 + CB_CLANG_FORMAT: /usr/bin/clang-format-19 clang_static_analyzer: runs-on: ubuntu-20.04 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c69b32c6..ee3a26854 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -515,7 +515,6 @@ foreach(TARGET ${couchbase_cxx_client_LIBRARIES}) ${TARGET} PRIVATE project_options project_warnings - fmt::fmt spdlog::spdlog Microsoft.GSL::GSL asio diff --git a/bin/check-clang-format b/bin/check-clang-format index 9d07e7211..51eb769d4 100755 --- a/bin/check-clang-format +++ b/bin/check-clang-format @@ -34,6 +34,7 @@ IFS=$'\n\t' cd "${PROJECT_ROOT}" +${CB_CLANG_FORMAT} --version format_diff="$(${CB_GIT_CLANG_FORMAT} --binary ${CB_CLANG_FORMAT} --diff --commit HEAD^)" if [ "$format_diff" == "clang-format did not modify any files" ] || \ diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index cf530a65c..d6770fd3e 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -1,4 +1,4 @@ -set(CPM_DOWNLOAD_VERSION 0.38.6) +set(CPM_DOWNLOAD_VERSION 0.40.5) if(CPM_SOURCE_CACHE) set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") diff --git a/cmake/Testing.cmake b/cmake/Testing.cmake index c9fca4d75..f5a60490e 100644 --- a/cmake/Testing.cmake +++ b/cmake/Testing.cmake @@ -55,7 +55,6 @@ macro(integration_test name) Microsoft.GSL::GSL asio taocpp::json - fmt::fmt spdlog::spdlog test_utils) if(COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL) @@ -101,7 +100,6 @@ macro(transaction_test name) asio taocpp::json spdlog::spdlog - fmt::fmt ${couchbase_cxx_client_DEFAULT_LIBRARY} test_utils) if(COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL) @@ -146,7 +144,6 @@ macro(unit_test name) asio taocpp::json spdlog::spdlog - fmt::fmt ${couchbase_cxx_client_DEFAULT_LIBRARY} test_utils) if(COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL) @@ -193,7 +190,6 @@ macro(integration_benchmark name) asio taocpp::json spdlog::spdlog - fmt::fmt ${couchbase_cxx_client_DEFAULT_LIBRARY} test_utils) if(COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL) diff --git a/cmake/ThirdPartyDependencies.cmake b/cmake/ThirdPartyDependencies.cmake index f02af0275..87021db15 100644 --- a/cmake/ThirdPartyDependencies.cmake +++ b/cmake/ThirdPartyDependencies.cmake @@ -2,6 +2,8 @@ include(cmake/CPM.cmake) +set(CPM_USE_LOCAL_PACKAGES OFF) + # https://cmake.org/cmake/help/v3.28/policy/CMP0063.html set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) @@ -15,29 +17,6 @@ function(declare_system_library target) $) endfunction() -if(NOT TARGET fmt::fmt) - # https://github.com/fmtlib/fmt/releases - cpmaddpackage( - NAME - fmt - GIT_TAG - 11.0.1 - VERSION - 11.0.1 - GITHUB_REPOSITORY - "fmtlib/fmt" - EXCLUDE_FROM_ALL ON - OPTIONS - "FMT_INSTALL OFF" - # Unicode support for MSVC enabled in CompilerWarnings.cmake - "FMT_UNICODE OFF" - "FMT_DOC OFF" - "BUILD_SHARED_LIBS OFF" - "CMAKE_C_VISIBILITY_PRESET hidden" - "CMAKE_CXX_VISIBILITY_PRESET hidden" - "CMAKE_POSITION_INDEPENDENT_CODE ON") -endif() - if(NOT TARGET spdlog::spdlog) # https://github.com/gabime/spdlog/releases cpmaddpackage( @@ -54,8 +33,11 @@ if(NOT TARGET spdlog::spdlog) "CMAKE_C_VISIBILITY_PRESET hidden" "CMAKE_CXX_VISIBILITY_PRESET hidden" "CMAKE_POSITION_INDEPENDENT_CODE ON" + "NO_CMAKE_SYSTEM_PATH ON" + "NO_CMAKE_INSTALL_PREFIX ON" + "NO_CMAKE_SYSTEM_PACKAGE_REGISTRY ON" "SPDLOG_BUILD_SHARED OFF" - "SPDLOG_FMT_EXTERNAL ON") + "SPDLOG_FMT_EXTERNAL OFF") endif() if(NOT TARGET Microsoft.GSL::GSL) @@ -246,6 +228,5 @@ declare_system_library(llhttp::llhttp) declare_system_library(hdr_histogram_static) declare_system_library(Microsoft.GSL::GSL) declare_system_library(spdlog::spdlog) -declare_system_library(fmt::fmt) declare_system_library(asio) declare_system_library(taocpp::json) diff --git a/core/agent_config.cxx b/core/agent_config.cxx index 79a7a1151..68577154d 100644 --- a/core/agent_config.cxx +++ b/core/agent_config.cxx @@ -15,7 +15,7 @@ #include "agent_config.hxx" -#include +#include #include diff --git a/core/agent_group_config.cxx b/core/agent_group_config.cxx index 9a4d2eb50..f614caa64 100644 --- a/core/agent_group_config.cxx +++ b/core/agent_group_config.cxx @@ -15,7 +15,7 @@ #include "agent_group_config.hxx" -#include +#include #include diff --git a/core/bucket.cxx b/core/bucket.cxx index df26a642f..052cbd2d8 100644 --- a/core/bucket.cxx +++ b/core/bucket.cxx @@ -52,8 +52,8 @@ #include #include #include -#include #include +#include #include #include @@ -225,8 +225,8 @@ class bucket_impl return {}; } - auto direct_re_queue(const std::shared_ptr& req, - bool is_retry) -> std::error_code + auto direct_re_queue(const std::shared_ptr& req, bool is_retry) + -> std::error_code { auto handle_error = [is_retry, req](std::error_code ec) { // We only want to log an error on retries if the error isn't cancelled. @@ -281,8 +281,8 @@ class bucket_impl return {}; } - auto backoff_and_retry(const std::shared_ptr& request, - retry_reason reason) -> bool + auto backoff_and_retry(const std::shared_ptr& request, retry_reason reason) + -> bool { auto action = retry_orchestrator::should_retry(request, reason); auto retried = action.need_to_retry(); @@ -314,8 +314,8 @@ class bucket_impl return {}; } - [[nodiscard]] auto server_by_vbucket(std::uint16_t vbucket, - std::size_t node_index) -> std::optional + [[nodiscard]] auto server_by_vbucket(std::uint16_t vbucket, std::size_t node_index) + -> std::optional { const std::scoped_lock lock(config_mutex_); if (config_) { @@ -1141,8 +1141,8 @@ bucket::direct_dispatch(std::shared_ptr req) -> std::error_ } auto -bucket::direct_re_queue(const std::shared_ptr& req, - bool is_retry) -> std::error_code +bucket::direct_re_queue(const std::shared_ptr& req, bool is_retry) + -> std::error_code { return impl_->direct_re_queue(req, is_retry); } diff --git a/core/cluster.cxx b/core/cluster.cxx index b74061183..073b5618c 100644 --- a/core/cluster.cxx +++ b/core/cluster.cxx @@ -164,12 +164,10 @@ #include #include #include -#include #include #include #include -#include #include #include #include diff --git a/core/cluster_agent_config.cxx b/core/cluster_agent_config.cxx index 6178c6bb9..1b0666e48 100644 --- a/core/cluster_agent_config.cxx +++ b/core/cluster_agent_config.cxx @@ -15,7 +15,7 @@ #include "cluster_agent_config.hxx" -#include +#include #include diff --git a/core/collections_component.cxx b/core/collections_component.cxx index 41d3f85fb..93c67955c 100644 --- a/core/collections_component.cxx +++ b/core/collections_component.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/core/columnar/agent_config.cxx b/core/columnar/agent_config.cxx index 20eb4c6e8..10f5bcf8b 100644 --- a/core/columnar/agent_config.cxx +++ b/core/columnar/agent_config.cxx @@ -17,8 +17,8 @@ #include "agent_config.hxx" -#include -#include +#include +#include #include diff --git a/core/columnar/error.hxx b/core/columnar/error.hxx index de558d1ee..4eba412fa 100644 --- a/core/columnar/error.hxx +++ b/core/columnar/error.hxx @@ -18,7 +18,6 @@ #pragma once #include -#include #include #include #include diff --git a/core/columnar/query_component.cxx b/core/columnar/query_component.cxx index d73ecf327..2299c98f8 100644 --- a/core/columnar/query_component.cxx +++ b/core/columnar/query_component.cxx @@ -33,9 +33,9 @@ #include #include -#include -#include #include +#include +#include #include #include diff --git a/core/config_profiles.cxx b/core/config_profiles.cxx index ccacf435b..0f27351a5 100644 --- a/core/config_profiles.cxx +++ b/core/config_profiles.cxx @@ -20,7 +20,7 @@ #include "cluster_options.hxx" #include "core/config_profile.hxx" -#include +#include #include #include diff --git a/core/core_sdk_shim.cxx b/core/core_sdk_shim.cxx index ea26e1a23..939762147 100644 --- a/core/core_sdk_shim.cxx +++ b/core/core_sdk_shim.cxx @@ -15,7 +15,7 @@ #include "core_sdk_shim.hxx" -#include +#include #include diff --git a/core/crud_component.cxx b/core/crud_component.cxx index 22831b33c..6d7eb7ff8 100644 --- a/core/crud_component.cxx +++ b/core/crud_component.cxx @@ -39,11 +39,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include diff --git a/core/design_document_namespace_fmt.hxx b/core/design_document_namespace_fmt.hxx index a55db36f4..5d83dc2c3 100644 --- a/core/design_document_namespace_fmt.hxx +++ b/core/design_document_namespace_fmt.hxx @@ -19,7 +19,7 @@ #include "design_document_namespace.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/diagnostics_fmt.hxx b/core/diagnostics_fmt.hxx index e80e3a856..fabad4465 100644 --- a/core/diagnostics_fmt.hxx +++ b/core/diagnostics_fmt.hxx @@ -19,7 +19,7 @@ #include "diagnostics.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/document_id.cxx b/core/document_id.cxx index adff17c85..05d8844cd 100644 --- a/core/document_id.cxx +++ b/core/document_id.cxx @@ -20,7 +20,7 @@ #include "core/utils/binary.hxx" #include "core/utils/unsigned_leb128.hxx" -#include +#include #include #include diff --git a/core/document_id_fmt.hxx b/core/document_id_fmt.hxx index 2c6cdd139..394c5e6ed 100644 --- a/core/document_id_fmt.hxx +++ b/core/document_id_fmt.hxx @@ -19,7 +19,7 @@ #include "document_id.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/error_context/analytics_json.hxx b/core/error_context/analytics_json.hxx index d45e03975..b84f1b5c2 100644 --- a/core/error_context/analytics_json.hxx +++ b/core/error_context/analytics_json.hxx @@ -21,11 +21,13 @@ #include "core/impl/retry_reason.hxx" #include -#include +#include #include #include +#include + namespace tao::json { template<> diff --git a/core/error_context/key_value_json.hxx b/core/error_context/key_value_json.hxx index 08fc27208..7af03461b 100644 --- a/core/error_context/key_value_json.hxx +++ b/core/error_context/key_value_json.hxx @@ -22,7 +22,7 @@ #include "key_value_error_context.hxx" -#include +#include #include namespace tao::json diff --git a/core/error_context/query_public_json.hxx b/core/error_context/query_public_json.hxx index c3db382f6..e9f567efd 100644 --- a/core/error_context/query_public_json.hxx +++ b/core/error_context/query_public_json.hxx @@ -21,7 +21,7 @@ #include -#include +#include #include namespace tao::json diff --git a/core/error_context/subdocument_json.hxx b/core/error_context/subdocument_json.hxx index 1f2f411c9..5d57e99ac 100644 --- a/core/error_context/subdocument_json.hxx +++ b/core/error_context/subdocument_json.hxx @@ -21,7 +21,7 @@ #include -#include +#include #include #include "key_value_json.hxx" diff --git a/core/fmt/key_value_error_map_attribute.hxx b/core/fmt/key_value_error_map_attribute.hxx index 534de945d..12f303018 100644 --- a/core/fmt/key_value_error_map_attribute.hxx +++ b/core/fmt/key_value_error_map_attribute.hxx @@ -19,7 +19,7 @@ #include "core/error_context/key_value_error_map_attribute.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/fmt/key_value_extended_error_info.hxx b/core/fmt/key_value_extended_error_info.hxx index 60d5307ea..cbac9168a 100644 --- a/core/fmt/key_value_extended_error_info.hxx +++ b/core/fmt/key_value_extended_error_info.hxx @@ -19,7 +19,7 @@ #include "core/error_context/key_value_extended_error_info.hxx" -#include +#include /** * Helper for fmtlib to format @ref couchbase::key_value_extended_error_info objects. diff --git a/core/fmt/key_value_status_code.hxx b/core/fmt/key_value_status_code.hxx index 03828bba2..f0b0f61a7 100644 --- a/core/fmt/key_value_status_code.hxx +++ b/core/fmt/key_value_status_code.hxx @@ -19,7 +19,7 @@ #include "core/error_context/key_value_status_code.hxx" -#include +#include /** * Helper for fmtlib to format @ref couchbase::core::key_value_status_code objects. diff --git a/core/http_component.cxx b/core/http_component.cxx index e6bbd18ed..097a04708 100644 --- a/core/http_component.cxx +++ b/core/http_component.cxx @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -269,8 +269,8 @@ class pending_buffered_http_operation ~pending_buffered_http_operation() override = default; pending_buffered_http_operation(const pending_buffered_http_operation&) = delete; pending_buffered_http_operation(pending_buffered_http_operation&&) = delete; - auto operator=(const pending_buffered_http_operation&) -> pending_buffered_http_operation = - delete; + auto operator=(const pending_buffered_http_operation&) + -> pending_buffered_http_operation = delete; auto operator=(pending_buffered_http_operation&&) -> pending_buffered_http_operation = delete; void start(buffered_free_form_http_request_callback&& callback) diff --git a/core/impl/best_effort_retry_strategy.cxx b/core/impl/best_effort_retry_strategy.cxx index 78b3c3e5f..96bd8c121 100644 --- a/core/impl/best_effort_retry_strategy.cxx +++ b/core/impl/best_effort_retry_strategy.cxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/core/impl/collection.cxx b/core/impl/collection.cxx index 1aed50eb6..12f0907d2 100644 --- a/core/impl/collection.cxx +++ b/core/impl/collection.cxx @@ -90,7 +90,7 @@ #include #include -#include +#include #include #include diff --git a/core/impl/date_range.cxx b/core/impl/date_range.cxx index 31765a59f..ee179924a 100644 --- a/core/impl/date_range.cxx +++ b/core/impl/date_range.cxx @@ -17,8 +17,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/core/impl/date_range_query.cxx b/core/impl/date_range_query.cxx index 65bb1d81e..986172c05 100644 --- a/core/impl/date_range_query.cxx +++ b/core/impl/date_range_query.cxx @@ -21,8 +21,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/core/impl/dns_srv_tracker.cxx b/core/impl/dns_srv_tracker.cxx index 8dcf13458..b6abba89e 100644 --- a/core/impl/dns_srv_tracker.cxx +++ b/core/impl/dns_srv_tracker.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/core/impl/error.cxx b/core/impl/error.cxx index 5df95e7f4..ef73ba720 100644 --- a/core/impl/error.cxx +++ b/core/impl/error.cxx @@ -36,14 +36,16 @@ #include "core/impl/internal_error_context.hxx" #include "core/transactions/exceptions.hxx" #include "core/transactions/internal/exceptions_internal.hxx" -#include "core/transactions/internal/exceptions_internal_fmt.hxx" #include #include #include +#include #include +#include "core/transactions/internal/exceptions_internal_fmt.hxx" + #include #include #include diff --git a/core/impl/expiry.cxx b/core/impl/expiry.cxx index 52ab38862..7ce18cf93 100644 --- a/core/impl/expiry.cxx +++ b/core/impl/expiry.cxx @@ -18,8 +18,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/core/impl/fail_fast_retry_strategy.cxx b/core/impl/fail_fast_retry_strategy.cxx index c19df78aa..bf498d865 100644 --- a/core/impl/fail_fast_retry_strategy.cxx +++ b/core/impl/fail_fast_retry_strategy.cxx @@ -20,8 +20,7 @@ #include #include -#include -#include +#include #include #include diff --git a/core/impl/key_value_error_context.cxx b/core/impl/key_value_error_context.cxx index dceddef47..8222b7ad5 100644 --- a/core/impl/key_value_error_context.cxx +++ b/core/impl/key_value_error_context.cxx @@ -15,14 +15,16 @@ * limitations under the License. */ -#include -#include - #include "core/error_context/key_value_error_context.hxx" + +#include +#include + #include "core/fmt/key_value_error_map_attribute.hxx" #include "core/fmt/key_value_status_code.hxx" -#include +#include +#include namespace couchbase::core { diff --git a/core/impl/numeric_range.cxx b/core/impl/numeric_range.cxx index 8ccb4d33b..2148f111c 100644 --- a/core/impl/numeric_range.cxx +++ b/core/impl/numeric_range.cxx @@ -17,7 +17,7 @@ #include -#include +#include namespace couchbase { diff --git a/core/impl/query_error_context.cxx b/core/impl/query_error_context.cxx index c71c0e98f..9866b0bd8 100644 --- a/core/impl/query_error_context.cxx +++ b/core/impl/query_error_context.cxx @@ -15,12 +15,13 @@ * limitations under the License. */ -#include - #include "core/error_context/query_error_context.hxx" +#include #include +#include + namespace couchbase::core { auto diff --git a/core/impl/scope.cxx b/core/impl/scope.cxx index 67bfaca11..41b7aeebd 100644 --- a/core/impl/scope.cxx +++ b/core/impl/scope.cxx @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -136,8 +136,8 @@ scope::query(std::string statement, const query_options& options, query_handler& } auto -scope::query(std::string statement, - const query_options& options) const -> std::future> +scope::query(std::string statement, const query_options& options) const + -> std::future> { auto barrier = std::make_shared>>(); auto future = barrier->get_future(); @@ -178,9 +178,8 @@ scope::search(std::string index_name, } auto -scope::search(std::string index_name, - search_request request, - const search_options& options) const -> std::future> +scope::search(std::string index_name, search_request request, const search_options& options) const + -> std::future> { auto barrier = std::make_shared>>(); auto future = barrier->get_future(); diff --git a/core/impl/search.cxx b/core/impl/search.cxx index 0bd26dfff..7880500a3 100644 --- a/core/impl/search.cxx +++ b/core/impl/search.cxx @@ -29,7 +29,7 @@ #include #include -#include +#include namespace couchbase::core::impl { diff --git a/core/io/config_tracker.cxx b/core/io/config_tracker.cxx index ae10fb2ef..97e4297e5 100644 --- a/core/io/config_tracker.cxx +++ b/core/io/config_tracker.cxx @@ -29,7 +29,7 @@ #include "mcbp_session.hxx" #include -#include +#include namespace couchbase::core::io { diff --git a/core/io/dns_client.cxx b/core/io/dns_client.cxx index 1a4945bd1..b783c7113 100644 --- a/core/io/dns_client.cxx +++ b/core/io/dns_client.cxx @@ -27,10 +27,8 @@ #include #include #include - -#include - #include +#include #include #include diff --git a/core/io/http_parser.cxx b/core/io/http_parser.cxx index f208255c6..40604dbdc 100644 --- a/core/io/http_parser.cxx +++ b/core/io/http_parser.cxx @@ -17,8 +17,8 @@ #include "http_parser.hxx" -#include #include +#include #include diff --git a/core/io/http_session.cxx b/core/io/http_session.cxx index e8a752667..5aebfe4a8 100644 --- a/core/io/http_session.cxx +++ b/core/io/http_session.cxx @@ -19,10 +19,14 @@ #include "core/logger/logger.hxx" #include "core/meta/version.hxx" +#include "core/platform/base64.h" #include "core/platform/uuid.h" #include "core/service_type_fmt.hxx" #include + +#include + #include namespace couchbase::core::io diff --git a/core/io/http_session.hxx b/core/io/http_session.hxx index c545bf9d3..ebc4d25ca 100644 --- a/core/io/http_session.hxx +++ b/core/io/http_session.hxx @@ -20,7 +20,6 @@ #include #include "core/diagnostics.hxx" -#include "core/impl/bootstrap_error.hxx" #include "core/origin.hxx" #include "core/platform/base64.h" #include "core/utils/movable_function.hxx" @@ -30,9 +29,12 @@ #include "http_streaming_parser.hxx" #include "http_streaming_response.hxx" #include "streams.hxx" +#ifdef COUCHBASE_CXX_CLIENT_COLUMNAR +#include "core/impl/bootstrap_error.hxx" +#endif #include -#include +#include #include #include diff --git a/core/io/mcbp_command.hxx b/core/io/mcbp_command.hxx index b43c50588..fc2a08f4a 100644 --- a/core/io/mcbp_command.hxx +++ b/core/io/mcbp_command.hxx @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include diff --git a/core/key_value_config.cxx b/core/key_value_config.cxx index 71f4cc629..3abb173c7 100644 --- a/core/key_value_config.cxx +++ b/core/key_value_config.cxx @@ -15,8 +15,8 @@ #include "key_value_config.hxx" -#include -#include +#include +#include namespace couchbase::core { diff --git a/core/logger/logger.hxx b/core/logger/logger.hxx index 1643ad2b4..801b678f4 100644 --- a/core/logger/logger.hxx +++ b/core/logger/logger.hxx @@ -27,7 +27,7 @@ #include "level.hxx" -#include +#include #include #include diff --git a/core/management/rbac_fmt.hxx b/core/management/rbac_fmt.hxx index d3eaec1e1..7108c2ec5 100644 --- a/core/management/rbac_fmt.hxx +++ b/core/management/rbac_fmt.hxx @@ -19,7 +19,7 @@ #include "rbac.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/mcbp/operation_queue.cxx b/core/mcbp/operation_queue.cxx index d00603df2..1896f6664 100644 --- a/core/mcbp/operation_queue.cxx +++ b/core/mcbp/operation_queue.cxx @@ -23,7 +23,7 @@ #include -#include +#include #include #include diff --git a/core/mcbp/packet.cxx b/core/mcbp/packet.cxx index cc2f55140..6dc52bfbc 100644 --- a/core/mcbp/packet.cxx +++ b/core/mcbp/packet.cxx @@ -22,8 +22,8 @@ #include "core/fmt/key_value_status_code.hxx" -#include #include +#include #include diff --git a/core/meta/version.cxx b/core/meta/version.cxx index 74a04ab2b..69ebfe20a 100644 --- a/core/meta/version.cxx +++ b/core/meta/version.cxx @@ -27,12 +27,12 @@ #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/core/operations/management/CMakeLists.txt b/core/operations/management/CMakeLists.txt index 43ff9ca12..0f4deb2fa 100644 --- a/core/operations/management/CMakeLists.txt +++ b/core/operations/management/CMakeLists.txt @@ -76,6 +76,5 @@ target_link_libraries( couchbase_operations_management PRIVATE project_options project_warnings - fmt::fmt spdlog::spdlog) target_include_directories(couchbase_operations_management PRIVATE ../../..) diff --git a/core/operations/management/analytics_dataset_create.cxx b/core/operations/management/analytics_dataset_create.cxx index 36bcfa4e3..c2106d039 100644 --- a/core/operations/management/analytics_dataset_create.cxx +++ b/core/operations/management/analytics_dataset_create.cxx @@ -21,7 +21,7 @@ #include "core/utils/name_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_dataset_drop.cxx b/core/operations/management/analytics_dataset_drop.cxx index 3ec5c44c2..5b617c1a2 100644 --- a/core/operations/management/analytics_dataset_drop.cxx +++ b/core/operations/management/analytics_dataset_drop.cxx @@ -21,7 +21,7 @@ #include "core/utils/name_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_dataverse_create.cxx b/core/operations/management/analytics_dataverse_create.cxx index 93cd864cf..255b9f2e8 100644 --- a/core/operations/management/analytics_dataverse_create.cxx +++ b/core/operations/management/analytics_dataverse_create.cxx @@ -21,7 +21,7 @@ #include "core/utils/name_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_dataverse_drop.cxx b/core/operations/management/analytics_dataverse_drop.cxx index 861e100d6..872302fd9 100644 --- a/core/operations/management/analytics_dataverse_drop.cxx +++ b/core/operations/management/analytics_dataverse_drop.cxx @@ -21,7 +21,7 @@ #include "core/utils/name_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_get_pending_mutations.cxx b/core/operations/management/analytics_get_pending_mutations.cxx index 0b2515929..9bb073c28 100644 --- a/core/operations/management/analytics_get_pending_mutations.cxx +++ b/core/operations/management/analytics_get_pending_mutations.cxx @@ -20,7 +20,7 @@ #include "core/utils/json.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_index_drop.cxx b/core/operations/management/analytics_index_drop.cxx index 640d640f6..9db0e5705 100644 --- a/core/operations/management/analytics_index_drop.cxx +++ b/core/operations/management/analytics_index_drop.cxx @@ -21,7 +21,7 @@ #include "core/utils/name_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_link_connect.cxx b/core/operations/management/analytics_link_connect.cxx index 6b6b7daa6..ae64ad8aa 100644 --- a/core/operations/management/analytics_link_connect.cxx +++ b/core/operations/management/analytics_link_connect.cxx @@ -21,7 +21,7 @@ #include "core/utils/name_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_link_disconnect.cxx b/core/operations/management/analytics_link_disconnect.cxx index 0be4dbef0..53822da44 100644 --- a/core/operations/management/analytics_link_disconnect.cxx +++ b/core/operations/management/analytics_link_disconnect.cxx @@ -21,7 +21,7 @@ #include "core/utils/name_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_link_drop.cxx b/core/operations/management/analytics_link_drop.cxx index 5cb95dcd2..28bbf5c77 100644 --- a/core/operations/management/analytics_link_drop.cxx +++ b/core/operations/management/analytics_link_drop.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_link_get_all.cxx b/core/operations/management/analytics_link_get_all.cxx index e888e3aa4..c238806ff 100644 --- a/core/operations/management/analytics_link_get_all.cxx +++ b/core/operations/management/analytics_link_get_all.cxx @@ -24,7 +24,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/analytics_link_utils.hxx b/core/operations/management/analytics_link_utils.hxx index 2d1c3e036..de4b9f32d 100644 --- a/core/operations/management/analytics_link_utils.hxx +++ b/core/operations/management/analytics_link_utils.hxx @@ -19,15 +19,16 @@ #include "core/utils/url_codec.hxx" +#include + #include -#include #include namespace couchbase::core::operations::management { template -std::string -endpoint_from_analytics_link(const analytics_link_type& link) +auto +endpoint_from_analytics_link(const analytics_link_type& link) -> std::string { if (std::count(link.dataverse.begin(), link.dataverse.end(), '/') > 0) { return fmt::format("/analytics/link/{}/{}", diff --git a/core/operations/management/bucket_describe.cxx b/core/operations/management/bucket_describe.cxx index 68d0844d0..b0d74c810 100644 --- a/core/operations/management/bucket_describe.cxx +++ b/core/operations/management/bucket_describe.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include #include diff --git a/core/operations/management/bucket_drop.cxx b/core/operations/management/bucket_drop.cxx index de0963591..c3f866242 100644 --- a/core/operations/management/bucket_drop.cxx +++ b/core/operations/management/bucket_drop.cxx @@ -20,7 +20,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include namespace couchbase::core::operations::management { diff --git a/core/operations/management/bucket_flush.cxx b/core/operations/management/bucket_flush.cxx index 2dabf3b20..fa1ebad94 100644 --- a/core/operations/management/bucket_flush.cxx +++ b/core/operations/management/bucket_flush.cxx @@ -20,7 +20,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include namespace couchbase::core::operations::management { diff --git a/core/operations/management/bucket_get.cxx b/core/operations/management/bucket_get.cxx index fb31418d1..ea59a1b10 100644 --- a/core/operations/management/bucket_get.cxx +++ b/core/operations/management/bucket_get.cxx @@ -22,7 +22,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/change_password.cxx b/core/operations/management/change_password.cxx index dbbfb9c7d..96d0ff03f 100644 --- a/core/operations/management/change_password.cxx +++ b/core/operations/management/change_password.cxx @@ -19,7 +19,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include namespace couchbase::core::operations::management { diff --git a/core/operations/management/collection_create.cxx b/core/operations/management/collection_create.cxx index 60e55e8e0..2a7c939f0 100644 --- a/core/operations/management/collection_create.cxx +++ b/core/operations/management/collection_create.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include #include diff --git a/core/operations/management/collection_drop.cxx b/core/operations/management/collection_drop.cxx index 00725a4ff..321ee101d 100644 --- a/core/operations/management/collection_drop.cxx +++ b/core/operations/management/collection_drop.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include #include diff --git a/core/operations/management/collection_update.cxx b/core/operations/management/collection_update.cxx index f804aea96..e0e97df88 100644 --- a/core/operations/management/collection_update.cxx +++ b/core/operations/management/collection_update.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include #include diff --git a/core/operations/management/eventing_deploy_function.cxx b/core/operations/management/eventing_deploy_function.cxx index 2dadf4cd7..8404b81bd 100644 --- a/core/operations/management/eventing_deploy_function.cxx +++ b/core/operations/management/eventing_deploy_function.cxx @@ -20,7 +20,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/eventing_drop_function.cxx b/core/operations/management/eventing_drop_function.cxx index ffe26351d..53d2fc3a1 100644 --- a/core/operations/management/eventing_drop_function.cxx +++ b/core/operations/management/eventing_drop_function.cxx @@ -20,7 +20,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/eventing_get_function.cxx b/core/operations/management/eventing_get_function.cxx index 4963a0b0c..56d888a6e 100644 --- a/core/operations/management/eventing_get_function.cxx +++ b/core/operations/management/eventing_get_function.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/eventing_pause_function.cxx b/core/operations/management/eventing_pause_function.cxx index 6de465809..f3e84224a 100644 --- a/core/operations/management/eventing_pause_function.cxx +++ b/core/operations/management/eventing_pause_function.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/eventing_resume_function.cxx b/core/operations/management/eventing_resume_function.cxx index 6b9caf57e..ff24e1c48 100644 --- a/core/operations/management/eventing_resume_function.cxx +++ b/core/operations/management/eventing_resume_function.cxx @@ -20,7 +20,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/eventing_undeploy_function.cxx b/core/operations/management/eventing_undeploy_function.cxx index c22ac1d3e..9d019e541 100644 --- a/core/operations/management/eventing_undeploy_function.cxx +++ b/core/operations/management/eventing_undeploy_function.cxx @@ -20,7 +20,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/eventing_upsert_function.cxx b/core/operations/management/eventing_upsert_function.cxx index 113109738..58265e7e3 100644 --- a/core/operations/management/eventing_upsert_function.cxx +++ b/core/operations/management/eventing_upsert_function.cxx @@ -21,10 +21,9 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" +#include #include -#include - namespace couchbase::core::operations::management { auto diff --git a/core/operations/management/group_drop.cxx b/core/operations/management/group_drop.cxx index 3a07a16c1..f0c920a74 100644 --- a/core/operations/management/group_drop.cxx +++ b/core/operations/management/group_drop.cxx @@ -19,7 +19,7 @@ #include "error_utils.hxx" -#include +#include namespace couchbase::core::operations::management { diff --git a/core/operations/management/group_get.cxx b/core/operations/management/group_get.cxx index 22ac6fb91..8c1599979 100644 --- a/core/operations/management/group_get.cxx +++ b/core/operations/management/group_get.cxx @@ -21,7 +21,7 @@ #include "core/utils/json.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/query_index_build.hxx b/core/operations/management/query_index_build.hxx index 44e3b541f..0532811de 100644 --- a/core/operations/management/query_index_build.hxx +++ b/core/operations/management/query_index_build.hxx @@ -56,12 +56,12 @@ struct query_index_build_request { std::optional client_context_id{}; std::optional timeout{}; - [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, - http_context& context) const; + [[nodiscard]] auto encode_to(encoded_request_type& encoded, http_context& context) const + -> std::error_code; - [[nodiscard]] query_index_build_response make_response( - error_context::http&& ctx, - const encoded_response_type& encoded) const; + [[nodiscard]] auto make_response(error_context::http&& ctx, + const encoded_response_type& encoded) const + -> query_index_build_response; }; } // namespace couchbase::core::operations::management diff --git a/core/operations/management/query_index_create.cxx b/core/operations/management/query_index_create.cxx index ce15cbcf2..4007c8313 100644 --- a/core/operations/management/query_index_create.cxx +++ b/core/operations/management/query_index_create.cxx @@ -21,7 +21,7 @@ #include "core/utils/keyspace.hxx" #include "error_utils.hxx" -#include +#include #include #include diff --git a/core/operations/management/query_index_drop.cxx b/core/operations/management/query_index_drop.cxx index 3ec2c0545..d040a2b90 100644 --- a/core/operations/management/query_index_drop.cxx +++ b/core/operations/management/query_index_drop.cxx @@ -21,7 +21,7 @@ #include "core/utils/keyspace.hxx" #include "error_utils.hxx" -#include +#include #include #include diff --git a/core/operations/management/scope_create.cxx b/core/operations/management/scope_create.cxx index c18587de3..ea548992a 100644 --- a/core/operations/management/scope_create.cxx +++ b/core/operations/management/scope_create.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include #include diff --git a/core/operations/management/scope_drop.cxx b/core/operations/management/scope_drop.cxx index e459e4987..8aa1f9fb6 100644 --- a/core/operations/management/scope_drop.cxx +++ b/core/operations/management/scope_drop.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include #include diff --git a/core/operations/management/scope_get_all.cxx b/core/operations/management/scope_get_all.cxx index ffd3b699f..fc08ab08a 100644 --- a/core/operations/management/scope_get_all.cxx +++ b/core/operations/management/scope_get_all.cxx @@ -22,7 +22,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_analyze_document.cxx b/core/operations/management/search_index_analyze_document.cxx index 83f97b9b1..1da7796ce 100644 --- a/core/operations/management/search_index_analyze_document.cxx +++ b/core/operations/management/search_index_analyze_document.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_control_ingest.cxx b/core/operations/management/search_index_control_ingest.cxx index bf52c9175..35a777c6b 100644 --- a/core/operations/management/search_index_control_ingest.cxx +++ b/core/operations/management/search_index_control_ingest.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_control_plan_freeze.cxx b/core/operations/management/search_index_control_plan_freeze.cxx index 3fdd38ff5..79beabc6e 100644 --- a/core/operations/management/search_index_control_plan_freeze.cxx +++ b/core/operations/management/search_index_control_plan_freeze.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_control_query.cxx b/core/operations/management/search_index_control_query.cxx index 2a11a9fb2..b7da3623c 100644 --- a/core/operations/management/search_index_control_query.cxx +++ b/core/operations/management/search_index_control_query.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_drop.cxx b/core/operations/management/search_index_drop.cxx index c8b91add3..a646bf57d 100644 --- a/core/operations/management/search_index_drop.cxx +++ b/core/operations/management/search_index_drop.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_get.cxx b/core/operations/management/search_index_get.cxx index 440f865e6..7b79a77b5 100644 --- a/core/operations/management/search_index_get.cxx +++ b/core/operations/management/search_index_get.cxx @@ -22,7 +22,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_get_all.cxx b/core/operations/management/search_index_get_all.cxx index 7ac0301c8..cbb756aa1 100644 --- a/core/operations/management/search_index_get_all.cxx +++ b/core/operations/management/search_index_get_all.cxx @@ -22,7 +22,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_get_documents_count.cxx b/core/operations/management/search_index_get_documents_count.cxx index 793ee3326..e47823ffe 100644 --- a/core/operations/management/search_index_get_documents_count.cxx +++ b/core/operations/management/search_index_get_documents_count.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_get_stats.cxx b/core/operations/management/search_index_get_stats.cxx index 7498ba6a1..8839448a8 100644 --- a/core/operations/management/search_index_get_stats.cxx +++ b/core/operations/management/search_index_get_stats.cxx @@ -20,7 +20,7 @@ #include "core/utils/json.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/search_index_upsert.cxx b/core/operations/management/search_index_upsert.cxx index 23d0a5208..1e5b72184 100644 --- a/core/operations/management/search_index_upsert.cxx +++ b/core/operations/management/search_index_upsert.cxx @@ -22,7 +22,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/view_index_drop.cxx b/core/operations/management/view_index_drop.cxx index cef75ff25..3e24fda10 100644 --- a/core/operations/management/view_index_drop.cxx +++ b/core/operations/management/view_index_drop.cxx @@ -20,7 +20,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/view_index_get.cxx b/core/operations/management/view_index_get.cxx index 4bdbbfa13..02dfe0db5 100644 --- a/core/operations/management/view_index_get.cxx +++ b/core/operations/management/view_index_get.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/view_index_get_all.cxx b/core/operations/management/view_index_get_all.cxx index f1acb16fe..8a44875a0 100644 --- a/core/operations/management/view_index_get_all.cxx +++ b/core/operations/management/view_index_get_all.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/operations/management/view_index_upsert.cxx b/core/operations/management/view_index_upsert.cxx index 3099da94b..7445f06ee 100644 --- a/core/operations/management/view_index_upsert.cxx +++ b/core/operations/management/view_index_upsert.cxx @@ -21,7 +21,7 @@ #include "core/utils/url_codec.hxx" #include "error_utils.hxx" -#include +#include #include namespace couchbase::core::operations::management diff --git a/core/origin.cxx b/core/origin.cxx index 1030560e8..643b28da5 100644 --- a/core/origin.cxx +++ b/core/origin.cxx @@ -21,8 +21,8 @@ #include "core/utils/connection_string.hxx" #include "topology/configuration.hxx" -#include -#include +#include +#include #include #include diff --git a/core/platform/base64.h b/core/platform/base64.h index ff6b59180..b59098051 100644 --- a/core/platform/base64.h +++ b/core/platform/base64.h @@ -30,11 +30,11 @@ namespace couchbase::core::base64 * @param source the string to encode * @return the base64 encoded value */ -std::string -encode(gsl::span blob, bool pretty_print = false); +auto +encode(gsl::span blob, bool pretty_print = false) -> std::string; -std::string -encode(std::string_view blob, bool pretty_print = false); +auto +encode(std::string_view blob, bool pretty_print = false) -> std::string; /** * Decode a base64 encoded blob (which may be pretty-printed to avoid @@ -43,10 +43,10 @@ encode(std::string_view blob, bool pretty_print = false); * @param source string to decode * @return the decoded data */ -std::vector -decode(std::string_view blob); +auto +decode(std::string_view blob) -> std::vector; -std::string -decode_to_string(std::string_view blob); +auto +decode_to_string(std::string_view blob) -> std::string; } // namespace couchbase::core::base64 diff --git a/core/protocol/client_opcode_fmt.hxx b/core/protocol/client_opcode_fmt.hxx index 22d57294b..f33db36bf 100644 --- a/core/protocol/client_opcode_fmt.hxx +++ b/core/protocol/client_opcode_fmt.hxx @@ -19,7 +19,7 @@ #include "client_opcode.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/protocol/client_response.hxx b/core/protocol/client_response.hxx index e4abe3802..9a3f9aefe 100644 --- a/core/protocol/client_response.hxx +++ b/core/protocol/client_response.hxx @@ -33,8 +33,8 @@ #include "status.hxx" #include -#include #include +#include #include #include diff --git a/core/protocol/frame_info_id_fmt.hxx b/core/protocol/frame_info_id_fmt.hxx index 58dbcf3a1..b947ec71a 100644 --- a/core/protocol/frame_info_id_fmt.hxx +++ b/core/protocol/frame_info_id_fmt.hxx @@ -19,7 +19,7 @@ #include "frame_info_id.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/protocol/hello_feature_fmt.hxx b/core/protocol/hello_feature_fmt.hxx index 5f00575df..5ffd99877 100644 --- a/core/protocol/hello_feature_fmt.hxx +++ b/core/protocol/hello_feature_fmt.hxx @@ -19,7 +19,7 @@ #include "hello_feature.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/protocol/magic_fmt.hxx b/core/protocol/magic_fmt.hxx index 55df5cda9..fa9329433 100644 --- a/core/protocol/magic_fmt.hxx +++ b/core/protocol/magic_fmt.hxx @@ -19,7 +19,7 @@ #include "magic.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/protocol/server_opcode_fmt.hxx b/core/protocol/server_opcode_fmt.hxx index 2b4c7fed2..7ad704f51 100644 --- a/core/protocol/server_opcode_fmt.hxx +++ b/core/protocol/server_opcode_fmt.hxx @@ -19,7 +19,7 @@ #include "server_opcode.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/query_context.hxx b/core/query_context.hxx index 003a512ee..788c5f1ba 100644 --- a/core/query_context.hxx +++ b/core/query_context.hxx @@ -16,7 +16,8 @@ */ #pragma once -#include +#include + #include #include @@ -41,13 +42,13 @@ public: { } - bool has_value() const + [[nodiscard]] auto has_value() const -> bool { return bucket_name_.has_value() && !bucket_name_->empty() && scope_name_.has_value() && !scope_name_->empty(); } - std::string value() const + [[nodiscard]] auto value() const -> std::string { if (has_value()) { return fmt::format("{}:`{}`.`{}`", namespace_id_, bucket_name_.value(), scope_name_.value()); @@ -55,7 +56,7 @@ public: return {}; } - std::string bucket_name() const + [[nodiscard]] auto bucket_name() const -> std::string { if (has_value()) { return bucket_name_.value(); @@ -63,7 +64,7 @@ public: return ""; } - std::string scope_name() const + [[nodiscard]] auto scope_name() const -> std::string { if (has_value()) { return scope_name_.value(); @@ -71,7 +72,7 @@ public: return ""; } - std::string namespace_id() const + [[nodiscard]] auto namespace_id() const -> std::string { return namespace_id_; } diff --git a/core/retry_orchestrator.cxx b/core/retry_orchestrator.cxx index df8d7c8cc..c1a081772 100644 --- a/core/retry_orchestrator.cxx +++ b/core/retry_orchestrator.cxx @@ -21,7 +21,7 @@ #include -#include +#include namespace couchbase::core { diff --git a/core/sasl/CMakeLists.txt b/core/sasl/CMakeLists.txt index f5b1169d9..c71856b38 100644 --- a/core/sasl/CMakeLists.txt +++ b/core/sasl/CMakeLists.txt @@ -12,6 +12,5 @@ target_link_libraries( couchbase_sasl PRIVATE project_options project_warnings - fmt::fmt Microsoft.GSL::GSL spdlog::spdlog) diff --git a/core/sasl/error_fmt.h b/core/sasl/error_fmt.h index 07e604219..48bfd3080 100644 --- a/core/sasl/error_fmt.h +++ b/core/sasl/error_fmt.h @@ -19,7 +19,7 @@ #include "error.h" -#include +#include template<> struct fmt::formatter { diff --git a/core/seed_config.cxx b/core/seed_config.cxx index 61c703cf4..79d127b06 100644 --- a/core/seed_config.cxx +++ b/core/seed_config.cxx @@ -15,8 +15,8 @@ #include "seed_config.hxx" -#include -#include +#include +#include namespace couchbase::core { diff --git a/core/service_type_fmt.hxx b/core/service_type_fmt.hxx index f446efc3f..c2329f239 100644 --- a/core/service_type_fmt.hxx +++ b/core/service_type_fmt.hxx @@ -19,7 +19,7 @@ #include "service_type.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/topology/capabilities_fmt.hxx b/core/topology/capabilities_fmt.hxx index 5f27df8fb..0a808f3e0 100644 --- a/core/topology/capabilities_fmt.hxx +++ b/core/topology/capabilities_fmt.hxx @@ -19,7 +19,7 @@ #include "capabilities.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/topology/collections_manifest_fmt.hxx b/core/topology/collections_manifest_fmt.hxx index d5b632fee..f0b728089 100644 --- a/core/topology/collections_manifest_fmt.hxx +++ b/core/topology/collections_manifest_fmt.hxx @@ -21,7 +21,8 @@ #include "core/utils/join_strings.hxx" -#include +#include + #include template<> diff --git a/core/topology/configuration_fmt.hxx b/core/topology/configuration_fmt.hxx index f0947db88..b20bf8309 100644 --- a/core/topology/configuration_fmt.hxx +++ b/core/topology/configuration_fmt.hxx @@ -22,7 +22,7 @@ #include "core/service_type_fmt.hxx" #include "core/utils/join_strings.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/transactions/async_attempt_context.cxx b/core/transactions/async_attempt_context.cxx index bb18465fb..4eb5d4870 100644 --- a/core/transactions/async_attempt_context.cxx +++ b/core/transactions/async_attempt_context.cxx @@ -18,7 +18,7 @@ #include #include -#include +#include namespace couchbase::transactions { diff --git a/core/transactions/async_attempt_context.hxx b/core/transactions/async_attempt_context.hxx index 455ee7db8..fb36fad86 100644 --- a/core/transactions/async_attempt_context.hxx +++ b/core/transactions/async_attempt_context.hxx @@ -22,7 +22,6 @@ #include -#include #include #include diff --git a/core/transactions/attempt_context.cxx b/core/transactions/attempt_context.cxx index 16becb0a1..b762096b2 100644 --- a/core/transactions/attempt_context.cxx +++ b/core/transactions/attempt_context.cxx @@ -18,7 +18,7 @@ #include #include -#include +#include namespace couchbase::transactions { diff --git a/core/transactions/exceptions_fmt.hxx b/core/transactions/exceptions_fmt.hxx index d4af92850..06232ab9b 100644 --- a/core/transactions/exceptions_fmt.hxx +++ b/core/transactions/exceptions_fmt.hxx @@ -18,7 +18,7 @@ #include "exceptions.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/transactions/internal/atr_cleanup_entry.hxx b/core/transactions/internal/atr_cleanup_entry.hxx index ac4ca13fb..b7178fa22 100644 --- a/core/transactions/internal/atr_cleanup_entry.hxx +++ b/core/transactions/internal/atr_cleanup_entry.hxx @@ -21,7 +21,7 @@ #include "core/transactions/transaction_get_result.hxx" #include "logging.hxx" -#include +#include #include #include diff --git a/core/transactions/internal/client_record.hxx b/core/transactions/internal/client_record.hxx index f32eca6ff..3571b624e 100644 --- a/core/transactions/internal/client_record.hxx +++ b/core/transactions/internal/client_record.hxx @@ -15,7 +15,8 @@ */ #pragma once -#include +#include + #include #include @@ -38,7 +39,7 @@ struct client_record_details { std::uint64_t cas_now_nanos; template - friend OStream& operator<<(OStream& os, const client_record_details& details) + friend auto operator<<(OStream& os, const client_record_details& details) -> OStream& { os << "client_record_details{"; os << "client_uuid: " << details.client_uuid; @@ -50,7 +51,7 @@ struct client_record_details { os << ", override_expires: " << details.override_expires; os << ", cas_now_nanos: " << details.cas_now_nanos; os << ", expired_client_ids: ["; - for (auto& id : details.expired_client_ids) { + for (const auto& id : details.expired_client_ids) { os << id << ","; } os << "]}"; diff --git a/core/transactions/internal/doc_record_fmt.hxx b/core/transactions/internal/doc_record_fmt.hxx index 7257ef735..d377b9f32 100644 --- a/core/transactions/internal/doc_record_fmt.hxx +++ b/core/transactions/internal/doc_record_fmt.hxx @@ -17,7 +17,7 @@ #include "doc_record.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/transactions/internal/exceptions_internal.hxx b/core/transactions/internal/exceptions_internal.hxx index 5bfd99a5c..b18db38c2 100644 --- a/core/transactions/internal/exceptions_internal.hxx +++ b/core/transactions/internal/exceptions_internal.hxx @@ -22,8 +22,6 @@ #include "core/error_context/transaction_op_error_context.hxx" -#include - #include #include diff --git a/core/transactions/internal/exceptions_internal_fmt.hxx b/core/transactions/internal/exceptions_internal_fmt.hxx index 8cb6c7a67..1620e16dd 100644 --- a/core/transactions/internal/exceptions_internal_fmt.hxx +++ b/core/transactions/internal/exceptions_internal_fmt.hxx @@ -16,7 +16,7 @@ #pragma once -#include +#include template<> struct fmt::formatter { diff --git a/core/transactions/internal/logging.hxx b/core/transactions/internal/logging.hxx index b8231d5ba..8819b188c 100644 --- a/core/transactions/internal/logging.hxx +++ b/core/transactions/internal/logging.hxx @@ -17,6 +17,8 @@ #include +#include + namespace couchbase::core::transactions { #define CB_ORIGINAL_FMT(fmt, ...) fmt diff --git a/core/transactions/result_fmt.hxx b/core/transactions/result_fmt.hxx index 2456c9d2e..48584e56a 100644 --- a/core/transactions/result_fmt.hxx +++ b/core/transactions/result_fmt.hxx @@ -18,7 +18,7 @@ #include "result.hxx" -#include +#include template<> struct fmt::formatter { diff --git a/core/transactions/transaction_links.hxx b/core/transactions/transaction_links.hxx index cfaebf88e..9a792a12a 100644 --- a/core/transactions/transaction_links.hxx +++ b/core/transactions/transaction_links.hxx @@ -18,7 +18,7 @@ #include -#include +#include #include #include diff --git a/core/utils/join_strings.hxx b/core/utils/join_strings.hxx index 24fd4f927..1c75c55c9 100644 --- a/core/utils/join_strings.hxx +++ b/core/utils/join_strings.hxx @@ -17,7 +17,8 @@ #pragma once -#include +#include + #include namespace couchbase::core::utils @@ -46,7 +47,6 @@ join_strings(const Range& values, const std::string& sep) -> std::string * Joins a list of objects together using fmt:: for formatting. */ template - auto join_strings_fmt(const Range& values, const std::string& sep) -> std::string { diff --git a/core/utils/keyspace.hxx b/core/utils/keyspace.hxx index 3ed2f770a..6772ee3f6 100644 --- a/core/utils/keyspace.hxx +++ b/core/utils/keyspace.hxx @@ -17,7 +17,8 @@ #pragma once -#include +#include + #include namespace couchbase::core::utils diff --git a/core/utils/url_codec.cxx b/core/utils/url_codec.cxx index be56c51cc..e2f3188ea 100644 --- a/core/utils/url_codec.cxx +++ b/core/utils/url_codec.cxx @@ -17,7 +17,7 @@ #include "url_codec.hxx" -#include +#include #include #include diff --git a/couchbase-sdk-cxx-black-duck-manifest.yaml b/couchbase-sdk-cxx-black-duck-manifest.yaml index 5bc15521e..02bd4d2b8 100644 --- a/couchbase-sdk-cxx-black-duck-manifest.yaml +++ b/couchbase-sdk-cxx-black-duck-manifest.yaml @@ -3,9 +3,6 @@ components: boringssl: bd-id: 1e303b15-b82b-4a4d-8cd6-a2048fb2c73d versions: [ 20200921 ] - fmt: - bd-id: eae20828-18b8-478f-83b3-4a058748a28b - versions: [ 11.0.1 ] spdlog: bd-id: 7785114c-5b78-4aad-8771-72a739a1f06e versions: [ v1.14.1 ] diff --git a/couchbase/fmt/analytics_scan_consistency.hxx b/couchbase/fmt/analytics_scan_consistency.hxx index f9192ad5f..456b74f8a 100644 --- a/couchbase/fmt/analytics_scan_consistency.hxx +++ b/couchbase/fmt/analytics_scan_consistency.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::analytics_scan_consistency objects. * diff --git a/couchbase/fmt/analytics_status.hxx b/couchbase/fmt/analytics_status.hxx index 8262a85b8..bf143b1b6 100644 --- a/couchbase/fmt/analytics_status.hxx +++ b/couchbase/fmt/analytics_status.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::analytics_status objects. * diff --git a/couchbase/fmt/cas.hxx b/couchbase/fmt/cas.hxx index 2ec570aac..8feea98e4 100644 --- a/couchbase/fmt/cas.hxx +++ b/couchbase/fmt/cas.hxx @@ -19,8 +19,6 @@ #include -#include - #ifdef COUCHBASE_CXX_CLIENT_DOXYGEN namespace fmt { diff --git a/couchbase/fmt/durability_level.hxx b/couchbase/fmt/durability_level.hxx index fe50db756..3d4661ea1 100644 --- a/couchbase/fmt/durability_level.hxx +++ b/couchbase/fmt/durability_level.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::durability_level objects. * diff --git a/couchbase/fmt/error.hxx b/couchbase/fmt/error.hxx index 62aeed963..a4fb85bf4 100644 --- a/couchbase/fmt/error.hxx +++ b/couchbase/fmt/error.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::error objects. * diff --git a/couchbase/fmt/error_context.hxx b/couchbase/fmt/error_context.hxx index 91e4818c0..0548caccf 100644 --- a/couchbase/fmt/error_context.hxx +++ b/couchbase/fmt/error_context.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::error_context objects. * diff --git a/couchbase/fmt/mutation_token.hxx b/couchbase/fmt/mutation_token.hxx index ff6c2c1a2..15db5fdfa 100644 --- a/couchbase/fmt/mutation_token.hxx +++ b/couchbase/fmt/mutation_token.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::mutation_token objects. * diff --git a/couchbase/fmt/query_profile.hxx b/couchbase/fmt/query_profile.hxx index d4ecddb61..abf9fd08a 100644 --- a/couchbase/fmt/query_profile.hxx +++ b/couchbase/fmt/query_profile.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::query_profile objects. * diff --git a/couchbase/fmt/query_scan_consistency.hxx b/couchbase/fmt/query_scan_consistency.hxx index f37ee7983..2bfc8a49f 100644 --- a/couchbase/fmt/query_scan_consistency.hxx +++ b/couchbase/fmt/query_scan_consistency.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::query_scan_consistency objects. * diff --git a/couchbase/fmt/query_status.hxx b/couchbase/fmt/query_status.hxx index 89ae0ced4..776bddf73 100644 --- a/couchbase/fmt/query_status.hxx +++ b/couchbase/fmt/query_status.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::query_status objects. * diff --git a/couchbase/fmt/retry_reason.hxx b/couchbase/fmt/retry_reason.hxx index bcaf8bb94..069c313e4 100644 --- a/couchbase/fmt/retry_reason.hxx +++ b/couchbase/fmt/retry_reason.hxx @@ -19,7 +19,11 @@ #include -#include +#ifdef COUCHBASE_CXX_CLIENT_DOXYGEN +namespace fmt +{ +} +#endif /** * Helper for fmtlib to format @ref couchbase::retry_reason objects. diff --git a/couchbase/fmt/search_scan_consistency.hxx b/couchbase/fmt/search_scan_consistency.hxx index 9cc7154c2..e6c101a67 100644 --- a/couchbase/fmt/search_scan_consistency.hxx +++ b/couchbase/fmt/search_scan_consistency.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::search_scan_consistency objects. * diff --git a/couchbase/fmt/tls_verify_mode.hxx b/couchbase/fmt/tls_verify_mode.hxx index 1d0748675..036a90dfd 100644 --- a/couchbase/fmt/tls_verify_mode.hxx +++ b/couchbase/fmt/tls_verify_mode.hxx @@ -19,8 +19,6 @@ #include -#include - /** * Helper for fmtlib to format @ref couchbase::tls_verify_mode objects. * diff --git a/couchbase/fmt/transaction_keyspace.hxx b/couchbase/fmt/transaction_keyspace.hxx index 1f29badf2..f9bf29892 100644 --- a/couchbase/fmt/transaction_keyspace.hxx +++ b/couchbase/fmt/transaction_keyspace.hxx @@ -18,8 +18,6 @@ #include -#include - template<> struct fmt::formatter { public: diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index bef46a0d5..108fb2104 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -5,7 +5,6 @@ macro(define_example name) ${name} ${CMAKE_THREAD_LIBS_INIT} taocpp::json - fmt::fmt spdlog::spdlog asio ${couchbase_cxx_client_DEFAULT_LIBRARY}) diff --git a/examples/async_game_server.cxx b/examples/async_game_server.cxx index 86b4f00c7..110ae0c55 100644 --- a/examples/async_game_server.cxx +++ b/examples/async_game_server.cxx @@ -17,9 +17,12 @@ #include #include -#include #include +#include + +#include + #include #include #include diff --git a/examples/bulk_base_api.cxx b/examples/bulk_base_api.cxx index c467e0218..a9602ac89 100644 --- a/examples/bulk_base_api.cxx +++ b/examples/bulk_base_api.cxx @@ -17,11 +17,12 @@ #include #include -#include -#include +#include #include +#include + #include #include #include diff --git a/examples/bulk_transactional_api.cxx b/examples/bulk_transactional_api.cxx index 9bb2e823a..09afc2187 100644 --- a/examples/bulk_transactional_api.cxx +++ b/examples/bulk_transactional_api.cxx @@ -17,13 +17,14 @@ #include #include -#include #include -#include -#include +#include +#include #include +#include + #include #include #include diff --git a/examples/bulk_transactional_get_replace.cxx b/examples/bulk_transactional_get_replace.cxx index e77041d71..ee99e9ede 100644 --- a/examples/bulk_transactional_get_replace.cxx +++ b/examples/bulk_transactional_get_replace.cxx @@ -17,13 +17,14 @@ #include #include -#include #include -#include -#include +#include +#include #include +#include + #include #include #include diff --git a/examples/distributed_mutex.cxx b/examples/distributed_mutex.cxx index 1e6c18521..a075215f6 100644 --- a/examples/distributed_mutex.cxx +++ b/examples/distributed_mutex.cxx @@ -18,15 +18,16 @@ #include #include #include -#include -#include -#include +#include +#include + +#include #include +#include #include -#include #include static constexpr auto connection_string{ "couchbase://127.0.0.1" }; diff --git a/examples/game_server.cxx b/examples/game_server.cxx index aac66c158..5b66e985c 100644 --- a/examples/game_server.cxx +++ b/examples/game_server.cxx @@ -17,11 +17,12 @@ #include #include -#include #include #include +#include + #include #include #include diff --git a/examples/minimal.cxx b/examples/minimal.cxx index 8b5ecc6f5..b992fc61e 100644 --- a/examples/minimal.cxx +++ b/examples/minimal.cxx @@ -17,9 +17,12 @@ #include #include -#include #include +#include + +#include + #include #include diff --git a/test/test_integration_examples.cxx b/test/test_integration_examples.cxx index 2a574db23..6efc5924b 100644 --- a/test/test_integration_examples.cxx +++ b/test/test_integration_examples.cxx @@ -34,12 +34,11 @@ #include #include +#include +#include #include #include -#include -#include - #ifndef _WIN32 #include #endif @@ -274,8 +273,6 @@ namespace example_search #include -#include - class github_actions_configuration_profile : public couchbase::configuration_profile { public: @@ -724,7 +721,6 @@ namespace example_fork #include #include -#include #include #include diff --git a/test/test_transaction_examples.cxx b/test/test_transaction_examples.cxx index fa142d71c..ebbb045f2 100644 --- a/test/test_transaction_examples.cxx +++ b/test/test_transaction_examples.cxx @@ -20,12 +20,14 @@ #include #include #include -#include -#include +#include #include #include +#include +#include + namespace blocking_txn { //! [blocking-txn] @@ -375,14 +377,9 @@ class byte_appender using iterator_category = std::output_iterator_tag; using value_type = void; - explicit byte_appender(std::vector& output) - : output_{ output } - { - } - auto operator=(char ch) -> byte_appender& { - output_.push_back(static_cast(ch)); + buffer_.push_back(static_cast(ch)); return *this; } @@ -401,8 +398,13 @@ class byte_appender return *this; } + [[nodiscard]] auto buffer() const -> const std::vector& + { + return buffer_; + } + private: - std::vector& output_; + std::vector buffer_{}; }; template<> @@ -450,8 +452,7 @@ class ledger [[nodiscard]] auto to_csv() const -> std::vector { - std::vector buffer; - byte_appender output(buffer); + byte_appender output; fmt::format_to(output, "Date,Description,Account,Debit,Credit\n"); for (const auto& entry : entries_) { @@ -463,7 +464,7 @@ class ledger entry.debit, entry.credit); } - return buffer; + return output.buffer(); } static auto from_csv(const std::vector& blob) -> ledger diff --git a/test/test_transaction_simple.cxx b/test/test_transaction_simple.cxx index d74725cbf..a0ef82883 100644 --- a/test/test_transaction_simple.cxx +++ b/test/test_transaction_simple.cxx @@ -22,7 +22,6 @@ #include "core/transactions.hxx" #include "core/transactions/atr_ids.hxx" -#include #include #include diff --git a/test/test_transaction_simple_async.cxx b/test/test_transaction_simple_async.cxx index fd45843aa..48f19f772 100644 --- a/test/test_transaction_simple_async.cxx +++ b/test/test_transaction_simple_async.cxx @@ -21,8 +21,6 @@ #include "core/transactions/attempt_context_impl.hxx" #include "simple_object.hxx" -#include - #include #include #include diff --git a/test/utils/CMakeLists.txt b/test/utils/CMakeLists.txt index 845289f26..271d27e61 100644 --- a/test/utils/CMakeLists.txt +++ b/test/utils/CMakeLists.txt @@ -16,7 +16,6 @@ target_link_libraries( Microsoft.GSL::GSL asio taocpp::json - fmt::fmt spdlog::spdlog) target_include_directories(test_utils PRIVATE ${PROJECT_SOURCE_DIR}) target_include_directories(test_utils PRIVATE ${PROJECT_BINARY_DIR}/generated) diff --git a/test/utils/test_data.cxx b/test/utils/test_data.cxx index d4a78a474..8a96530fc 100644 --- a/test/utils/test_data.cxx +++ b/test/utils/test_data.cxx @@ -17,8 +17,8 @@ #include "core/mcbp/big_endian.hxx" -#include -#include +#include +#include #include #include diff --git a/test/utils/wait_until.cxx b/test/utils/wait_until.cxx index 57b29c937..c72e2f67c 100644 --- a/test/utils/wait_until.cxx +++ b/test/utils/wait_until.cxx @@ -34,7 +34,7 @@ #include "core/topology/collections_manifest_fmt.hxx" #include "core/utils/json.hxx" -#include +#include #include namespace test::utils diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 63464d644..786efa26f 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -38,7 +38,6 @@ target_link_libraries( CLI11 Microsoft.GSL::GSL taocpp::json - fmt::fmt spdlog::spdlog hdr_histogram_static asio) diff --git a/tools/analytics.cxx b/tools/analytics.cxx index ec9f9b674..c67e95d36 100644 --- a/tools/analytics.cxx +++ b/tools/analytics.cxx @@ -29,8 +29,8 @@ #include #include -#include #include +#include #include #include diff --git a/tools/beam.cxx b/tools/beam.cxx index f5713c8d8..4fc7196d1 100644 --- a/tools/beam.cxx +++ b/tools/beam.cxx @@ -24,13 +24,14 @@ #include #include + +#include +#include + #include #include #include -#include -#include - #include namespace cbc diff --git a/tools/cbc.cxx b/tools/cbc.cxx index 56c08dff3..3a526ebfa 100644 --- a/tools/cbc.cxx +++ b/tools/cbc.cxx @@ -24,7 +24,7 @@ #include "core/meta/version.hxx" -#include +#include int main(int argc, const char** argv) diff --git a/tools/get.cxx b/tools/get.cxx index 138f0127c..7c5f7aa0c 100644 --- a/tools/get.cxx +++ b/tools/get.cxx @@ -22,13 +22,14 @@ #include #include #include -#include -#include -#include #include +#include #include +#include +#include + namespace cbc { namespace diff --git a/tools/pillowfight.cxx b/tools/pillowfight.cxx index dd24378f7..f6d641bec 100644 --- a/tools/pillowfight.cxx +++ b/tools/pillowfight.cxx @@ -26,17 +26,18 @@ #include #include #include -#include -#include #include #include -#include -#include #include #include +#include +#include #include +#include +#include + #include #include #include diff --git a/tools/query.cxx b/tools/query.cxx index 7522d5e52..8fd477e67 100644 --- a/tools/query.cxx +++ b/tools/query.cxx @@ -30,8 +30,8 @@ #include #include -#include #include +#include #include #include diff --git a/tools/utils.cxx b/tools/utils.cxx index cb7786199..ddce9fb68 100644 --- a/tools/utils.cxx +++ b/tools/utils.cxx @@ -29,8 +29,8 @@ #include #include -#include #include +#include #include #include diff --git a/tools/utils.hxx b/tools/utils.hxx index 2ece6fd23..74b01eb87 100644 --- a/tools/utils.hxx +++ b/tools/utils.hxx @@ -25,8 +25,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/tools/version.cxx b/tools/version.cxx index 6f978445c..bad019399 100644 --- a/tools/version.cxx +++ b/tools/version.cxx @@ -19,7 +19,7 @@ #include -#include +#include #include namespace