![]() |
|
Uniot Core
|
| 0.8.1 |
#include <CBORObject.h>
Classes | |
| class | Array |
| Helper class for working with CBOR arrays. More... | |
Public Member Functions | |
| CBORObject (const CBORObject &) | |
| Copy constructor (not implemented) | |
| CBORObject & | operator= (const CBORObject &) |
| Copy assignment operator (not implemented) | |
| CBORObject (Bytes buf) | |
| Construct a CBORObject from binary CBOR data. | |
| CBORObject () | |
| Construct an empty CBORObject. | |
| virtual | ~CBORObject () |
| Virtual destructor. | |
| cn_cbor_errback | getLastError () |
| Get the last error that occurred during CBOR operations. | |
| bool | hasError () |
| Array | putArray (int key) |
| Create or get an array at a specific integer key. | |
| Array | putArray (const char *key) |
| Create or get an array at a specific string key. | |
| CBORObject & | put (int key, int value) |
| Put an integer value at a specific integer key. | |
| CBORObject & | put (int key, uint64_t value) |
| Put an unsigned 64-bit integer value at a specific integer key. | |
| CBORObject & | put (int key, int64_t value) |
| Put a 64-bit integer value at a specific integer key. | |
| CBORObject & | put (int key, const char *value) |
| Put a string value at a specific integer key. | |
| CBORObject & | put (int key, const uint8_t *value, int size) |
| Put binary data at a specific integer key. | |
| CBORObject & | put (const char *key, int value) |
| Put an integer value at a specific string key. | |
| CBORObject & | put (const char *key, uint64_t value) |
| Put an unsigned 64-bit integer value at a specific string key. | |
| CBORObject & | put (const char *key, int64_t value) |
| Put a 64-bit integer value at a specific string key. | |
| CBORObject & | put (const char *key, const char *value) |
| Put a string value at a specific string key. | |
| CBORObject & | put (const char *key, const uint8_t *value, int size) |
| Put binary data at a specific string key. | |
| CBORObject | putMap (const char *key) |
| Put a new map at a specific string key, or get the existing one. | |
| CBORObject | getMap (int key) |
| Get a map at a specific integer key. | |
| CBORObject | getMap (const char *key) |
| Get a map at a specific string key. | |
| bool | getBool (int key) const |
| Get a boolean value at a specific integer key. | |
| bool | getBool (const char *key) const |
| Get a boolean value at a specific string key. | |
| long | getInt (int key) const |
| Get an integer value at a specific integer key. | |
| long | getInt (const char *key) const |
| Get an integer value at a specific string key. | |
| String | getString (int key) const |
| Get a string value at a specific integer key. | |
| String | getString (const char *key) const |
| Get a string value at a specific string key. | |
| String | getValueAsString (int key) const |
| Get a value as a string at a specific integer key. | |
| String | getValueAsString (const char *key) const |
| Get a value as a string at a specific string key. | |
| Bytes | getBytes (int key) const |
| Get binary data at a specific integer key. | |
| Bytes | getBytes (const char *key) const |
| Get binary data at a specific string key. | |
| void | read (const Bytes &buf) |
| Read CBOR data from a buffer. | |
| Bytes | build () const |
| Build the CBOR data into binary format. | |
| bool | isChild () const |
| Check if this object is a child node in a CBOR tree. | |
| bool | dirty () const |
| Check if the object has been modified since creation or last read. | |
| void | forceDirty () |
| Force the object to be marked as dirty (modified) | |
| void | clean () |
| Reset the object to an empty state. | |
Friends | |
| class | COSEMessage |
|
inline |
Copy constructor (not implemented)
| other | The CBORObject to copy |
|
inline |
Construct a CBORObject from binary CBOR data.
| buf | The CBOR data in Bytes format |
|
inline |
Construct an empty CBORObject.
|
inlinevirtual |
Virtual destructor.
|
inline |
Build the CBOR data into binary format.
| visitSiblings | Whether to include sibling nodes (default is true for root objects) |
| Bytes | The binary CBOR data |
|
inline |
Reset the object to an empty state.
|
inline |
|
inline |
Force the object to be marked as dirty (modified)
|
inline |
Get a boolean value at a specific string key.
| key | The string key |
| bool | The boolean value |
| false | If the key does not exist or is not a boolean |
|
inline |
Get a boolean value at a specific integer key.
| key | The integer key |
| bool | The boolean value |
| false | If the key does not exist or is not a boolean |
|
inline |
|
inline |
|
inline |
Get an integer value at a specific string key.
| key | The string key |
| long | The integer value |
| 0 | If the key does not exist or is not an integer |
|
inline |
Get an integer value at a specific integer key.
| key | The integer key |
| long | The integer value |
| 0 | If the key does not exist or is not an integer |
|
inline |
Get the last error that occurred during CBOR operations.
| err | The error code |
|
inline |
Get a map at a specific string key.
| key | The string key |
| CBORObject | A new CBORObject representing the map |
| CBORObject | An empty object if the key does not exist or is not a map |
|
inline |
Get a map at a specific integer key.
| key | The integer key |
| CBORObject | A new CBORObject representing the map |
| CBORObject | An empty object if the key does not exist or is not a map |
|
inline |
Get a string value at a specific string key.
| key | The string key |
| String | The string value |
| "" | Empty string, if the key does not exist or is not a string |
|
inline |
Get a string value at a specific integer key.
| key | The integer key |
| String | The string value |
| "" | Empty string, if the key does not exist or is not a string |
|
inline |
Get a value as a string at a specific string key.
| key | The string key |
| String | The value converted to a string |
| "" | Empty string, if the key does not exist or is not a string |
|
inline |
Get a value as a string at a specific integer key.
| key | The integer key |
| String | The value converted to a string |
| "" | Empty string, if the key does not exist or is not a string |
|
inline |
|
inline |
Check if this object is a child node in a CBOR tree.
| true | Current object is a child of another CBORObject |
| false | Current object is a root CBORObject |
|
inline |
Copy assignment operator (not implemented)
| other | The CBORObject to assign from |
| CBORObject& | Reference to this object |
|
inline |
Put a string value at a specific string key.
| key | The string key |
| value | The string value to store |
| CBORObject& | Reference to this object |
|
inline |
Put binary data at a specific string key.
| key | The string key |
| value | Pointer to the binary data |
| size | Size of the binary data in bytes |
| CBORObject& | Reference to this object |
|
inline |
Put an integer value at a specific string key.
| key | The string key |
| value | The integer value to store |
| CBORObject& | Reference to this object |
|
inline |
Put a 64-bit integer value at a specific string key.
| key | The string key |
| value | The 64-bit integer value to store |
| CBORObject& | Reference to this object |
|
inline |
Put an unsigned 64-bit integer value at a specific string key.
| key | The string key |
| value | The unsigned 64-bit integer value to store |
| CBORObject& | Reference to this object |
|
inline |
Put a string value at a specific integer key.
| key | The integer key |
| value | The string value to store |
| CBORObject& | Reference to this object |
|
inline |
Put binary data at a specific integer key.
| key | The integer key |
| value | Pointer to the binary data |
| size | Size of the binary data in bytes |
| CBORObject& | Reference to this object |
|
inline |
Put an integer value at a specific integer key.
| key | The integer key |
| value | The integer value to store |
| CBORObject& | Reference to this object |
|
inline |
Put a 64-bit integer value at a specific integer key.
| key | The integer key |
| value | The 64-bit integer value to store |
| CBORObject& | Reference to this object |
|
inline |
Put an unsigned 64-bit integer value at a specific integer key.
| key | The integer key |
| value | The unsigned 64-bit integer value to store |
| CBORObject& | Reference to this object |
|
inline |
|
inline |
|
inline |
Put a new map at a specific string key, or get the existing one.
| key | The string key |
| CBORObject | A new CBORObject representing the map |
|
inline |
Read CBOR data from a buffer.
| buf | The buffer containing CBOR data |
|
friend |