Value class final
#include <cbor/value.hpp>
Strongly typed scalar value used by CBOR map encoding and decoding.
This class intentionally supports only a small scalar subset that is needed by configuration and management payloads. The subset keeps parser behavior bounded and deterministic on constrained targets.
Constructors, destructors, conversion operators
Public functions
- auto as_bool(bool* out) const -> bool
- Reads boolean value when type is
ValueType::.Bool - auto as_bytes(std::vector<uint8_t>* out) const -> bool
- Reads byte array when type is
ValueType::.Bytes - auto as_double(double* out) const -> bool
- Reads floating-point value when type is
ValueType::.Double - auto as_int64(int64_t* out) const -> bool
- Reads signed integer value when type is
ValueType::.Int64 - auto as_string(std::string* out) const -> bool
- Reads string value when type is
ValueType::.String - auto as_uint64(uint64_t* out) const -> bool
- Reads unsigned integer value when type is
ValueType::.UInt64 - auto operator!=(const Value& other) const -> bool
- auto operator==(const Value& other) const -> bool
- auto type() const -> ValueType
- Returns active value type.