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
str
std::string str(const T &t)
Definition: UserAssistedSegmenterGuiWidgetController.cpp:42
JsonConverter.h
NLohmannJSONConverter.h
armarx::aron::type::converter::AronNlohmannJSONConverter::ConvertFromNlohmannJSONTypeObject
static type::ObjectPtr ConvertFromNlohmannJSONTypeObject(const nlohmann::json &j, const armarx::aron::Path &p={})
Definition: NLohmannJSONConverter.cpp:66
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::armem::server::ltm::processor::converter::type::object
Definition: JsonConverter.cpp:5
armarx::armem::server::ltm::processor::converter::type::object::JsonConverter::convert
std::pair< std::vector< unsigned char >, std::string > convert(const aron::type::ObjectPtr &data) final
Definition: JsonConverter.cpp:8
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
armarx::aron::type::converter::AronNlohmannJSONConverter::ConvertToNlohmannJSON
static nlohmann::json ConvertToNlohmannJSON(const type::VariantPtr &)
Definition: NLohmannJSONConverter.cpp:51