From ea4ae44330e64efc5841ae06db838690a22b2a41 Mon Sep 17 00:00:00 2001 From: Rustam Gamidov Date: Thu, 5 Mar 2026 08:13:40 +0200 Subject: [PATCH 1/2] Use Boost::json in olp-cpp-sdk-dataservice-write Migrating from RapidJSON Relates-To: OCMAM-445 Signed-off-by: Rustam Gamidov --- olp-cpp-sdk-dataservice-write/CMakeLists.txt | 20 +- .../src/generated/parser/ApiParser.cpp | 6 +- .../src/generated/parser/ApiParser.h | 6 +- .../src/generated/parser/CatalogParser.cpp | 32 ++-- .../src/generated/parser/CatalogParser.h | 30 +-- .../src/generated/parser/DetailsParser.cpp | 6 +- .../src/generated/parser/DetailsParser.h | 6 +- .../generated/parser/LayerVersionsParser.cpp | 10 +- .../generated/parser/LayerVersionsParser.h | 8 +- .../src/generated/parser/PartitionParser.h | 8 +- .../src/generated/parser/PartitionsParser.cpp | 10 +- .../src/generated/parser/PartitionsParser.h | 8 +- .../generated/parser/PublicationParser.cpp | 7 +- .../src/generated/parser/PublicationParser.h | 6 +- .../parser/PublishDataRequestParser.cpp | 8 +- .../parser/PublishDataRequestParser.h | 6 +- .../parser/PublishPartitionParser.cpp | 8 +- .../generated/parser/PublishPartitionParser.h | 6 +- .../parser/PublishPartitionsParser.cpp | 6 +- .../parser/PublishPartitionsParser.h | 6 +- .../src/generated/parser/ResponseOkParser.cpp | 13 +- .../src/generated/parser/ResponseOkParser.h | 8 +- .../parser/ResponseOkSingleParser.cpp | 6 +- .../generated/parser/ResponseOkSingleParser.h | 6 +- .../parser/VersionDependencyParser.cpp | 6 +- .../parser/VersionDependencyParser.h | 6 +- .../parser/VersionResponseParser.cpp | 6 +- .../generated/parser/VersionResponseParser.h | 6 +- .../generated/serializer/ApiSerializer.cpp | 18 +- .../src/generated/serializer/ApiSerializer.h | 7 +- .../serializer/CatalogSerializer.cpp | 177 ++++++++---------- .../generated/serializer/CatalogSerializer.h | 45 ++--- .../serializer/IndexInfoSerializer.cpp | 82 ++++---- .../serializer/IndexInfoSerializer.h | 8 +- .../src/generated/serializer/JsonSerializer.h | 23 +-- .../serializer/PublicationSerializer.cpp | 59 +++--- .../serializer/PublicationSerializer.h | 7 +- .../PublishDataRequestSerializer.cpp | 23 +-- .../serializer/PublishDataRequestSerializer.h | 7 +- .../serializer/PublishPartitionSerializer.cpp | 27 ++- .../serializer/PublishPartitionSerializer.h | 7 +- .../PublishPartitionsSerializer.cpp | 19 +- .../serializer/PublishPartitionsSerializer.h | 7 +- .../UpdateIndexRequestSerializer.cpp | 91 ++++----- .../serializer/UpdateIndexRequestSerializer.h | 7 +- .../src/utils/BoostJsonSrc.cpp | 20 ++ 46 files changed, 440 insertions(+), 454 deletions(-) create mode 100644 olp-cpp-sdk-dataservice-write/src/utils/BoostJsonSrc.cpp diff --git a/olp-cpp-sdk-dataservice-write/CMakeLists.txt b/olp-cpp-sdk-dataservice-write/CMakeLists.txt index 8678b7ecb..91f2a3d86 100644 --- a/olp-cpp-sdk-dataservice-write/CMakeLists.txt +++ b/olp-cpp-sdk-dataservice-write/CMakeLists.txt @@ -18,6 +18,8 @@ project(olp-cpp-sdk-dataservice-write VERSION 1.24.0) set(DESCRIPTION "C++ API library for writing data to OLP") +find_package(Boost REQUIRED) + set(OLP_SDK_DATASERVICE_WRITE_API_HEADERS ./include/olp/dataservice/write/DataServiceWriteApi.h ./include/olp/dataservice/write/IndexLayerClient.h @@ -159,16 +161,21 @@ set(OLP_SDK_DATASERVICE_WRITE_SOURCES ./src/generated/serializer/PublishPartitionsSerializer.h ./src/generated/serializer/UpdateIndexRequestSerializer.cpp ./src/generated/serializer/UpdateIndexRequestSerializer.h + + ./src/utils/BoostJsonSrc.cpp ) add_library(${PROJECT_NAME} ${OLP_SDK_DATASERVICE_WRITE_INCLUDES} ${OLP_SDK_DATASERVICE_WRITE_SOURCES}) -target_include_directories(${PROJECT_NAME} PUBLIC - $ - $ - PRIVATE $) +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ + PRIVATE + $ + $) target_compile_definitions(${PROJECT_NAME} PRIVATE DATASERVICE_WRITE_LIBRARY) @@ -177,6 +184,11 @@ if(BUILD_SHARED_LIBS) PUBLIC DATASERVICE_WRITE_SHARED_LIBRARY) endif() +target_compile_definitions(${PROJECT_NAME} + PRIVATE + BOOST_ALL_NO_LIB + BOOST_JSON_NO_LIB) + # Used also in the package config file set(PROJECT_LIBS olp-cpp-sdk-core) diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.cpp index 5f47acdad..e2fb96cc9 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,13 @@ #include "ApiParser.h" +#include + #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Api& x) { x.SetApi(parse(value, "api")); x.SetVersion(parse(value, "version")); diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.h index e3b949c79..eef0478a8 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,14 @@ #pragma once -#include +#include #include "generated/model/Api.h" #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Api& x); } // namespace parser diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp index 8e019993b..7f509a189 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,48 +19,50 @@ #include "CatalogParser.h" +#include + #include namespace olp { namespace parser { -using namespace olp::dataservice::write; +namespace model = olp::dataservice::write::model; -void from_json(const rapidjson::Value& value, model::Coverage& x) { +void from_json(const boost::json::value& value, model::Coverage& x) { x.SetAdminAreas(parse >(value, "adminAreas")); } -void from_json(const rapidjson::Value& value, model::IndexDefinition& x) { +void from_json(const boost::json::value& value, model::IndexDefinition& x) { x.SetName(parse(value, "name")); x.SetType(parse(value, "type")); x.SetDuration(parse(value, "duration")); x.SetZoomLevel(parse(value, "zoomLevel")); } -void from_json(const rapidjson::Value& value, model::IndexProperties& x) { +void from_json(const boost::json::value& value, model::IndexProperties& x) { x.SetTtl(parse(value, "ttl")); x.SetIndexDefinitions( parse >(value, "indexDefinitions")); } -void from_json(const rapidjson::Value& value, model::Creator& x) { +void from_json(const boost::json::value& value, model::Creator& x) { x.SetId(parse(value, "id")); } -void from_json(const rapidjson::Value& value, model::Owner& x) { +void from_json(const boost::json::value& value, model::Owner& x) { x.SetCreator(parse(value, "creator")); x.SetOrganisation(parse(value, "organisation")); } -void from_json(const rapidjson::Value& value, model::Partitioning& x) { +void from_json(const boost::json::value& value, model::Partitioning& x) { x.SetScheme(parse(value, "scheme")); x.SetTileLevels(parse >(value, "tileLevels")); } -void from_json(const rapidjson::Value& value, model::Schema& x) { +void from_json(const boost::json::value& value, model::Schema& x) { x.SetHrn(parse(value, "hrn")); } -void from_json(const rapidjson::Value& value, model::StreamProperties& x) { +void from_json(const boost::json::value& value, model::StreamProperties& x) { // Parsing these as double even though OepnAPI sepcs says int64 because // Backend returns the value in decimal format (e.g. 1.0) and this triggers an // assert in RapidJSON when parsing. @@ -70,18 +72,18 @@ void from_json(const rapidjson::Value& value, model::StreamProperties& x) { static_cast(parse(value, "dataOutThroughputMbps"))); } -void from_json(const rapidjson::Value& value, model::Encryption& x) { +void from_json(const boost::json::value& value, model::Encryption& x) { x.SetAlgorithm(parse(value, "algorithm")); } -void from_json(const rapidjson::Value& value, model::Volume& x) { +void from_json(const boost::json::value& value, model::Volume& x) { x.SetVolumeType(parse(value, "volumeType")); x.SetMaxMemoryPolicy(parse(value, "maxMemoryPolicy")); x.SetPackageType(parse(value, "packageType")); x.SetEncryption(parse(value, "encryption")); } -void from_json(const rapidjson::Value& value, model::Layer& x) { +void from_json(const boost::json::value& value, model::Layer& x) { x.SetId(parse(value, "id")); x.SetName(parse(value, "name")); x.SetSummary(parse(value, "summary")); @@ -103,11 +105,11 @@ void from_json(const rapidjson::Value& value, model::Layer& x) { x.SetVolume(parse(value, "volume")); } -void from_json(const rapidjson::Value& value, model::Notifications& x) { +void from_json(const boost::json::value& value, model::Notifications& x) { x.SetEnabled(parse(value, "enabled")); } -void from_json(const rapidjson::Value& value, model::Catalog& x) { +void from_json(const boost::json::value& value, model::Catalog& x) { x.SetId(parse(value, "id")); x.SetHrn(parse(value, "hrn")); x.SetName(parse(value, "name")); diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.h index 5200ce64c..832e686cf 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,49 +21,49 @@ #include -#include +#include #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Coverage& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::IndexDefinition& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::IndexProperties& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Creator& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Owner& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Partitioning& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Schema& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::StreamProperties& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Encryption& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Volume& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Layer& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Notifications& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Catalog& x); } // namespace parser } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.cpp index 25a613b02..575900c01 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,13 @@ #include "DetailsParser.h" +#include + #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Details& x) { x.SetState(parse(value, "state")); x.SetMessage(parse(value, "message")); diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.h index f61d37a2f..c1dfb3108 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ #pragma once -#include +#include #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::Details& x); } // namespace parser } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.cpp index 424bdcd6f..6e12f2d93 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,19 +19,21 @@ #include "LayerVersionsParser.h" +#include + #include namespace olp { namespace parser { -using namespace olp::dataservice::write; +namespace model = olp::dataservice::write::model; -void from_json(const rapidjson::Value& value, model::LayerVersion& x) { +void from_json(const boost::json::value& value, model::LayerVersion& x) { x.SetLayer(parse(value, "layer")); x.SetVersion(parse(value, "version")); x.SetTimestamp(parse(value, "timestamp")); } -void from_json(const rapidjson::Value& value, model::LayerVersions& x) { +void from_json(const boost::json::value& value, model::LayerVersions& x) { x.SetLayerVersions( parse>(value, "layerVersions")); x.SetVersion(parse(value, "version")); diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.h index b3fd60089..ccda3b492 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,17 +19,17 @@ #pragma once -#include +#include #include "generated/model/LayerVersions.h" #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::LayerVersion& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::LayerVersions& x); } // namespace parser diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionParser.h index b087c6094..25f6d22dc 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,17 +19,17 @@ #pragma once -#include +#include #include "olp/dataservice/write/model/Partitions.h" #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Partition& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Partitions& x); } // namespace parser diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.cpp index 8e3420373..3ca081962 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,15 @@ #include "PartitionsParser.h" +#include + #include namespace olp { namespace parser { -namespace model = dataservice::write::model; +namespace model = olp::dataservice::write::model; -void from_json(const rapidjson::Value& value, model::Partition& x) { +void from_json(const boost::json::value& value, model::Partition& x) { x.SetChecksum(parse>(value, "checksum")); x.SetCompressedDataSize( parse>(value, "compressedDataSize")); @@ -35,7 +37,7 @@ void from_json(const rapidjson::Value& value, model::Partition& x) { x.SetVersion(parse>(value, "version")); } -void from_json(const rapidjson::Value& value, model::Partitions& x) { +void from_json(const boost::json::value& value, model::Partitions& x) { x.SetPartitions(parse>(value, "partitions")); } diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.h index 9f45ba291..04db33058 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,17 +19,17 @@ #pragma once -#include +#include #include "generated/model/Partitions.h" #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Partition& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Partitions& x); } // namespace parser diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.cpp index 2eff59a0d..cf5e217e9 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,9 @@ #include "PublicationParser.h" +#include +#include + // clang-format off #include #include @@ -27,7 +30,7 @@ namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::Publication& x) { x.SetId(parse(value, "id")); x.SetDetails( diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.h index eb2f67a69..1edeaa216 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ #pragma once -#include +#include #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::Publication& x); } // namespace parser } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.cpp index 45f514774..b3f330fb9 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,17 @@ #include "PublishDataRequestParser.h" +#include +#include +#include + // clang-format off #include // clang-format on namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::PublishDataRequest& x) { x.WithData( (parse>>(value, "data"))); diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.h index 7dd60e032..abf7e89d9 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ #pragma once -#include +#include #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::PublishDataRequest& x); } // namespace parser } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.cpp index 4e4b620af..6ea93e7d7 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,15 @@ #include "PublishPartitionParser.h" +#include +#include +#include + #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::PublishPartition& x) { x.SetPartition(parse(value, "partition")); x.SetChecksum(parse(value, "checksum")); diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.h index 80ad26a18..b0b6e469b 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ #pragma once -#include +#include #include "generated/model/PublishPartition.h" namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::PublishPartition& x); } // namespace parser } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.cpp index 77fa92dcd..3fc02cc55 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include "PublishPartitionsParser.h" +#include + // clang-format off #include #include @@ -26,7 +28,7 @@ namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::PublishPartitions& x) { x.SetPartitions( parse>( diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.h index c7b02a402..abc403199 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ #pragma once -#include +#include #include "generated/model/PublishPartitions.h" namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::PublishPartitions& x); } // namespace parser } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.cpp index 77a770f1e..4bc409ad2 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,19 +19,22 @@ #include "ResponseOkParser.h" +#include +#include + #include -using namespace olp::dataservice::write::model; +namespace model = olp::dataservice::write::model; namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, TraceID& x) { +void from_json(const boost::json::value& value, model::TraceID& x) { x.SetParentID(parse(value, "ParentID")); x.SetGeneratedIDs(parse >(value, "GeneratedIDs")); } -void from_json(const rapidjson::Value& value, ResponseOk& x) { - x.SetTraceID(parse(value, "TraceID")); +void from_json(const boost::json::value& value, model::ResponseOk& x) { + x.SetTraceID(parse(value, "TraceID")); } } // namespace parser diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.h index f545cd854..f4b752aac 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +19,16 @@ #pragma once -#include +#include #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::TraceID& x); -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::ResponseOk& x); } // namespace parser diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.cpp index 3ee2b9a09..7d171d2c2 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,13 @@ #include "ResponseOkSingleParser.h" +#include + #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::ResponseOkSingle& x) { x.SetTraceID(parse(value, "TraceID")); } diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.h index 96b463708..1b14212d3 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ #pragma once -#include +#include #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::ResponseOkSingle& x); } // namespace parser diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.cpp index c5992657f..f0ec5cdc0 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,13 @@ #include "VersionDependencyParser.h" +#include + #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::VersionDependency& x) { x.SetDirect(parse(value, "direct")); x.SetHrn(parse(value, "hrn")); diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.h index 7a69b4105..c7d606823 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ #pragma once -#include +#include #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, dataservice::write::model::VersionDependency& x); } // namespace parser } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.cpp index 723463a62..f093028b2 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +23,9 @@ namespace olp { namespace parser { -using namespace olp::dataservice::write; +namespace model = olp::dataservice::write::model; -void from_json(const rapidjson::Value& value, model::VersionResponse& x) { +void from_json(const boost::json::value& value, model::VersionResponse& x) { x.SetVersion(parse(value, "version")); } diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.h b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.h index f24794631..6d26573bc 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,14 @@ #pragma once -#include +#include #include "olp/dataservice/write/model/VersionResponse.h" #include namespace olp { namespace parser { -void from_json(const rapidjson::Value& value, +void from_json(const boost::json::value& value, olp::dataservice::write::model::VersionResponse& x); } // namespace parser diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.cpp index 3e14d9a14..8a0f90c31 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ * License-Filename: LICENSE */ -#include +#include #include "ApiSerializer.h" @@ -25,13 +25,13 @@ namespace olp { namespace serializer { -void to_json(const dataservice::write::model::Api& x, rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("api", x.GetApi(), value, allocator); - serialize("version", x.GetVersion(), value, allocator); - serialize("baseURL", x.GetBaseUrl(), value, allocator); - serialize("parameters", x.GetParameters(), value, allocator); +void to_json(const dataservice::write::model::Api& x, + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("api", x.GetApi(), object); + serialize("version", x.GetVersion(), object); + serialize("baseURL", x.GetBaseUrl(), object); + serialize("parameters", x.GetParameters(), object); } } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.h index 57ad803f3..a36962d04 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,13 @@ #include -#include +#include #include "generated/model/Api.h" namespace olp { namespace serializer { void to_json(const dataservice::write::model::Api& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.cpp index ed6cf3643..dfa547660 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ * License-Filename: LICENSE */ -#include +#include #include "CatalogSerializer.h" @@ -26,133 +26,120 @@ namespace olp { namespace serializer { void to_json(const dataservice::write::model::Coverage& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("adminAreas", x.GetAdminAreas(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("adminAreas", x.GetAdminAreas(), object); } void to_json(const dataservice::write::model::IndexDefinition& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("name", x.GetName(), value, allocator); - serialize("type", x.GetType(), value, allocator); - serialize("duration", x.GetDuration(), value, allocator); - serialize("zoomLevel", x.GetZoomLevel(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("name", x.GetName(), object); + serialize("type", x.GetType(), object); + serialize("duration", x.GetDuration(), object); + serialize("zoomLevel", x.GetZoomLevel(), object); } void to_json(const dataservice::write::model::IndexProperties& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("ttl", x.GetTtl(), value, allocator); - serialize("indexDefinitions", x.GetIndexDefinitions(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("ttl", x.GetTtl(), object); + serialize("indexDefinitions", x.GetIndexDefinitions(), object); } void to_json(const dataservice::write::model::Creator& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("id", x.GetId(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("id", x.GetId(), object); } -void to_json(const dataservice::write::model::Owner& x, rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("creator", x.GetCreator(), value, allocator); - serialize("organisation", x.GetOrganisation(), value, allocator); +void to_json(const dataservice::write::model::Owner& x, + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("creator", x.GetCreator(), object); + serialize("organisation", x.GetOrganisation(), object); } void to_json(const dataservice::write::model::Partitioning& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("scheme", x.GetScheme(), value, allocator); - serialize("tileLevels", x.GetTileLevels(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("scheme", x.GetScheme(), object); + serialize("tileLevels", x.GetTileLevels(), object); } void to_json(const dataservice::write::model::Schema& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("hrn", x.GetHrn(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("hrn", x.GetHrn(), object); } void to_json(const dataservice::write::model::StreamProperties& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("dataInThroughputMbps", x.GetDataInThroughputMbps(), value, - allocator); - serialize("dataOutThroughputMbps", x.GetDataOutThroughputMbps(), value, - allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("dataInThroughputMbps", x.GetDataInThroughputMbps(), object); + serialize("dataOutThroughputMbps", x.GetDataOutThroughputMbps(), object); } void to_json(const dataservice::write::model::Encryption& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("algorithm", x.GetAlgorithm(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("algorithm", x.GetAlgorithm(), object); } void to_json(const dataservice::write::model::Volume& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("volumeType", x.GetVolumeType(), value, allocator); - serialize("maxMemoryPolicy", x.GetMaxMemoryPolicy(), value, allocator); - serialize("packageType", x.GetPackageType(), value, allocator); - serialize("encryption", x.GetEncryption(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("volumeType", x.GetVolumeType(), object); + serialize("maxMemoryPolicy", x.GetMaxMemoryPolicy(), object); + serialize("packageType", x.GetPackageType(), object); + serialize("encryption", x.GetEncryption(), object); } -void to_json(const dataservice::write::model::Layer& x, rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("id", x.GetId(), value, allocator); - serialize("name", x.GetName(), value, allocator); - serialize("summary", x.GetSummary(), value, allocator); - serialize("description", x.GetDescription(), value, allocator); - serialize("owner", x.GetOwner(), value, allocator); - serialize("coverage", x.GetCoverage(), value, allocator); - serialize("schema", x.GetSchema(), value, allocator); - serialize("contentType", x.GetContentType(), value, allocator); - serialize("contentEncoding", x.GetContentEncoding(), value, allocator); - serialize("partitioning", x.GetPartitioning(), value, allocator); - serialize("layerType", x.GetLayerType(), value, allocator); - serialize("digest", x.GetDigest(), value, allocator); - serialize("tags", x.GetTags(), value, allocator); - serialize("billingTags", x.GetBillingTags(), value, allocator); - serialize("ttl", x.GetTtl(), value, allocator); - serialize("indexProperties", x.GetIndexProperties(), value, allocator); - serialize("streamProperties", x.GetStreamProperties(), value, allocator); - serialize("volume", x.GetVolume(), value, allocator); +void to_json(const dataservice::write::model::Layer& x, + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("id", x.GetId(), object); + serialize("name", x.GetName(), object); + serialize("summary", x.GetSummary(), object); + serialize("description", x.GetDescription(), object); + serialize("owner", x.GetOwner(), object); + serialize("coverage", x.GetCoverage(), object); + serialize("schema", x.GetSchema(), object); + serialize("contentType", x.GetContentType(), object); + serialize("contentEncoding", x.GetContentEncoding(), object); + serialize("partitioning", x.GetPartitioning(), object); + serialize("layerType", x.GetLayerType(), object); + serialize("digest", x.GetDigest(), object); + serialize("tags", x.GetTags(), object); + serialize("billingTags", x.GetBillingTags(), object); + serialize("ttl", x.GetTtl(), object); + serialize("indexProperties", x.GetIndexProperties(), object); + serialize("streamProperties", x.GetStreamProperties(), object); + serialize("volume", x.GetVolume(), object); } void to_json(const dataservice::write::model::Notifications& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("enabled", x.GetEnabled(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("enabled", x.GetEnabled(), object); } void to_json(const dataservice::write::model::Catalog& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { - value.SetObject(); - serialize("id", x.GetId(), value, allocator); - serialize("hrn", x.GetHrn(), value, allocator); - serialize("name", x.GetName(), value, allocator); - serialize("summary", x.GetSummary(), value, allocator); - serialize("description", x.GetDescription(), value, allocator); - serialize("coverage", x.GetCoverage(), value, allocator); - serialize("owner", x.GetOwner(), value, allocator); - serialize("tags", x.GetTags(), value, allocator); - serialize("billingTags", x.GetBillingTags(), value, allocator); - serialize("created", x.GetCreated(), value, allocator); - serialize("layers", x.GetLayers(), value, allocator); - serialize("version", x.GetVersion(), value, allocator); - serialize("notifications", x.GetNotifications(), value, allocator); + boost::json::value& value) { + auto& object = value.emplace_object(); + serialize("id", x.GetId(), object); + serialize("hrn", x.GetHrn(), object); + serialize("name", x.GetName(), object); + serialize("summary", x.GetSummary(), object); + serialize("description", x.GetDescription(), object); + serialize("coverage", x.GetCoverage(), object); + serialize("owner", x.GetOwner(), object); + serialize("tags", x.GetTags(), object); + serialize("billingTags", x.GetBillingTags(), object); + serialize("created", x.GetCreated(), object); + serialize("layers", x.GetLayers(), object); + serialize("version", x.GetVersion(), object); + serialize("notifications", x.GetNotifications(), object); } } // namespace serializer diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.h index 934b6f516..dab097e47 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,61 +19,50 @@ #pragma once -#include +#include #include "../model/Catalog.h" namespace olp { namespace serializer { void to_json(const dataservice::write::model::Coverage& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); void to_json(const dataservice::write::model::IndexDefinition& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); void to_json(const dataservice::write::model::IndexProperties& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); void to_json(const dataservice::write::model::Creator& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); -void to_json(const dataservice::write::model::Owner& x, rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); +void to_json(const dataservice::write::model::Owner& x, + boost::json::value& value); void to_json(const dataservice::write::model::Partitioning& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); void to_json(const dataservice::write::model::Schema& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); void to_json(const dataservice::write::model::StreamProperties& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); void to_json(const dataservice::write::model::Encryption& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); void to_json(const dataservice::write::model::Volume& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); -void to_json(const dataservice::write::model::Layer& x, rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); +void to_json(const dataservice::write::model::Layer& x, + boost::json::value& value); void to_json(const dataservice::write::model::Notifications& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); void to_json(const dataservice::write::model::Catalog& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/IndexInfoSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/IndexInfoSerializer.cpp index f95c7a0f7..820d2fdbf 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/IndexInfoSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/IndexInfoSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,71 +19,59 @@ #include "IndexInfoSerializer.h" +#include + namespace olp { namespace serializer { -void to_json(const dataservice::write::model::Index &x, rapidjson::Value &value, - rapidjson::Document::AllocatorType &allocator) { - rapidjson::Value jsonValue(rapidjson::kObjectType); - value.SetArray(); - jsonValue.AddMember("id", rapidjson::StringRef(x.GetId().c_str()), allocator); +void to_json(const dataservice::write::model::Index &x, + boost::json::value &value) { + boost::json::object jsonValue; + value.emplace_array(); + jsonValue.emplace("id", x.GetId()); - rapidjson::Value indexFields(rapidjson::kObjectType); + boost::json::object indexFields; for (auto &field_pair : x.GetIndexFields()) { - using dataservice::write::model::BooleanIndexValue; - using dataservice::write::model::HereTileIndexValue; - using dataservice::write::model::IndexType; - using dataservice::write::model::IntIndexValue; - using dataservice::write::model::StringIndexValue; - using dataservice::write::model::TimeWindowIndexValue; - + namespace model = dataservice::write::model; const auto &field = field_pair.second; - const auto key = rapidjson::StringRef(field_pair.first.c_str()); + const auto &key = field_pair.first; auto index_type = field->getIndexType(); - if (index_type == IndexType::String) { - auto s = std::static_pointer_cast(field); - rapidjson::Value str_val; - const auto &str = s->GetValue(); - str_val.SetString( - str.c_str(), static_cast(str.size()), allocator); - indexFields.AddMember(key, str_val, allocator); - } else if (index_type == IndexType::Int) { - auto s = std::static_pointer_cast(field); - indexFields.AddMember(key, s->GetValue(), allocator); - } else if (index_type == IndexType::Bool) { - auto s = std::static_pointer_cast(field); - indexFields.AddMember(key, s->GetValue(), allocator); - } else if (index_type == IndexType::Heretile) { - auto s = std::static_pointer_cast(field); - indexFields.AddMember(key, s->GetValue(), allocator); - } else if (index_type == IndexType::TimeWindow) { - auto s = std::static_pointer_cast(field); - indexFields.AddMember(key, s->GetValue(), allocator); + if (index_type == model::IndexType::String) { + auto s = std::static_pointer_cast(field); + boost::json::string str_val{s->GetValue()}; + indexFields.emplace(key, std::move(str_val)); + } else if (index_type == model::IndexType::Int) { + auto s = std::static_pointer_cast(field); + indexFields.emplace(key, s->GetValue()); + } else if (index_type == model::IndexType::Bool) { + auto s = std::static_pointer_cast(field); + indexFields.emplace(key, s->GetValue()); + } else if (index_type == model::IndexType::Heretile) { + auto s = std::static_pointer_cast(field); + indexFields.emplace(key, s->GetValue()); + } else if (index_type == model::IndexType::TimeWindow) { + auto s = std::static_pointer_cast(field); + indexFields.emplace(key, s->GetValue()); } } - jsonValue.AddMember("fields", indexFields, allocator); + jsonValue.emplace("fields", std::move(indexFields)); // TODO: Separate Metadata Model serialization into its own file when needed // by another model. if (x.GetMetadata()) { - rapidjson::Value metadatas(rapidjson::kObjectType); - for (const auto &metadata : *x.GetMetadata()) { - auto metadata_value = metadata.second; - auto metadata_key = metadata.first.c_str(); - indexFields.AddMember( - rapidjson::StringRef(metadata_key), - rapidjson::StringRef(metadata_value.c_str(), metadata_value.size()), - allocator); + for (auto &metadata : x.GetMetadata().get()) { + auto &metadata_value = metadata.second; + auto &metadata_key = metadata.first; + indexFields.emplace(metadata_key, metadata_value); } } if (x.GetCheckSum()) { - jsonValue.AddMember( - "checksum", rapidjson::StringRef(x.GetCheckSum()->c_str()), allocator); + jsonValue.emplace("checksum", x.GetCheckSum().get()); } if (x.GetSize()) { - jsonValue.AddMember("size", *x.GetSize(), allocator); + jsonValue.emplace("size", x.GetSize().get()); } - value.PushBack(jsonValue, allocator); + value.as_array().emplace_back(std::move(jsonValue)); } } // namespace serializer diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/IndexInfoSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/IndexInfoSerializer.h index e7732b763..b44fdc47f 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/IndexInfoSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/IndexInfoSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ #pragma once -#include +#include #include namespace olp { namespace serializer { -void to_json(const dataservice::write::model::Index& x, rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); +void to_json(const dataservice::write::model::Index& x, + boost::json::value& value); } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/JsonSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/JsonSerializer.h index 504c6c12a..3d6915c0e 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/JsonSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/JsonSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,24 +19,19 @@ #pragma once -#include -#include -#include +#include + +#include +#include namespace olp { namespace serializer { template inline std::string serialize(const T& object) { - rapidjson::Document doc; - auto& allocator = doc.GetAllocator(); - - doc.SetObject(); - to_json(object, doc, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - doc.Accept(writer); - return buffer.GetString(); + boost::json::value value; + value.emplace_object(); + to_json(object, value); + return boost::json::serialize(value); } } // namespace serializer diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublicationSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublicationSerializer.cpp index ee1df67fa..1c73d48ff 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublicationSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublicationSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,59 +19,54 @@ #include "PublicationSerializer.h" +#include + namespace olp { namespace serializer { void to_json(const dataservice::write::model::Publication& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { + boost::json::value& value) { + auto& object = value.emplace_object(); if (x.GetId()) { - value.AddMember("id", rapidjson::StringRef(x.GetId()->c_str()), allocator); + object.emplace("id", x.GetId().get()); } // TODO: Separate Details Model serializtion into it's own file when needed by // another model. if (x.GetDetails()) { - rapidjson::Value details(rapidjson::kObjectType); - details.AddMember("state", - rapidjson::StringRef(x.GetDetails()->GetState().c_str()), - allocator); - details.AddMember( - "message", rapidjson::StringRef(x.GetDetails()->GetMessage().c_str()), - allocator); - details.AddMember("started", x.GetDetails()->GetStarted(), allocator); - details.AddMember("modified", x.GetDetails()->GetModified(), allocator); - details.AddMember("expires", x.GetDetails()->GetExpires(), allocator); - value.AddMember("details", details, allocator); + boost::json::object details; + details.emplace("state", x.GetDetails()->GetState()); + details.emplace("message", x.GetDetails()->GetMessage()); + details.emplace("started", x.GetDetails()->GetStarted()); + details.emplace("modified", x.GetDetails()->GetModified()); + details.emplace("expires", x.GetDetails()->GetExpires()); + object.emplace("details", std::move(details)); } if (x.GetLayerIds()) { - rapidjson::Value layer_ids(rapidjson::kArrayType); - for (auto& layer_id : *x.GetLayerIds()) { - layer_ids.PushBack(rapidjson::StringRef(layer_id.c_str()), allocator); + boost::json::array layer_ids; + for (auto& layer_id : x.GetLayerIds().get()) { + layer_ids.emplace_back(layer_id); } - value.AddMember("layerIds", layer_ids, allocator); + object.emplace("layerIds", std::move(layer_ids)); } if (x.GetCatalogVersion()) { - value.AddMember("catalogVersion", *x.GetCatalogVersion(), allocator); + object.emplace("catalogVersion", x.GetCatalogVersion().get()); } if (x.GetVersionDependencies()) { - rapidjson::Value version_dependencies(rapidjson::kArrayType); - for (auto& version_dependency : *x.GetVersionDependencies()) { + boost::json::array version_dependencies; + for (auto& version_dependency : x.GetVersionDependencies().get()) { // TODO: Separate VersionDependency Model serializtion into it's own file // when needed by another model. - rapidjson::Value version_dependency_json(rapidjson::kObjectType); - version_dependency_json.AddMember( - "direct", version_dependency.GetDirect(), allocator); - version_dependency_json.AddMember( - "hrn", rapidjson::StringRef(version_dependency.GetHrn().c_str()), - allocator); - version_dependency_json.AddMember( - "version", version_dependency.GetVersion(), allocator); - version_dependencies.PushBack(version_dependency_json, allocator); + boost::json::object version_dependency_json; + version_dependency_json.emplace("direct", version_dependency.GetDirect()); + version_dependency_json.emplace("hrn", version_dependency.GetHrn()); + version_dependency_json.emplace("version", + version_dependency.GetVersion()); + version_dependencies.emplace_back(std::move(version_dependency_json)); } - value.AddMember("versionDependencies", version_dependencies, allocator); + object.emplace("versionDependencies", std::move(version_dependencies)); } } diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublicationSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublicationSerializer.h index c00df9918..1e70410d9 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublicationSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublicationSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,13 @@ #pragma once -#include +#include #include namespace olp { namespace serializer { void to_json(const dataservice::write::model::Publication& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishDataRequestSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishDataRequestSerializer.cpp index c23abe886..7f2669939 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishDataRequestSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishDataRequestSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,32 +22,27 @@ namespace olp { namespace serializer { void to_json(const dataservice::write::model::PublishDataRequest& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { + boost::json::value& value) { + auto& object = value.emplace_object(); if (x.GetData()) { const auto& data = x.GetData().get(); - auto data_stringref = rapidjson::StringRef( + auto data_stringref = boost::json::string_view( reinterpret_cast(data->data()), data->size()); - value.AddMember("data", std::move(data_stringref), allocator); + object.emplace("data", data_stringref); } - value.AddMember("layerId", rapidjson::StringRef(x.GetLayerId().c_str()), - allocator); + object.emplace("layerId", x.GetLayerId()); if (x.GetTraceId()) { - value.AddMember("traceId", rapidjson::StringRef(x.GetTraceId()->c_str()), - allocator); + object.emplace("traceId", x.GetTraceId().get()); } if (x.GetBillingTag()) { - value.AddMember("billingTag", - rapidjson::StringRef(x.GetBillingTag()->c_str()), - allocator); + object.emplace("billingTag", x.GetBillingTag().get()); } if (x.GetChecksum()) { - value.AddMember("checksum", rapidjson::StringRef(x.GetChecksum()->c_str()), - allocator); + object.emplace("checksum", x.GetChecksum().get()); } } diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishDataRequestSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishDataRequestSerializer.h index 687349e27..8609bebd3 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishDataRequestSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishDataRequestSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,13 @@ #pragma once -#include +#include #include namespace olp { namespace serializer { void to_json(const dataservice::write::model::PublishDataRequest& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionSerializer.cpp index 875fc73da..fc93a2ecc 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,42 +22,37 @@ namespace olp { namespace serializer { void to_json(const dataservice::write::model::PublishPartition& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { + boost::json::value& value) { + auto& object = value.emplace_object(); if (x.GetPartition()) { - value.AddMember("partition", - rapidjson::StringRef(x.GetPartition()->c_str()), allocator); + object.emplace("partition", x.GetPartition().get()); } if (x.GetChecksum()) { - value.AddMember("checksum", rapidjson::StringRef(x.GetChecksum()->c_str()), - allocator); + object.emplace("checksum", x.GetChecksum().get()); } if (x.GetCompressedDataSize()) { - value.AddMember("compressedDataSize", *x.GetCompressedDataSize(), - allocator); + object.emplace("compressedDataSize", x.GetCompressedDataSize().get()); } if (x.GetDataSize()) { - value.AddMember("dataSize", *x.GetDataSize(), allocator); + object.emplace("dataSize", x.GetDataSize().get()); } if (x.GetData()) { const auto& data = x.GetData().get(); - auto data_stringref = rapidjson::StringRef( + auto data_stringref = boost::json::string_view( reinterpret_cast(data->data()), data->size()); - value.AddMember("data", std::move(data_stringref), allocator); + object.emplace("data", data_stringref); } if (x.GetDataHandle()) { - value.AddMember("dataHandle", - rapidjson::StringRef(x.GetDataHandle()->c_str()), - allocator); + object.emplace("dataHandle", x.GetDataHandle().get()); } if (x.GetTimestamp()) { - value.AddMember("timestamp", *x.GetTimestamp(), allocator); + object.emplace("timestamp", x.GetTimestamp().get()); } } diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionSerializer.h index 158b8d0df..2ddc4df67 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,13 @@ #pragma once -#include +#include #include "generated/model/PublishPartition.h" namespace olp { namespace serializer { void to_json(const dataservice::write::model::PublishPartition& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionsSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionsSerializer.cpp index 96fa18438..3207d0c2d 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionsSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,21 +19,22 @@ #include "PublishPartitionsSerializer.h" +#include + #include "PublishPartitionSerializer.h" namespace olp { namespace serializer { void to_json(const dataservice::write::model::PublishPartitions& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator) { + boost::json::value& value) { if (x.GetPartitions()) { - rapidjson::Value partitions(rapidjson::kArrayType); - for (auto& partition : *x.GetPartitions()) { - rapidjson::Value partition_value(rapidjson::kObjectType); - to_json(partition, partition_value, allocator); - partitions.PushBack(partition_value, allocator); + boost::json::array partitions; + for (auto& partition : x.GetPartitions().get()) { + boost::json::value partition_value(boost::json::object_kind_t{}); + to_json(partition, partition_value); + partitions.emplace_back(std::move(partition_value)); } - value.AddMember("partitions", partitions, allocator); + value.as_object().emplace("partitions", std::move(partitions)); } } diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionsSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionsSerializer.h index 583ee4e2d..640afbcf4 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionsSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/PublishPartitionsSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,13 @@ #pragma once -#include +#include #include "generated/model/PublishPartitions.h" namespace olp { namespace serializer { void to_json(const dataservice::write::model::PublishPartitions& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/UpdateIndexRequestSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/UpdateIndexRequestSerializer.cpp index d9ce5729e..aab8da29f 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/UpdateIndexRequestSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/UpdateIndexRequestSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,84 +19,69 @@ #include "UpdateIndexRequestSerializer.h" +#include + namespace olp { namespace serializer { void to_json(const dataservice::write::model::UpdateIndexRequest &x, - rapidjson::Value &value, - rapidjson::Document::AllocatorType &allocator) { - rapidjson::Value additions(rapidjson::kArrayType); + boost::json::value &value) { + boost::json::array additions; + value.emplace_object(); for (auto &addition : x.GetIndexAdditions()) { - rapidjson::Value additionValue(rapidjson::kObjectType); - additionValue.AddMember( - "id", rapidjson::StringRef(addition.GetId().c_str()), allocator); + boost::json::object additionValue; + additionValue.emplace("id", addition.GetId()); - rapidjson::Value indexFields(rapidjson::kObjectType); + boost::json::object indexFields; for (const auto &field_pair : addition.GetIndexFields()) { - using dataservice::write::model::BooleanIndexValue; - using dataservice::write::model::HereTileIndexValue; - using dataservice::write::model::IndexType; - using dataservice::write::model::IntIndexValue; - using dataservice::write::model::StringIndexValue; - using dataservice::write::model::TimeWindowIndexValue; - + namespace model = dataservice::write::model; const auto &field = field_pair.second; - const auto key = rapidjson::StringRef(field_pair.first.c_str()); + const auto &key = field_pair.first; auto index_type = field->getIndexType(); - if (index_type == IndexType::String) { - auto s = std::static_pointer_cast(field); - rapidjson::Value str_val; - const auto &str = s->GetValue(); - str_val.SetString(str.c_str(), - static_cast(str.size()), - allocator); - indexFields.AddMember(key, str_val, allocator); - } else if (index_type == IndexType::Int) { - auto s = std::static_pointer_cast(field); - indexFields.AddMember(key, s->GetValue(), allocator); - } else if (index_type == IndexType::Bool) { - auto s = std::static_pointer_cast(field); - indexFields.AddMember(key, s->GetValue(), allocator); - } else if (index_type == IndexType::Heretile) { - auto s = std::static_pointer_cast(field); - indexFields.AddMember(key, s->GetValue(), allocator); - } else if (index_type == IndexType::TimeWindow) { - auto s = std::static_pointer_cast(field); - indexFields.AddMember(key, s->GetValue(), allocator); + if (index_type == model::IndexType::String) { + auto s = std::static_pointer_cast(field); + boost::json::value str_val{s->GetValue()}; + indexFields.emplace(key, std::move(str_val)); + } else if (index_type == model::IndexType::Int) { + auto s = std::static_pointer_cast(field); + indexFields.emplace(key, s->GetValue()); + } else if (index_type == model::IndexType::Bool) { + auto s = std::static_pointer_cast(field); + indexFields.emplace(key, s->GetValue()); + } else if (index_type == model::IndexType::Heretile) { + auto s = std::static_pointer_cast(field); + indexFields.emplace(key, s->GetValue()); + } else if (index_type == model::IndexType::TimeWindow) { + auto s = std::static_pointer_cast(field); + indexFields.emplace(key, s->GetValue()); } } - additionValue.AddMember("fields", indexFields, allocator); + additionValue.emplace("fields", indexFields); // TODO: Separate Details Model serializtion into it's own file when needed // by another model. if (addition.GetMetadata()) { - rapidjson::Value metadatas(rapidjson::kObjectType); - for (const auto &metadata : *addition.GetMetadata()) { + for (const auto &metadata : addition.GetMetadata().get()) { const auto &metadata_value = metadata.second; - const auto &metadata_key = metadata.first.c_str(); - indexFields.AddMember( - rapidjson::StringRef(metadata_key), - rapidjson::StringRef(metadata_value.c_str(), metadata_value.size()), - allocator); + const auto &metadata_key = metadata.first; + indexFields.emplace(metadata_key, metadata_value); } } if (addition.GetCheckSum()) { - additionValue.AddMember( - "checksum", rapidjson::StringRef(addition.GetCheckSum()->c_str()), - allocator); + additionValue.emplace("checksum", addition.GetCheckSum().get()); } if (addition.GetSize()) { - additionValue.AddMember("size", *addition.GetSize(), allocator); + additionValue.emplace("size", addition.GetSize().get()); } - additions.PushBack(additionValue, allocator); + additions.emplace_back(additionValue); } - value.AddMember("additions", additions, allocator); - rapidjson::Value removals(rapidjson::kArrayType); + value.as_object().emplace("additions", std::move(additions)); + boost::json::array removals; for (auto &removal : x.GetIndexRemovals()) { - removals.PushBack(rapidjson::StringRef(removal.c_str()), allocator); + removals.emplace_back(removal); } - value.AddMember("removals", removals, allocator); + value.as_object().emplace("removals", std::move(removals)); } } // namespace serializer diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/UpdateIndexRequestSerializer.h b/olp-cpp-sdk-dataservice-write/src/generated/serializer/UpdateIndexRequestSerializer.h index dd8b8b5e4..77137249d 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/UpdateIndexRequestSerializer.h +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/UpdateIndexRequestSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,15 +19,14 @@ #pragma once -#include +#include #include namespace olp { namespace serializer { void to_json(const dataservice::write::model::UpdateIndexRequest& x, - rapidjson::Value& value, - rapidjson::Document::AllocatorType& allocator); + boost::json::value& value); } // namespace serializer } // namespace olp diff --git a/olp-cpp-sdk-dataservice-write/src/utils/BoostJsonSrc.cpp b/olp-cpp-sdk-dataservice-write/src/utils/BoostJsonSrc.cpp new file mode 100644 index 000000000..017758210 --- /dev/null +++ b/olp-cpp-sdk-dataservice-write/src/utils/BoostJsonSrc.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2026 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +#include From 3ba39fdd8a96d14f8494840bd36b71570d7d2243 Mon Sep 17 00:00:00 2001 From: Rustam Gamidov Date: Tue, 10 Mar 2026 15:49:08 +0200 Subject: [PATCH 2/2] Move json headers from core to internal location Prevents exposing internal headers from being exposed. Could be converted to OBJECTS or static lib if there's need with linking boost to it privately. Considered to be an improvement opportunity for future Relates-To: OCMAM-445 Signed-off-by: Rustam Gamidov --- CMakeLists.txt | 2 + .../include}/generated/parser/JsonParser.h | 2 +- .../include}/generated/parser/ParserWrapper.h | 3 +- .../generated/serializer/SerializerWrapper.h | 2 +- .../include/json_boost/parser/JsonParser.h | 78 ++++++++++++++ .../include/json_boost/parser/ParserWrapper.h | 102 ++++++++++++++++++ .../json_boost/serializer/SerializerWrapper.h | 102 ++++++++++++++++++ olp-cpp-sdk-core/CMakeLists.txt | 10 +- .../src/client/api/JsonResultParser.h | 4 +- .../src/client/parser/ApiParser.cpp | 7 +- olp-cpp-sdk-dataservice-read/CMakeLists.txt | 3 + .../src/JsonResultParser.h | 4 +- .../src/generated/parser/ApiParser.cpp | 6 +- .../src/generated/parser/CatalogParser.cpp | 6 +- .../src/generated/parser/IndexParser.cpp | 7 +- .../generated/parser/LayerVersionsParser.cpp | 8 +- .../src/generated/parser/MessagesParser.cpp | 7 +- .../src/generated/parser/PartitionsParser.cpp | 6 +- .../generated/parser/StreamOffsetParser.cpp | 6 +- .../parser/SubscribeResponseParser.cpp | 8 +- .../generated/parser/VersionInfosParser.cpp | 5 +- .../parser/VersionResponseParser.cpp | 6 +- .../parser/VersionsResponseParser.cpp | 6 +- .../generated/serializer/ApiSerializer.cpp | 4 +- .../serializer/CatalogSerializer.cpp | 4 +- .../serializer/CatalogVersionsSerializer.h | 7 +- .../serializer/ConsumerPropertiesSerializer.h | 8 +- .../serializer/LayerVersionsSerializer.cpp | 4 +- .../serializer/PartitionsSerializer.cpp | 4 +- .../serializer/StreamOffsetsSerializer.cpp | 4 +- .../serializer/VersionInfosSerializer.cpp | 4 +- .../serializer/VersionResponseSerializer.cpp | 4 +- .../PartitionsCacheRepository.cpp | 6 +- .../tests/ParserTest.cpp | 4 +- .../tests/PartitionsCacheRepositoryTest.cpp | 4 +- .../tests/PartitionsRepositoryTest.cpp | 4 +- olp-cpp-sdk-dataservice-write/CMakeLists.txt | 3 + .../src/CatalogSettings.cpp | 6 +- .../src/JsonResultParser.h | 4 +- .../src/generated/parser/ApiParser.cpp | 2 +- .../src/generated/parser/CatalogParser.cpp | 2 +- .../src/generated/parser/DetailsParser.cpp | 2 +- .../generated/parser/LayerVersionsParser.cpp | 2 +- .../src/generated/parser/PartitionsParser.cpp | 2 +- .../generated/parser/PublicationParser.cpp | 2 +- .../parser/PublishDataRequestParser.cpp | 2 +- .../parser/PublishPartitionParser.cpp | 2 +- .../parser/PublishPartitionsParser.cpp | 2 +- .../src/generated/parser/ResponseOkParser.cpp | 2 +- .../parser/ResponseOkSingleParser.cpp | 2 +- .../parser/VersionDependencyParser.cpp | 2 +- .../parser/VersionResponseParser.cpp | 2 +- .../generated/serializer/ApiSerializer.cpp | 2 +- .../serializer/CatalogSerializer.cpp | 2 +- .../tests/ParserTest.cpp | 4 +- ...ionedLayerClientImplPublishToBatchTest.cpp | 4 +- .../tests/VersionedLayerClientImplTest.cpp | 4 +- tests/common/CMakeLists.txt | 1 + tests/common/ReadDefaultResponses.cpp | 4 +- tests/common/ResponseGenerator.cpp | 4 +- tests/common/WriteDefaultResponses.h | 7 +- ...VersionedLayerClientPublishToBatchTest.cpp | 4 +- .../VersionedLayerClientTest.cpp | 4 +- 63 files changed, 424 insertions(+), 106 deletions(-) rename {olp-cpp-sdk-core/include/olp/core => internal/include}/generated/parser/JsonParser.h (97%) rename {olp-cpp-sdk-core/include/olp/core => internal/include}/generated/parser/ParserWrapper.h (97%) rename {olp-cpp-sdk-core/include/olp/core => internal/include}/generated/serializer/SerializerWrapper.h (98%) create mode 100644 internal/include/json_boost/parser/JsonParser.h create mode 100644 internal/include/json_boost/parser/ParserWrapper.h create mode 100644 internal/include/json_boost/serializer/SerializerWrapper.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ae0de8ddc..262a2a693 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") # Save root sdk folder path get_filename_component(OLP_CPP_SDK_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) +set(INTERNAL_INCLUDE_DIR "${OLP_CPP_SDK_ROOT}/internal/include") + # Include common scripts include(common) diff --git a/olp-cpp-sdk-core/include/olp/core/generated/parser/JsonParser.h b/internal/include/generated/parser/JsonParser.h similarity index 97% rename from olp-cpp-sdk-core/include/olp/core/generated/parser/JsonParser.h rename to internal/include/generated/parser/JsonParser.h index d5127e61e..1afe0e2e5 100644 --- a/olp-cpp-sdk-core/include/olp/core/generated/parser/JsonParser.h +++ b/internal/include/generated/parser/JsonParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/olp-cpp-sdk-core/include/olp/core/generated/parser/ParserWrapper.h b/internal/include/generated/parser/ParserWrapper.h similarity index 97% rename from olp-cpp-sdk-core/include/olp/core/generated/parser/ParserWrapper.h rename to internal/include/generated/parser/ParserWrapper.h index 3cdd5e1bd..b2bcc2255 100644 --- a/olp-cpp-sdk-core/include/olp/core/generated/parser/ParserWrapper.h +++ b/internal/include/generated/parser/ParserWrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2023 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/olp-cpp-sdk-core/include/olp/core/generated/serializer/SerializerWrapper.h b/internal/include/generated/serializer/SerializerWrapper.h similarity index 98% rename from olp-cpp-sdk-core/include/olp/core/generated/serializer/SerializerWrapper.h rename to internal/include/generated/serializer/SerializerWrapper.h index 62250586d..25587c93b 100644 --- a/olp-cpp-sdk-core/include/olp/core/generated/serializer/SerializerWrapper.h +++ b/internal/include/generated/serializer/SerializerWrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/internal/include/json_boost/parser/JsonParser.h b/internal/include/json_boost/parser/JsonParser.h new file mode 100644 index 000000000..48f30401e --- /dev/null +++ b/internal/include/json_boost/parser/JsonParser.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2019-2026 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +#pragma once + +#include +#include +#include +#include + +#include + +#include "ParserWrapper.h" + +namespace olp { +namespace parser { + +template +inline T parse(const std::string& json) { + boost::json::error_code ec; + auto value = boost::json::parse(json, ec); + T result{}; + if (value.is_object() || value.is_array()) { + from_json(value, result); + } + return result; +} + +template +inline T parse(std::stringstream& json_stream, bool& res) { + res = false; + boost::json::error_code ec; + auto value = boost::json::parse(json_stream, ec); + T result{}; + if (value.is_object() || value.is_array()) { + from_json(value, result); + res = true; + } + return result; +} + +template +inline T parse(std::stringstream& json_stream) { + bool res = true; + return parse(json_stream, res); +} + +template +inline T parse(const std::shared_ptr>& json_bytes) { + boost::json::string_view json(reinterpret_cast(json_bytes->data()), + json_bytes->size()); + boost::json::error_code ec; + auto value = boost::json::parse(json, ec); + T result{}; + if (value.is_object() || value.is_array()) { + from_json(value, result); + } + return result; +} + +} // namespace parser +} // namespace olp diff --git a/internal/include/json_boost/parser/ParserWrapper.h b/internal/include/json_boost/parser/ParserWrapper.h new file mode 100644 index 000000000..284238474 --- /dev/null +++ b/internal/include/json_boost/parser/ParserWrapper.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2019-2026 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include +#include + +namespace olp { +namespace parser { + +inline void from_json(const boost::json::value& value, std::string& x) { + const auto& str = value.get_string(); + x.assign(str.begin(), str.end()); +} + +inline void from_json(const boost::json::value& value, int32_t& x) { + x = static_cast(value.to_number()); +} + +inline void from_json(const boost::json::value& value, int64_t& x) { + x = value.to_number(); +} + +inline void from_json(const boost::json::value& value, double& x) { + x = value.to_number(); +} + +inline void from_json(const boost::json::value& value, bool& x) { + x = value.get_bool(); +} + +inline void from_json(const boost::json::value& value, + std::shared_ptr>& x) { + const auto& s = value.get_string(); + x = std::make_shared>(s.begin(), s.end()); +} + +template +inline void from_json(const boost::json::value& value, + porting::optional& x) { + T result = T(); + from_json(value, result); + x = result; +} + +template +inline void from_json(const boost::json::value& value, + std::map& results) { + const auto& object = value.get_object(); + for (const auto& object_value : object) { + std::string key = object_value.key(); + from_json(object_value.value(), results[key]); + } +} + +template +inline void from_json(const boost::json::value& value, + std::vector& results) { + const auto& array = value.get_array(); + for (const auto& array_value : array) { + T result; + from_json(array_value, result); + results.emplace_back(std::move(result)); + } +} + +template +inline T parse(const boost::json::value& value, const std::string& name) { + T result = T(); + const auto& object = value.get_object(); + auto itr = object.find(name); + if (itr != object.end()) { + from_json(itr->value(), result); + } + return result; +} + +} // namespace parser +} // namespace olp diff --git a/internal/include/json_boost/serializer/SerializerWrapper.h b/internal/include/json_boost/serializer/SerializerWrapper.h new file mode 100644 index 000000000..7005b9cec --- /dev/null +++ b/internal/include/json_boost/serializer/SerializerWrapper.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2019-2026 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include +#include + +namespace olp { +namespace serializer { + +inline void to_json(const std::string& x, boost::json::value& value) { + value.emplace_string() = x; +} + +inline void to_json(int32_t x, boost::json::value& value) { + value.emplace_int64() = x; +} + +inline void to_json(int64_t x, boost::json::value& value) { + value.emplace_int64() = x; +} + +inline void to_json(double x, boost::json::value& value) { + value.emplace_double() = x; +} +inline void to_json(bool x, boost::json::value& value) { + value.emplace_bool() = x; +} + +inline void to_json(const std::shared_ptr>& x, + boost::json::value& value) { + value.emplace_string().assign(x->begin(), x->end()); +} + +template +inline void to_json(const porting::optional& x, boost::json::value& value) { + if (x) { + to_json(*x, value); + } else { + value.emplace_null(); + } +} + +template +inline void to_json(const std::map& x, + boost::json::value& value) { + auto& object = value.emplace_object(); + for (auto itr = x.begin(); itr != x.end(); ++itr) { + const auto& key = itr->first; + boost::json::value item_value; + to_json(itr->second, item_value); + object.emplace(key, std::move(item_value)); + } +} + +template +inline void to_json(const std::vector& x, boost::json::value& value) { + auto& array = value.emplace_array(); + array.reserve(x.size()); + for (typename std::vector::const_iterator itr = x.begin(); itr != x.end(); + ++itr) { + boost::json::value item_value; + to_json(*itr, item_value); + array.emplace_back(std::move(item_value)); + } +} + +template +inline void serialize(const std::string& key, const T& x, + boost::json::object& value) { + boost::json::value item_value; + to_json(x, item_value); + if (!item_value.is_null()) { + value.emplace(key, std::move(item_value)); + } +} + +} // namespace serializer +} // namespace olp diff --git a/olp-cpp-sdk-core/CMakeLists.txt b/olp-cpp-sdk-core/CMakeLists.txt index e694436ad..ec9e56abe 100644 --- a/olp-cpp-sdk-core/CMakeLists.txt +++ b/olp-cpp-sdk-core/CMakeLists.txt @@ -97,12 +97,6 @@ set(OLP_SDK_CLIENT_HEADERS ./include/olp/core/client/TaskContext.h ) -set(OLP_SDK_GENERATED_HEADERS - ./include/olp/core/generated/parser/JsonParser.h - ./include/olp/core/generated/parser/ParserWrapper.h - ./include/olp/core/generated/serializer/SerializerWrapper.h -) - set(OLP_SDK_HTTP_HEADERS ./include/olp/core/http/adapters/HarCaptureAdapter.h ./include/olp/core/http/CertificateSettings.h @@ -390,7 +384,6 @@ set(OLP_SDK_THREAD_SOURCES set(OLP_SDK_CORE_HEADERS ${OLP_SDK_CACHE_HEADERS} ${OLP_SDK_CLIENT_HEADERS} - ${OLP_SDK_GENERATED_HEADERS} ${OLP_SDK_HTTP_HEADERS} ${OLP_SDK_MODEL_HEADERS} ${OLP_SDK_PLATFORM_HEADERS} @@ -470,6 +463,9 @@ target_include_directories(${PROJECT_NAME} PUBLIC $) +target_include_directories(${PROJECT_NAME} PRIVATE + $) + if (ANDROID) set(ADDITIONAL_LIBRARIES log) else() diff --git a/olp-cpp-sdk-core/src/client/api/JsonResultParser.h b/olp-cpp-sdk-core/src/client/api/JsonResultParser.h index c60c812f5..296c3fa7a 100644 --- a/olp-cpp-sdk-core/src/client/api/JsonResultParser.h +++ b/olp-cpp-sdk-core/src/client/api/JsonResultParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ #include #include +#include #include -#include #include namespace olp { diff --git a/olp-cpp-sdk-core/src/client/parser/ApiParser.cpp b/olp-cpp-sdk-core/src/client/parser/ApiParser.cpp index 2942198b4..d12530c7b 100644 --- a/olp-cpp-sdk-core/src/client/parser/ApiParser.cpp +++ b/olp-cpp-sdk-core/src/client/parser/ApiParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,10 @@ #include "ApiParser.h" -#include +#include +#include + +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-read/CMakeLists.txt b/olp-cpp-sdk-dataservice-read/CMakeLists.txt index c8a954523..6a52db805 100644 --- a/olp-cpp-sdk-dataservice-read/CMakeLists.txt +++ b/olp-cpp-sdk-dataservice-read/CMakeLists.txt @@ -41,6 +41,9 @@ target_include_directories(${PROJECT_NAME} $ PRIVATE ${olp-cpp-sdk-core_INCLUDE_DIRS}) +target_include_directories(${PROJECT_NAME} PRIVATE + $) + target_link_libraries(${PROJECT_NAME} PUBLIC olp-cpp-sdk-core diff --git a/olp-cpp-sdk-dataservice-read/src/JsonResultParser.h b/olp-cpp-sdk-dataservice-read/src/JsonResultParser.h index a5dea90f8..de069190c 100644 --- a/olp-cpp-sdk-dataservice-read/src/JsonResultParser.h +++ b/olp-cpp-sdk-dataservice-read/src/JsonResultParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ #include #include +#include #include -#include #include namespace olp { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/ApiParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/ApiParser.cpp index 632c25d45..29d9575a2 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/ApiParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/ApiParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,9 @@ #include "ApiParser.h" -#include +#include + +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/CatalogParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/CatalogParser.cpp index 33d39c1fa..2e63a37b7 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/CatalogParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/CatalogParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,9 @@ #include "CatalogParser.h" -#include +#include + +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/IndexParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/IndexParser.cpp index d9cfe81ab..269e11f34 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/IndexParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/IndexParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,10 @@ #include "IndexParser.h" -#include +#include +#include + +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/LayerVersionsParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/LayerVersionsParser.cpp index 6b6920418..3bd9d19d2 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/LayerVersionsParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/LayerVersionsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,13 @@ #include "LayerVersionsParser.h" -#include +#include + +#include namespace olp { namespace parser { -using namespace olp::dataservice::read; +namespace model = olp::dataservice::read::model; void from_json(const rapidjson::Value& value, model::LayerVersion& x) { x.SetLayer(parse(value, "layer")); diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/MessagesParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/MessagesParser.cpp index 67ec4793a..45d2e1e25 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/MessagesParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/MessagesParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ #include "MessagesParser.h" +#include +#include + // clang-format off #include "generated/parser/StreamOffsetParser.h" -#include +#include // clang-format on namespace olp { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/PartitionsParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/PartitionsParser.cpp index b09c7a370..fbefd3c65 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/PartitionsParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/PartitionsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,9 @@ #include "PartitionsParser.h" -#include +#include + +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/StreamOffsetParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/StreamOffsetParser.cpp index d11ba87e6..29235bacc 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/StreamOffsetParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/StreamOffsetParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,11 @@ #include "StreamOffsetParser.h" -#include +#include namespace olp { namespace parser { -using namespace olp::dataservice::read; +namespace model = olp::dataservice::read::model; void from_json(const rapidjson::Value& value, model::StreamOffset& x) { x.SetPartition(parse(value, "partition")); diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/SubscribeResponseParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/SubscribeResponseParser.cpp index 68d7c7ef8..76dfb9d35 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/SubscribeResponseParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/SubscribeResponseParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,13 @@ #include "SubscribeResponseParser.h" -#include +#include + +#include namespace olp { namespace parser { -using namespace olp::dataservice::read; +namespace model = olp::dataservice::read::model; void from_json(const rapidjson::Value& value, model::SubscribeResponse& x) { x.SetNodeBaseURL(parse(value, "nodeBaseURL")); diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionInfosParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionInfosParser.cpp index dc71aebac..f25df46c8 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionInfosParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionInfosParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,10 @@ #include "VersionInfosParser.h" #include +#include #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionResponseParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionResponseParser.cpp index 107594f85..c3f63fc26 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionResponseParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionResponseParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,11 @@ #include "VersionResponseParser.h" -#include +#include namespace olp { namespace parser { -using namespace olp::dataservice::read; +namespace model = olp::dataservice::read::model; void from_json(const rapidjson::Value& value, model::VersionResponse& x) { x.SetVersion(parse(value, "version")); diff --git a/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionsResponseParser.cpp b/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionsResponseParser.cpp index 708f7e277..c88d27be3 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionsResponseParser.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/parser/VersionsResponseParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 HERE Europe B.V. + * Copyright (C) 2022-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,9 @@ #include "VersionsResponseParser.h" -#include +#include + +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/ApiSerializer.cpp b/olp-cpp-sdk-dataservice-read/src/generated/serializer/ApiSerializer.cpp index 91a3eae4a..5ec0dcdc7 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/ApiSerializer.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/ApiSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ #include "ApiSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/CatalogSerializer.cpp b/olp-cpp-sdk-dataservice-read/src/generated/serializer/CatalogSerializer.cpp index 8ca3a88d1..05e9a7acc 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/CatalogSerializer.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/CatalogSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ #include "CatalogSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/CatalogVersionsSerializer.h b/olp-cpp-sdk-dataservice-read/src/generated/serializer/CatalogVersionsSerializer.h index 50bd3898e..049b82c8e 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/CatalogVersionsSerializer.h +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/CatalogVersionsSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 HERE Europe B.V. + * Copyright (C) 2022-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,10 @@ #pragma once -#include +#include +#include + +#include #include #include diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/ConsumerPropertiesSerializer.h b/olp-cpp-sdk-dataservice-read/src/generated/serializer/ConsumerPropertiesSerializer.h index 1dea7c2fe..e8fa34a84 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/ConsumerPropertiesSerializer.h +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/ConsumerPropertiesSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,11 @@ #pragma once -#include -#include +#include + +#include #include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/LayerVersionsSerializer.cpp b/olp-cpp-sdk-dataservice-read/src/generated/serializer/LayerVersionsSerializer.cpp index 935fab9fc..b0250d012 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/LayerVersionsSerializer.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/LayerVersionsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ #include "LayerVersionsSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/PartitionsSerializer.cpp b/olp-cpp-sdk-dataservice-read/src/generated/serializer/PartitionsSerializer.cpp index b7bd4009e..4d31d26fd 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/PartitionsSerializer.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/PartitionsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ #include "PartitionsSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/StreamOffsetsSerializer.cpp b/olp-cpp-sdk-dataservice-read/src/generated/serializer/StreamOffsetsSerializer.cpp index a2e750d63..0345facb7 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/StreamOffsetsSerializer.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/StreamOffsetsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ #include "StreamOffsetsSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/VersionInfosSerializer.cpp b/olp-cpp-sdk-dataservice-read/src/generated/serializer/VersionInfosSerializer.cpp index d24b124da..fcaa3417a 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/VersionInfosSerializer.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/VersionInfosSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ #include "VersionInfosSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-read/src/generated/serializer/VersionResponseSerializer.cpp b/olp-cpp-sdk-dataservice-read/src/generated/serializer/VersionResponseSerializer.cpp index ec4e2a4d8..06e14a93e 100644 --- a/olp-cpp-sdk-dataservice-read/src/generated/serializer/VersionResponseSerializer.cpp +++ b/olp-cpp-sdk-dataservice-read/src/generated/serializer/VersionResponseSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ #include "VersionResponseSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-read/src/repositories/PartitionsCacheRepository.cpp b/olp-cpp-sdk-dataservice-read/src/repositories/PartitionsCacheRepository.cpp index 55701ce85..e730f1ea3 100644 --- a/olp-cpp-sdk-dataservice-read/src/repositories/PartitionsCacheRepository.cpp +++ b/olp-cpp-sdk-dataservice-read/src/repositories/PartitionsCacheRepository.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2025 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,8 +32,8 @@ #include "generated/parser/PartitionsParser.h" #include "generated/parser/LayerVersionsParser.h" #include "JsonResultParser.h" -#include -#include +#include +#include #include "generated/serializer/PartitionsSerializer.h" #include "generated/serializer/LayerVersionsSerializer.h" #include "generated/serializer/JsonSerializer.h" diff --git a/olp-cpp-sdk-dataservice-read/tests/ParserTest.cpp b/olp-cpp-sdk-dataservice-read/tests/ParserTest.cpp index 0fffd77c3..9ef99df20 100644 --- a/olp-cpp-sdk-dataservice-read/tests/ParserTest.cpp +++ b/olp-cpp-sdk-dataservice-read/tests/ParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ #include "generated/parser/MessagesParser.h" #include "generated/parser/SubscribeResponseParser.h" #include "generated/parser/VersionInfosParser.h" -#include +#include #include "generated/serializer/VersionInfosSerializer.h" #include "generated/serializer/JsonSerializer.h" // clang-format on diff --git a/olp-cpp-sdk-dataservice-read/tests/PartitionsCacheRepositoryTest.cpp b/olp-cpp-sdk-dataservice-read/tests/PartitionsCacheRepositoryTest.cpp index d44495111..85801359a 100644 --- a/olp-cpp-sdk-dataservice-read/tests/PartitionsCacheRepositoryTest.cpp +++ b/olp-cpp-sdk-dataservice-read/tests/PartitionsCacheRepositoryTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ #include "repositories/DataCacheRepository.h" // clang-format off -#include +#include #include "generated/serializer/PartitionsSerializer.h" #include "generated/serializer/JsonSerializer.h" // clang-format on diff --git a/olp-cpp-sdk-dataservice-read/tests/PartitionsRepositoryTest.cpp b/olp-cpp-sdk-dataservice-read/tests/PartitionsRepositoryTest.cpp index b728d2b05..307a4bc69 100644 --- a/olp-cpp-sdk-dataservice-read/tests/PartitionsRepositoryTest.cpp +++ b/olp-cpp-sdk-dataservice-read/tests/PartitionsRepositoryTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2025 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ // clang-format off #include "generated/parser/PartitionsParser.h" -#include +#include // clang-format on namespace { diff --git a/olp-cpp-sdk-dataservice-write/CMakeLists.txt b/olp-cpp-sdk-dataservice-write/CMakeLists.txt index 91f2a3d86..8c2d7610c 100644 --- a/olp-cpp-sdk-dataservice-write/CMakeLists.txt +++ b/olp-cpp-sdk-dataservice-write/CMakeLists.txt @@ -177,6 +177,9 @@ target_include_directories(${PROJECT_NAME} $ $) +target_include_directories(${PROJECT_NAME} PRIVATE + $) + target_compile_definitions(${PROJECT_NAME} PRIVATE DATASERVICE_WRITE_LIBRARY) if(BUILD_SHARED_LIBS) diff --git a/olp-cpp-sdk-dataservice-write/src/CatalogSettings.cpp b/olp-cpp-sdk-dataservice-write/src/CatalogSettings.cpp index 5d3476263..2af69c126 100644 --- a/olp-cpp-sdk-dataservice-write/src/CatalogSettings.cpp +++ b/olp-cpp-sdk-dataservice-write/src/CatalogSettings.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include "CatalogSettings.h" +#include + #include #include #include @@ -29,7 +31,7 @@ #include #include #include -#include +#include // clang-format on namespace olp { diff --git a/olp-cpp-sdk-dataservice-write/src/JsonResultParser.h b/olp-cpp-sdk-dataservice-write/src/JsonResultParser.h index a5dea90f8..478946488 100644 --- a/olp-cpp-sdk-dataservice-write/src/JsonResultParser.h +++ b/olp-cpp-sdk-dataservice-write/src/JsonResultParser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ #include #include +#include #include -#include #include namespace olp { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.cpp index e2fb96cc9..b3793bef6 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ApiParser.cpp @@ -21,7 +21,7 @@ #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp index 7f509a189..9f2be09c6 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp @@ -21,7 +21,7 @@ #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.cpp index 575900c01..81e3b4bd3 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/DetailsParser.cpp @@ -21,7 +21,7 @@ #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.cpp index 6e12f2d93..86d4b3708 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/LayerVersionsParser.cpp @@ -21,7 +21,7 @@ #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.cpp index 3ca081962..564a0f7d4 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PartitionsParser.cpp @@ -21,7 +21,7 @@ #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.cpp index cf5e217e9..01a494cb8 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublicationParser.cpp @@ -25,7 +25,7 @@ // clang-format off #include #include -#include +#include // clang-format on namespace olp { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.cpp index b3f330fb9..ae1bdc6b7 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishDataRequestParser.cpp @@ -24,7 +24,7 @@ #include // clang-format off -#include +#include // clang-format on namespace olp { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.cpp index 6ea93e7d7..7b38a5c15 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionParser.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.cpp index 3fc02cc55..cb1c354fd 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/PublishPartitionsParser.cpp @@ -23,7 +23,7 @@ // clang-format off #include -#include +#include // clang-format on namespace olp { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.cpp index 4bc409ad2..82734e275 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkParser.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include namespace model = olp::dataservice::write::model; diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.cpp index 7d171d2c2..1b480a136 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/ResponseOkSingleParser.cpp @@ -21,7 +21,7 @@ #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.cpp index f0ec5cdc0..4305b0050 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionDependencyParser.cpp @@ -21,7 +21,7 @@ #include -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.cpp b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.cpp index f093028b2..d9dfd0b5e 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/parser/VersionResponseParser.cpp @@ -19,7 +19,7 @@ #include "VersionResponseParser.h" -#include +#include namespace olp { namespace parser { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.cpp index 8a0f90c31..459389ac2 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/ApiSerializer.cpp @@ -21,7 +21,7 @@ #include "ApiSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.cpp b/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.cpp index dfa547660..581702264 100644 --- a/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.cpp +++ b/olp-cpp-sdk-dataservice-write/src/generated/serializer/CatalogSerializer.cpp @@ -21,7 +21,7 @@ #include "CatalogSerializer.h" -#include +#include namespace olp { namespace serializer { diff --git a/olp-cpp-sdk-dataservice-write/tests/ParserTest.cpp b/olp-cpp-sdk-dataservice-write/tests/ParserTest.cpp index 746ec330f..f9ac57270 100644 --- a/olp-cpp-sdk-dataservice-write/tests/ParserTest.cpp +++ b/olp-cpp-sdk-dataservice-write/tests/ParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 HERE Europe B.V. + * Copyright (C) 2019-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ #include #include #include -#include +#include // clang-format on namespace { diff --git a/olp-cpp-sdk-dataservice-write/tests/VersionedLayerClientImplPublishToBatchTest.cpp b/olp-cpp-sdk-dataservice-write/tests/VersionedLayerClientImplPublishToBatchTest.cpp index b58adfcda..f1214c98b 100644 --- a/olp-cpp-sdk-dataservice-write/tests/VersionedLayerClientImplPublishToBatchTest.cpp +++ b/olp-cpp-sdk-dataservice-write/tests/VersionedLayerClientImplPublishToBatchTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ #include "generated/serializer/ApiSerializer.h" #include "generated/serializer/PublicationSerializer.h" #include "generated/serializer/CatalogSerializer.h" -#include +#include #include "generated/serializer/JsonSerializer.h" // clang-format on diff --git a/olp-cpp-sdk-dataservice-write/tests/VersionedLayerClientImplTest.cpp b/olp-cpp-sdk-dataservice-write/tests/VersionedLayerClientImplTest.cpp index e19ca97be..54c621aa0 100644 --- a/olp-cpp-sdk-dataservice-write/tests/VersionedLayerClientImplTest.cpp +++ b/olp-cpp-sdk-dataservice-write/tests/VersionedLayerClientImplTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ // clang-format off #include "generated/serializer/ApiSerializer.h" #include "generated/serializer/PublicationSerializer.h" -#include +#include #include "generated/serializer/JsonSerializer.h" // clang-format on diff --git a/tests/common/CMakeLists.txt b/tests/common/CMakeLists.txt index c3331f672..a5c46249b 100644 --- a/tests/common/CMakeLists.txt +++ b/tests/common/CMakeLists.txt @@ -43,6 +43,7 @@ add_library(olp-cpp-sdk-tests-common target_include_directories(olp-cpp-sdk-tests-common PUBLIC "$" + "$" ) target_include_directories(olp-cpp-sdk-tests-common diff --git a/tests/common/ReadDefaultResponses.cpp b/tests/common/ReadDefaultResponses.cpp index 39b664a09..5d2dbb3e5 100644 --- a/tests/common/ReadDefaultResponses.cpp +++ b/tests/common/ReadDefaultResponses.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/tests/common/ResponseGenerator.cpp b/tests/common/ResponseGenerator.cpp index 4ea6eb667..1fb168d86 100644 --- a/tests/common/ResponseGenerator.cpp +++ b/tests/common/ResponseGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ #include "generated/serializer/ApiSerializer.h" #include "generated/serializer/VersionResponseSerializer.h" #include "generated/serializer/PartitionsSerializer.h" -#include +#include #include "generated/serializer/JsonSerializer.h" // clang-format on diff --git a/tests/common/WriteDefaultResponses.h b/tests/common/WriteDefaultResponses.h index 93d151389..76bda474c 100644 --- a/tests/common/WriteDefaultResponses.h +++ b/tests/common/WriteDefaultResponses.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,8 @@ #include #include +#include #include -#include #include #include #include @@ -87,7 +87,8 @@ class DefaultResponses { static olp::dataservice::write::model::Publication GeneratePublicationResponse( const std::vector& layer_ids, - const std::vector dependencies) { + const std::vector + dependencies) { olp::dataservice::write::model::Publication publication; std::string id = "abcdefghijklmnopqrstuvwxyz0123456789-"; diff --git a/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientPublishToBatchTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientPublishToBatchTest.cpp index 74e5c8504..e81920e97 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientPublishToBatchTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientPublishToBatchTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ #include "generated/serializer/ApiSerializer.h" #include "generated/serializer/CatalogSerializer.h" #include "generated/serializer/PublicationSerializer.h" -#include +#include #include "generated/serializer/JsonSerializer.h" // clang-format on diff --git a/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientTest.cpp index 2389ad6f3..7956a169f 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 HERE Europe B.V. + * Copyright (C) 2020-2026 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ // clang-format off #include "generated/serializer/ApiSerializer.h" #include "generated/serializer/PublicationSerializer.h" -#include +#include #include "generated/serializer/JsonSerializer.h" // clang-format on