JsonConverter.cpp
Go to the documentation of this file.
1
#include "
JsonConverter.h
"
2
3
#include <
ArmarXCore/core/logging/Logging.h
>
4
5
#include <
RobotAPI/libraries/aron/converter/json/NLohmannJSONConverter.h
>
6
7
namespace
armarx::armem::server::ltm::processor::converter::data::object
8
{
9
JsonConverter::ConversionResult
10
JsonConverter::_convert
(
const
aron::data::DictPtr
&
data
)
11
{
12
nlohmann::json j =
13
aron::data::converter::AronNlohmannJSONConverter::ConvertToNlohmannJSON
(
data
);
14
auto
str
= j.dump(2);
15
return
{std::vector<unsigned char>(
str
.begin(),
str
.end()),
""
};
16
}
17
18
aron::data::DictPtr
19
JsonConverter::_convert
(
const
ConversionResult
&
data
,
const
armarx::aron::Path
& p)
20
{
21
std::string
str
(
data
.data.begin(),
data
.data.end());
22
nlohmann::json j = nlohmann::json::parse(
str
);
23
return
aron::data::converter::AronNlohmannJSONConverter::ConvertFromNlohmannJSONObject
(j,
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
RobotAPI
libraries
armem
server
ltm
processors
converter
data
object
json
JsonConverter.cpp
Generated on Sat Oct 12 2024 09:14:08 for armarx_documentation by
1.8.17