3 #include "Serializing/Json/JsonSerializableType.h"
23 bool onDeserialize(
IO::CJsonObject &i_oObject,
const bool i_bIsStrict)
override {
29 throw DifferentTypesException;
40 bool onSerialize(IO::CJsonObject &i_oObject,
const bool i_bIsStrict)
const override {
41 return this->
serialize(i_oObject, i_bIsStrict);
47 bool onDeserialize(IO::CJsonObject &i_oObject)
final {
48 return this->onDeserialize(i_oObject,
false);
54 bool onSerialize(IO::CJsonObject &i_oObject)
const final {
55 return this->onSerialize(i_oObject,
false);
59 using IJsonType<std::string, IData<std::string>>
::IJsonType;
65 template<
typename String,
66 std::enable_if_t<std::is_constructible_v<std::string, String>,
bool> =
true
78 template<
typename String,
79 std::enable_if_t<std::is_constructible_v<std::string, String>,
bool> =
true
83 this->
m_tValue = std::move(i_tValue);
A class that encapsulates a JSON object.
Definition: JsonObject.h:50
EJsonType type() const
Returns the type of the JSON object.
Definition: JsonObject.h:123
A class representing a JSON field name.
Definition: JsonFieldName.h:49
Template class representing a data field.
Definition: SerializableData.h:86
Represents a JSON string data type and provides serialization and deserialization functionality.
Definition: JsonSerializableString.h:12
IJsonString & operator=(String &&i_tValue)
Assigns an rvalue to the IJsonString object.
Definition: JsonSerializableString.h:81
IJsonString(const CJsonFieldName i_oFieldName)
Constructs an IJsonString object with the specified field name.
Definition: JsonSerializableString.h:16
IJsonString & operator=(const String &i_tValue)
Assigns a value to the IJsonString object.
Definition: JsonSerializableString.h:68
Represents a JSON data type with serialization and deserialization functionality.
Definition: JsonSerializableType.h:84
IO::CJsonObject * getObject(IO::CJsonObject &i_oObject, const bool i_bIsStrict)
Retrieves the JSON object for the specified JSON field.
Definition: JsonSerializableType.h:177
bool serialize(IO::CJsonObject &i_oObject, const bool i_bIsStrict=false) const
Serializes the data to a JSON object.
Definition: JsonSerializableType.h:142
void setNull(bool i_bState)
Sets the null state of the JSON field.
Definition: JsonSerializableType.h:169
IJsonType(const CJsonFieldName i_oFieldName)
Constructs an IJsonType object with the specified JSON field name.
Definition: JsonSerializableType.h:88
int m_tValue
The value.
Definition: SerializableData.h:78
The namespace encapsulating serializing related functionality in the Devel framework.