Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::CBORObject::Array Class Reference

Helper class for working with CBOR arrays. More...

#include <CBORObject.h>

Public Member Functions

 Array (const Array &other)
 Copy constructor.
 
Arrayoperator= (const Array &other)
 Copy assignment operator.
 
 ~Array ()
 Destructor.
 
cn_cbor_errback getLastError ()
 Get the last error that occurred during array operations.
 
Arrayappend (int value)
 Append an integer to the array.
 
Arrayappend (const char *value)
 Append a string to the array.
 
template<typename T>
Arrayappend (size_t size, const T *value)
 Append multiple values from an array to the CBOR array.
 
Array appendArray ()
 Append a new array as an element.
 

Friends

class CBORObject
 

Detailed Description

Helper class for working with CBOR arrays.

This class provides methods to append values to a CBOR array and maintains a reference back to the parent CBORObject.

Constructor & Destructor Documentation

◆ Array()

uniot::CBORObject::Array::Array ( const Array & other)
inline

Copy constructor.

Parameters
otherThe Array to copy

◆ ~Array()

uniot::CBORObject::Array::~Array ( )
inline

Destructor.

Member Function Documentation

◆ append() [1/3]

Array & uniot::CBORObject::Array::append ( const char * value)
inline

Append a string to the array.

Parameters
valueThe string value to append
Return values
Array&Reference to this Array

◆ append() [2/3]

Array & uniot::CBORObject::Array::append ( int value)
inline

Append an integer to the array.

Parameters
valueThe integer value to append
Return values
Array&Reference to this Array

◆ append() [3/3]

template<typename T>
Array & uniot::CBORObject::Array::append ( size_t size,
const T * value )
inline

Append multiple values from an array to the CBOR array.

Template Parameters
TThe array element type (must be integral)
Parameters
sizeThe number of elements to append
valuePointer to the array of values
Return values
Array&Reference to this Array

◆ appendArray()

Array uniot::CBORObject::Array::appendArray ( )
inline

Append a new array as an element.

Return values
ArrayA new Array object representing the nested array

◆ getLastError()

cn_cbor_errback uniot::CBORObject::Array::getLastError ( )
inline

Get the last error that occurred during array operations.

Return values
errorThe error information

◆ operator=()

Array & uniot::CBORObject::Array::operator= ( const Array & other)
inline

Copy assignment operator.

Parameters
otherThe Array to copy from
Return values
Array&Reference to this Array

Friends And Related Symbol Documentation

◆ CBORObject

friend class CBORObject
friend

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