Devel Lib
Devel::Serializing::IJsonStruct< TStruct > Class Template Reference

Represents a JSON structure data type and provides serialization and deserialization functionality. More...

#include <JsonSerializableStruct.h>

Inheritance diagram for Devel::Serializing::IJsonStruct< TStruct >:
Collaboration diagram for Devel::Serializing::IJsonStruct< TStruct >:

Public Member Functions

 IJsonStruct (const CJsonFieldName i_oFieldName)
 Constructs an IJsonStruct object with the specified field name. More...
 
IJsonStructoperator= (const TStruct &i_tValue)
 Assigns a value to the IJsonStruct object. More...
 
IJsonStructoperator= (TStruct &&i_tValue)
 Assigns an rvalue to the IJsonStruct object. More...
 
- Public Member Functions inherited from Devel::Serializing::IJsonType< TStruct, IData< TStruct > >
bool doDeserialize (IO::CJsonObject &i_oObject, const bool i_bIsStrict=false)
 Deserializes the object from a JSON object. More...
 
bool doSerialize (IO::CJsonObject &i_oObject, const bool i_bIsStrict=false) const
 Serializes the object to a JSON object. More...
 
size_t size () const override
 Retrieves the size of the object. More...
 
IJsonTypeoperator= (const TJsonFieldName &i_tValue)
 Assigns a JSON field name to the object. More...
 
IJsonTypeoperator= (TJsonFieldName &&i_tValue)
 Assigns a JSON field name to the object (move assignment). More...
 
- Public Member Functions inherited from Devel::Serializing::IData< T, IsHidden >
virtual ~IData ()=default
 Default destructor.
 
bool doSerialize (IO::CWriteStream &i_oStream) const
 Serializes the data to a write stream. More...
 
bool doDeserialize (IO::CReadStream &i_oStream)
 Deserializes the data from a read stream. More...
 
bool doDeserialize (const char *i_szString)
 Deserializes the data from a string. More...
 
bool doDeserialize (std::vector< std::string >::const_iterator &i_oIt, const std::vector< std::string >::const_iterator &i_oItEnd)
 Deserializes the data from a range of strings. More...
 
virtual bool isHidden () const
 Returns whether the field is hidden. More...
 
virtual SCompareData compareData () const
 Returns the compare data for the data field. More...
 
auto begin () const
 Returns an iterator pointing to the beginning of the value. More...
 
auto end () const
 Returns an iterator pointing to the end of the value. More...
 
auto & operator[] (const size_t i_nIndex)
 Returns a reference to the value at the specified index. More...
 
const auto & operator[] (const size_t i_nIndex) const
 Returns a const reference to the value at the specified index. More...
 
 SerializerEnableIfNotArithmetic (IData< T > &) operator--()
 Pre-decrement operator. More...
 
 SerializerEnableIfNotArithmetic (IData< T > &) operator--(int)
 Post-decrement operator. More...
 
 SerializerEnableIfNotArithmetic (IData< T > &) operator++()
 Pre-increment operator. More...
 
 SerializerEnableIfNotArithmetic (IData< T > &) operator++(int)
 Post-increment operator. More...
 
- Public Member Functions inherited from Devel::Serializing::IValue< int >
 IValue (TArgs... i_tArgs)
 Constructs an IValue object with the specified arguments. More...
 
const int & value () const
 Returns the value. More...
 
int & value ()
 Returns a reference to the value. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Devel::Serializing::IJsonType< TStruct, IData< TStruct > >
 IJsonType (const CJsonFieldName i_oFieldName)
 Constructs an IJsonType object with the specified JSON field name. More...
 
virtual ~IJsonType ()=default
 Destructor.
 
bool serialize (IO::CJsonObject &i_oObject, const bool i_bIsStrict=false) const
 Serializes the data to a JSON object. More...
 
std::string_view name () const
 Retrieves the name of the JSON field. More...
 
bool isNull () const
 Checks if the JSON field is null. More...
 
void setNull (bool i_bState)
 Sets the null state of the JSON field. More...
 
IO::CJsonObjectgetObject (IO::CJsonObject &i_oObject, const bool i_bIsStrict)
 Retrieves the JSON object for the specified JSON field. More...
 
bool checkSerializeObject (IO::CJsonObject &i_oObject, const bool i_bIsStrict) const
 Checks if serialization of the object is allowed and handles null fields. More...
 
- Protected Attributes inherited from Devel::Serializing::IValue< int >
int m_tValue
 The value.
 

Detailed Description

template<typename TStruct>
class Devel::Serializing::IJsonStruct< TStruct >

Represents a JSON structure data type and provides serialization and deserialization functionality.

Template Parameters
TStructThe type of the structure to represent as a JSON structure.

Constructor & Destructor Documentation

◆ IJsonStruct()

template<typename TStruct >
Devel::Serializing::IJsonStruct< TStruct >::IJsonStruct ( const CJsonFieldName  i_oFieldName)
inline

Constructs an IJsonStruct object with the specified field name.

Parameters
i_oFieldNameThe field name for the JSON structure.

Member Function Documentation

◆ operator=() [1/2]

template<typename TStruct >
IJsonStruct& Devel::Serializing::IJsonStruct< TStruct >::operator= ( const TStruct &  i_tValue)
inline

Assigns a value to the IJsonStruct object.

Parameters
i_tValueThe value to assign.
Returns
A reference to the IJsonStruct object

◆ operator=() [2/2]

template<typename TStruct >
IJsonStruct& Devel::Serializing::IJsonStruct< TStruct >::operator= ( TStruct &&  i_tValue)
inline

Assigns an rvalue to the IJsonStruct object.

Parameters
i_tValueThe rvalue to assign.
Returns
A reference to the IJsonStruct object.

The documentation for this class was generated from the following file: