Utility class to write dynamic structs.
More...
#include <RscStructWriter.hpp>
Utility class to write dynamic structs.
This class uses the struct information stored in RscVariant, which is passed as argument to the constructor.
◆ RscStructWriter()
Arp::Base::Rsc::Commons::RscStructWriter::RscStructWriter |
( |
const RscVariantBase & |
structVariant | ) |
|
|
explicit |
Constructs a RscStructWriter instance.
- Parameters
-
structVariant | The RscVariant value representing a dynamic struct. |
- Template Parameters
-
N | The maximal length of a string, excluding NUL terminator, if one of the struct fields is of type string. |
◆ GetFieldCount()
size_t Arp::Base::Rsc::Commons::RscStructWriter::GetFieldCount |
( |
void |
| ) |
const |
Gets the field count of the struct to write.
- Returns
- The field count of the struct.
◆ WriteNextField() [1/3]
template<int N>
void Arp::Base::Rsc::Commons::RscStructWriter::WriteNextField |
( |
const RscString< N > & |
value | ) |
|
|
inline |
Writes the next string field of the struct.
- Parameters
-
value | The string to write. |
- Template Parameters
-
N | Determines the maximum string size of string array elements. If set to 0 strings are be supported. |
◆ WriteNextField() [2/3]
template<int N>
void Arp::Base::Rsc::Commons::RscStructWriter::WriteNextField |
( |
const RscVariant< N > & |
value | ) |
|
|
inline |
Writes the next field of the struct. This operation is used if the field is an object, an array, a struct or unknown.
- Parameters
-
- Template Parameters
-
N | Determines the maximum string size of string array elements. If set to 0 strings are not supported. |
◆ WriteNextField() [3/3]
template<class T >
void Arp::Base::Rsc::Commons::RscStructWriter::WriteNextField |
( |
const T & |
value | ) |
|
|
inline |
Writes the next field of the struct. This operation is used if the field is an object, an array, a struct or unknown.
- Parameters
-
value | The resulting variant value. |
The documentation for this class was generated from the following files: