Skip to content
Snippets Groups Projects
Commit 472ea308 authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

const correctness of nlohmannsjon converter + fixed conversion function of...

const correctness of nlohmannsjon converter + fixed conversion function of nlohmann json converter in aron_common
parent 00696c24
No related branches found
No related tags found
1 merge request!196const correctness of nlohmannsjon converter + fixed conversion function of...
......@@ -26,9 +26,8 @@ namespace armarx::aron::converter
void AronNlohmannJSONConverter::ConvertFromNlohmannJSON(aron::data::DictPtr& a, const nlohmann::json& e, const aron::type::VariantPtr& expectedStructure)
{
aron::data::reader::NlohmannJSONReader dataReader;
//aron::data::writer::NavigatorWriter navWriter;
//aron::data::Converter::ReadAndConvert(dataReader, navWriter, expectedStructure);
//a = aron::data::Dict::DynamicCastAndCheck(navWriter.getResult());
aron::data::writer::NlohmannJSONWriter dataWriter;
auto v = aron::data::readAndWrite<NlohmannJSON2VariantConverterHelper>(e);
a = aron::data::Dict::DynamicCastAndCheck(v);
}
}
......@@ -36,8 +36,6 @@ namespace armarx::aron::data
virtual public NlohmannJSONVisitor,
virtual public Converter<aron::data::reader::NlohmannJSONReader, WriterImplementation, DerivedT>
{
using NlohmannJSONVisitor::getDescriptor;
virtual ~NlohmannJSONConverter() = default;
};
}
......@@ -36,9 +36,9 @@
namespace armarx::aron::data
{
struct NlohmannJSONVisitor : virtual public Visitor<nlohmann::json, data::Descriptor>
struct NlohmannJSONVisitor : virtual public Visitor<const nlohmann::json, data::Descriptor>
{
virtual data::Descriptor getDescriptor(const nlohmann::json& n)
virtual data::Descriptor getDescriptor(const nlohmann::json& n) override
{
std::string t = n[armarx::aron::data::rw::json::constantes::TYPE_SLUG];
return armarx::aron::data::rw::json::conversion::String2Descriptor.at(t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment