JsonConverter.cpp
Go to the documentation of this file.
1#include "JsonConverter.h"
2
4
6{
7 std::pair<std::vector<unsigned char>, std::string>
9 {
10 nlohmann::json j =
12 auto str = j.dump(2);
13 return std::make_pair(std::vector<unsigned char>(str.begin(), str.end()), "");
14 }
15
17 JsonConverter::convert(const std::vector<unsigned char>& data, const std::string&)
18 {
19 std::string str(data.begin(), data.end());
20 nlohmann::json j = nlohmann::json::parse(str);
22 j);
23 }
24} // namespace armarx::armem::server::ltm::processor::converter::type::object
std::string str(const T &t)
std::pair< std::vector< unsigned char >, std::string > convert(const aron::type::ObjectPtr &data) final
static type::ObjectPtr ConvertFromNlohmannJSONTypeObject(const nlohmann::json &j, const armarx::aron::Path &p={})
static nlohmann::json ConvertToNlohmannJSON(const type::VariantPtr &)
std::shared_ptr< Object > ObjectPtr
Definition Object.h:36