Helper class for working with CBOR arrays.
More...
#include <CBORObject.h>
|
| | Array (const Array &other) |
| | Copy constructor.
|
| |
| Array & | operator= (const Array &other) |
| | Copy assignment operator.
|
| |
| | ~Array () |
| | Destructor.
|
| |
| cn_cbor_errback | getLastError () |
| | Get the last error that occurred during array operations.
|
| |
| Array & | append (int value) |
| | Append an integer to the array.
|
| |
| Array & | append (const char *value) |
| | Append a string to the array.
|
| |
| template<typename T> |
| Array & | append (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.
|
| |
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.
◆ Array()
| uniot::CBORObject::Array::Array |
( |
const Array & | other | ) |
|
|
inline |
Copy constructor.
- Parameters
-
◆ ~Array()
| uniot::CBORObject::Array::~Array |
( |
| ) |
|
|
inline |
◆ append() [1/3]
| Array & uniot::CBORObject::Array::append |
( |
const char * | value | ) |
|
|
inline |
Append a string to the array.
- Parameters
-
| value | The 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
-
| value | The 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
-
| T | The array element type (must be integral) |
- Parameters
-
| size | The number of elements to append |
| value | Pointer 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
-
| Array | A 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
-
| error | The error information |
◆ operator=()
| Array & uniot::CBORObject::Array::operator= |
( |
const Array & | other | ) |
|
|
inline |
Copy assignment operator.
- Parameters
-
| other | The Array to copy from |
- Return values
-
| Array& | Reference to this Array |
◆ CBORObject
The documentation for this class was generated from the following file: