JsonConverter.cpp
Go to the documentation of this file.
1 #include "JsonConverter.h"
2 
4 
6 
8 {
9  JsonConverter::ConversionResult
11  {
12  nlohmann::json j =
14  auto str = j.dump(2);
15  return {std::vector<unsigned char>(str.begin(), str.end()), ""};
16  }
17 
20  {
21  std::string str(data.data.begin(), data.data.end());
22  nlohmann::json j = nlohmann::json::parse(str);
24  p);
25  }
26 } // namespace armarx::armem::server::ltm::processor::converter::data::object
str
std::string str(const T &t)
Definition: UserAssistedSegmenterGuiWidgetController.cpp:42
armarx::aron::data::converter::AronNlohmannJSONConverter::ConvertToNlohmannJSON
static nlohmann::json ConvertToNlohmannJSON(const data::VariantPtr &)
Definition: NLohmannJSONConverter.cpp:10
armarx::aron::data::converter::AronNlohmannJSONConverter::ConvertFromNlohmannJSONObject
static data::DictPtr ConvertFromNlohmannJSONObject(const nlohmann::json &, const armarx::aron::Path &p={})
Definition: NLohmannJSONConverter.cpp:25
NLohmannJSONConverter.h
armarx::aron::Path
The Path class.
Definition: Path.h:36
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::armem::server::ltm::processor::converter::data::object
Definition: BsonConverter.cpp:8
JsonConverter.h
Logging.h
armarx::armem::server::ltm::processor::DataConverter::ConversionResult
Definition: Converter.h:25
armarx::armem::server::ltm::processor::converter::data::object::JsonConverter::_convert
ConversionResult _convert(const aron::data::DictPtr &data) final
Definition: JsonConverter.cpp:10