From ce7897ae133ed62bad150f5faa703b9ab7e36716 Mon Sep 17 00:00:00 2001 From: Leonid Stryzhevskyi Date: Thu, 30 May 2024 13:58:22 +0300 Subject: [PATCH] json::ObjectMapper: add mappers getters --- src/oatpp/json/ObjectMapper.cpp | 16 ++++++++++++++++ src/oatpp/json/ObjectMapper.hpp | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/src/oatpp/json/ObjectMapper.cpp b/src/oatpp/json/ObjectMapper.cpp index f31b6ec0..903232ef 100644 --- a/src/oatpp/json/ObjectMapper.cpp +++ b/src/oatpp/json/ObjectMapper.cpp @@ -103,6 +103,22 @@ oatpp::Void ObjectMapper::read(utils::parser::Caret& caret, const data::type::Ty } +const data::mapping::ObjectToTreeMapper& ObjectMapper::objectToTreeMapper() const { + return m_objectToTreeMapper; +} + +const data::mapping::TreeToObjectMapper& ObjectMapper::treeToObjectMapper() const { + return m_treeToObjectMapper; +} + +data::mapping::ObjectToTreeMapper& ObjectMapper::objectToTreeMapper() { + return m_objectToTreeMapper; +} + +data::mapping::TreeToObjectMapper& ObjectMapper::treeToObjectMapper() { + return m_treeToObjectMapper; +} + const ObjectMapper::SerializerConfig& ObjectMapper::serializerConfig() const { return m_serializerConfig; } diff --git a/src/oatpp/json/ObjectMapper.hpp b/src/oatpp/json/ObjectMapper.hpp index 1bd81a31..0d5250db 100644 --- a/src/oatpp/json/ObjectMapper.hpp +++ b/src/oatpp/json/ObjectMapper.hpp @@ -77,6 +77,12 @@ public: oatpp::Void read(oatpp::utils::parser::Caret& caret, const oatpp::Type* type, data::mapping::ErrorStack& errorStack) const override; + const data::mapping::ObjectToTreeMapper& objectToTreeMapper() const; + const data::mapping::TreeToObjectMapper& treeToObjectMapper() const; + + data::mapping::ObjectToTreeMapper& objectToTreeMapper(); + data::mapping::TreeToObjectMapper& treeToObjectMapper(); + const SerializerConfig& serializerConfig() const; const DeserializerConfig& deserializerConfig() const;