From c61c30426fd10599ed1ae14d1922c77b3d365bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Edelbo?= Date: Fri, 10 Nov 2023 12:31:19 +0100 Subject: [PATCH] Move bson files to core utils --- src/realm/CMakeLists.txt | 8 ++++++++ src/realm/object-store/CMakeLists.txt | 13 ++----------- src/realm/object-store/sync/app_credentials.cpp | 2 +- src/realm/object-store/sync/app_service_client.hpp | 2 +- src/realm/object-store/sync/mongo_collection.hpp | 2 +- src/realm/object-store/sync/push_client.cpp | 2 +- src/realm/object-store/sync/sync_user.hpp | 2 +- src/realm/sync/config.cpp | 2 +- src/realm/{object-store => }/util/bson/bson.cpp | 2 +- src/realm/{object-store => }/util/bson/bson.hpp | 10 +++++----- .../{object-store => }/util/bson/indexed_map.hpp | 0 src/realm/{object-store => }/util/bson/max_key.hpp | 0 src/realm/{object-store => }/util/bson/min_key.hpp | 0 .../util/bson/mongo_timestamp.hpp | 0 .../util/bson/regular_expression.cpp | 2 +- .../util/bson/regular_expression.hpp | 0 test/object-store/bson.cpp | 2 +- test/object-store/sync/flx_sync.cpp | 2 +- 18 files changed, 25 insertions(+), 26 deletions(-) rename src/realm/{object-store => }/util/bson/bson.cpp (99%) rename src/realm/{object-store => }/util/bson/bson.hpp (96%) rename src/realm/{object-store => }/util/bson/indexed_map.hpp (100%) rename src/realm/{object-store => }/util/bson/max_key.hpp (100%) rename src/realm/{object-store => }/util/bson/min_key.hpp (100%) rename src/realm/{object-store => }/util/bson/mongo_timestamp.hpp (100%) rename src/realm/{object-store => }/util/bson/regular_expression.cpp (97%) rename src/realm/{object-store => }/util/bson/regular_expression.hpp (100%) diff --git a/src/realm/CMakeLists.txt b/src/realm/CMakeLists.txt index 7141f6ce61c..ea00171cb4a 100644 --- a/src/realm/CMakeLists.txt +++ b/src/realm/CMakeLists.txt @@ -101,6 +101,8 @@ set(UTIL_SOURCES util/random.cpp util/resource_limits.cpp util/uri.cpp + util/bson/bson.cpp + util/bson/regular_expression.cpp ) set(REALM_INSTALL_HEADERS @@ -272,6 +274,12 @@ set(REALM_NOINST_HEADERS util/timestamp_formatter.hpp util/timestamp_logger.hpp util/value_reset_guard.hpp + util/bson/bson.hpp + util/bson/min_key.hpp + util/bson/max_key.hpp + util/bson/regular_expression.hpp + util/bson/indexed_map.hpp + util/bson/mongo_timestamp.hpp ) # REALM_NOINST_HEADERS if(NOT MSVC) diff --git a/src/realm/object-store/CMakeLists.txt b/src/realm/object-store/CMakeLists.txt index d8b028f7e7d..083e8a10a7c 100644 --- a/src/realm/object-store/CMakeLists.txt +++ b/src/realm/object-store/CMakeLists.txt @@ -110,14 +110,7 @@ if(REALM_ENABLE_SYNC) sync/impl/sync_client.hpp sync/impl/sync_file.hpp sync/impl/sync_metadata.hpp - sync/impl/network_reachability.hpp - - util/bson/bson.hpp - util/bson/min_key.hpp - util/bson/max_key.hpp - util/bson/regular_expression.hpp - util/bson/indexed_map.hpp - util/bson/mongo_timestamp.hpp) + sync/impl/network_reachability.hpp) list(APPEND SOURCES sync/app.cpp @@ -133,9 +126,7 @@ if(REALM_ENABLE_SYNC) sync/mongo_database.cpp sync/push_client.cpp sync/impl/sync_file.cpp - sync/impl/sync_metadata.cpp - util/bson/bson.cpp - util/bson/regular_expression.cpp) + sync/impl/sync_metadata.cpp) if(APPLE) list(APPEND HEADERS sync/impl/apple/network_reachability_observer.hpp diff --git a/src/realm/object-store/sync/app_credentials.cpp b/src/realm/object-store/sync/app_credentials.cpp index 4c1a7133118..a438f38f55e 100644 --- a/src/realm/object-store/sync/app_credentials.cpp +++ b/src/realm/object-store/sync/app_credentials.cpp @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////////////// #include -#include +#include namespace realm::app { diff --git a/src/realm/object-store/sync/app_service_client.hpp b/src/realm/object-store/sync/app_service_client.hpp index 3db82b6d8b8..9bd913432c4 100644 --- a/src/realm/object-store/sync/app_service_client.hpp +++ b/src/realm/object-store/sync/app_service_client.hpp @@ -19,7 +19,7 @@ #ifndef APP_SERVICE_CLIENT_HPP #define APP_SERVICE_CLIENT_HPP -#include +#include #include #include diff --git a/src/realm/object-store/sync/mongo_collection.hpp b/src/realm/object-store/sync/mongo_collection.hpp index d828bf086e5..bdf08f15628 100644 --- a/src/realm/object-store/sync/mongo_collection.hpp +++ b/src/realm/object-store/sync/mongo_collection.hpp @@ -19,7 +19,7 @@ #ifndef MONGO_COLLECTION_HPP #define MONGO_COLLECTION_HPP -#include +#include #include #include diff --git a/src/realm/object-store/sync/push_client.cpp b/src/realm/object-store/sync/push_client.cpp index cea148447ef..c87c1160fb6 100644 --- a/src/realm/object-store/sync/push_client.cpp +++ b/src/realm/object-store/sync/push_client.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace realm::app { diff --git a/src/realm/object-store/sync/sync_user.hpp b/src/realm/object-store/sync/sync_user.hpp index 3f41cc77d99..f32bf6276f9 100644 --- a/src/realm/object-store/sync/sync_user.hpp +++ b/src/realm/object-store/sync/sync_user.hpp @@ -20,7 +20,7 @@ #define REALM_OS_SYNC_USER_HPP #include -#include +#include #include #include diff --git a/src/realm/sync/config.cpp b/src/realm/sync/config.cpp index 52b12609801..d0db93177f8 100644 --- a/src/realm/sync/config.cpp +++ b/src/realm/sync/config.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include diff --git a/src/realm/object-store/util/bson/bson.cpp b/src/realm/util/bson/bson.cpp similarity index 99% rename from src/realm/object-store/util/bson/bson.cpp rename to src/realm/util/bson/bson.cpp index ce3d352f62d..7b59673051b 100644 --- a/src/realm/object-store/util/bson/bson.cpp +++ b/src/realm/util/bson/bson.cpp @@ -16,7 +16,7 @@ * **************************************************************************/ -#include +#include #include #include #include diff --git a/src/realm/object-store/util/bson/bson.hpp b/src/realm/util/bson/bson.hpp similarity index 96% rename from src/realm/object-store/util/bson/bson.hpp rename to src/realm/util/bson/bson.hpp index 8c4dca0c375..4f67a8144b9 100644 --- a/src/realm/object-store/util/bson/bson.hpp +++ b/src/realm/util/bson/bson.hpp @@ -19,11 +19,11 @@ #ifndef REALM_BSON_HPP #define REALM_BSON_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/realm/object-store/util/bson/indexed_map.hpp b/src/realm/util/bson/indexed_map.hpp similarity index 100% rename from src/realm/object-store/util/bson/indexed_map.hpp rename to src/realm/util/bson/indexed_map.hpp diff --git a/src/realm/object-store/util/bson/max_key.hpp b/src/realm/util/bson/max_key.hpp similarity index 100% rename from src/realm/object-store/util/bson/max_key.hpp rename to src/realm/util/bson/max_key.hpp diff --git a/src/realm/object-store/util/bson/min_key.hpp b/src/realm/util/bson/min_key.hpp similarity index 100% rename from src/realm/object-store/util/bson/min_key.hpp rename to src/realm/util/bson/min_key.hpp diff --git a/src/realm/object-store/util/bson/mongo_timestamp.hpp b/src/realm/util/bson/mongo_timestamp.hpp similarity index 100% rename from src/realm/object-store/util/bson/mongo_timestamp.hpp rename to src/realm/util/bson/mongo_timestamp.hpp diff --git a/src/realm/object-store/util/bson/regular_expression.cpp b/src/realm/util/bson/regular_expression.cpp similarity index 97% rename from src/realm/object-store/util/bson/regular_expression.cpp rename to src/realm/util/bson/regular_expression.cpp index aed15ef944f..c470c75e386 100644 --- a/src/realm/object-store/util/bson/regular_expression.cpp +++ b/src/realm/util/bson/regular_expression.cpp @@ -16,7 +16,7 @@ * **************************************************************************/ -#include +#include #include namespace realm { diff --git a/src/realm/object-store/util/bson/regular_expression.hpp b/src/realm/util/bson/regular_expression.hpp similarity index 100% rename from src/realm/object-store/util/bson/regular_expression.hpp rename to src/realm/util/bson/regular_expression.hpp diff --git a/test/object-store/bson.cpp b/test/object-store/bson.cpp index 7ad4ba38baa..43eed88eaa3 100644 --- a/test/object-store/bson.cpp +++ b/test/object-store/bson.cpp @@ -23,7 +23,7 @@ #include #include "util/test_utils.hpp" #include "util/test_file.hpp" -#include +#include using namespace nlohmann; using namespace realm; diff --git a/test/object-store/sync/flx_sync.cpp b/test/object-store/sync/flx_sync.cpp index 18b02389262..7c8088a2086 100644 --- a/test/object-store/sync/flx_sync.cpp +++ b/test/object-store/sync/flx_sync.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include