summaryrefslogtreecommitdiff
path: root/lib/cbor/tinycbor/src/cbor.dox
blob: 0bf5c54c2710898eb4b929fa199ef2367974ba1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/****************************************************************************
**
** Copyright (C) 2016 Intel Corporation
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
** in the Software without restriction, including without limitation the rights
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
** copies of the Software, and to permit persons to whom the Software is
** furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
** THE SOFTWARE.
**
****************************************************************************/

/**
 * \mainpage
 * The TinyCBOR $(VERSION) library is a small CBOR encoder and decoder library,
 * optimized for very fast operation with very small footprint. The main encoder
 * and decoder functions do not allocate memory.
 *
 * TinyCBOR is divided into the following groups of functions and structures:
 *  - \ref CborGlobals
 *  - \ref CborEncoding
 *  - \ref CborParsing
 *  - \ref CborPretty
 *  - \ref CborToJson
 */

/**
 * \file <cbor.h>
 * The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions
 * as well as the structures for encoding (CborEncoder) and decoding (CborValue).
 *
 * \sa <cborjson.h>
 */

/**
 * \file <cborjson.h>
 * The <cborjson.h> file contains the routines that are used to convert a CBOR
 * data stream into JSON.
 *
 * \sa <cbor.h>
 */

/**
 * \defgroup CborGlobals Global constants
 * \brief Constants used by all TinyCBOR function groups.
 */

/**
 * \addtogroup CborGlobals
 * @{
 */

/**
 * \var size_t CborIndefiniteLength
 *
 * This variable is a constant used to indicate that the length of the map or
 * array is not yet determined. It is used in functions
 * cbor_encoder_create_map() and cbor_encoder_create_array()
 */

/**
 * \enum CborType
 * The CborType enum contains the types known to TinyCBOR.
 *
 * \value CborIntegerType           Type is an integer value, positive, negative or zero
 * \value CborByteStringType        Type is a string of arbitrary raw bytes
 * \value CborTextStringType        Type is a text string encoded in UTF-8
 * \value CborArrayType             Type is a CBOR array
 * \value CborMapType               Type is a CBOR map (an associative container with key and value pairs)
 * \value CborTagType               Type is a CBOR tag (a 64-bit integer describing the item that follows, see CborKnownTags)
 * \value CborSimpleType            Type is one of the CBOR Simple Types
 * \value CborBooleanType           Type is a boolean (true or false)
 * \value CborNullType              Type encodes a null
 * \value CborUndefinedType         Type encodes an undefined value
 * \value CborHalfFloatType         Type is an IEEE 754 half precision (16-bit) floating point type
 * \value CborFloatType             Type is an IEEE 754 single precision (32-bit) floating point type
 * \value CborDoubleType            Type is an IEEE 754 double precision (64-bit) floating point type
 * \value CborInvalidType           Type is not valid (this value is used to indicate error conditions)
 */

/**
 * \enum CborKnownTags
 * The CborKnownTags enum contains known tags specified in RFC 7049, for use by the application.
 * TinyCBOR does not usually interpret the meaning of these tags and does not add them to the
 * output stream, unless specifically instructed to do so in functions for that effect.
 *
 * \value CborDateTimeStringTag     Text string contains a date-time encoded in RFC 3339 format, "YYYY-MM-DD hh:mm:ss+zzzz"
 * \value CborUnixTime_tTag         Number is a Unix time_t quantity, the number of seconds since 1970-01-01 midnight UTC
 * \value CborPositiveBignumTag     Item is a CBOR byte string encoding a positive integer of arbitrary precision
 * \value CborNegativeBignumTag     Item is a CBOR byte string encoding a negative integer of arbitrary precision
 * \value CborDecimalTag            Item is a CBOR array of two integers encoding a fixed-point decimal
 * \value CborBigfloatTag           Item is a bigfloat
 * \value CborExpectedBase64urlTag  Item is a CBOR byte string that is expected to be encoded as Base64Url
 * \value CborExpectedBase64Tag     Item is a CBOR byte string that is expected to be encoded as Base64
 * \value CborExpectedBase16Tag     Item is a CBOR byte string that is expected to be encoded as Base16 (also known as "hexdump")
 * \value CborUriTag                Item is a CBOR text string containing a URI (RFC 3986) or IRI (RFC 3987)
 * \value CborBase64urlTag          Item is a CBOR text string that was encoded as Base64Url
 * \value CborBase64Tag             Item is a CBOR text string that was encoded as Base64
 * \value CborRegularExpressionTag  Item is a CBOR text string containing a regular expression
 * \value CborMimeMessageTag        Item is a CBOR text string containing a MIME message (RFC 2045, 2046, 2047, 2822)
 * \value CborSignatureTag          Item contains CBOR-encoded data.
 *                                  This tag is also used as "file magic," marking a file as containing CBOR
 */

/**
 * \typedef CborTag
 * This typedef is an unsigned 64-bit integer. Known CBOR tags can be used from the CborKnownTags enum
 * but the user application may use other tag values than the ones specified in RFC 7049.
 */

/** @} */