Type 6 – Semantic tags¶
Tag are additional metadata that can be used to extend or specialize the meaning or interpretation of the other data items.
For example, one might tag an array of numbers to communicate that it should be interpreted as a vector.
Please consult the official IANA repository of CBOR tags before inventing new ones.
Corresponding |
|
Number of allocations |
One plus any manipulations with the data reallocations relative to chunk count |
Storage requirements |
|
-
cbor_item_t *cbor_new_tag(uint64_t value)¶
Create a new tag.
- param value
The tag value. Please consult the tag repository
- return
new tag. Item reference is
NULL
. ReturnsNULL
upon memory allocation failure
-
cbor_item_t *cbor_tag_item(const cbor_item_t *item)¶
Get the tagged item.
- param item[borrow]
A tag
- return
incref the tagged item
-
uint64_t cbor_tag_value(const cbor_item_t *item)¶
Get tag value.
- param item[borrow]
A tag
- return
The tag value. Please consult the tag repository
-
void cbor_tag_set_item(cbor_item_t *item, cbor_item_t *tagged_item)¶
Set the tagged item.
- param item[borrow]
A tag
- param tagged_item[incref]
The item to tag