Classes | |
| struct | sourcemeta::blaze::BYTE_CHOICE_INDEX |
| The encoding consists of an index to the enumeration choices encoded as an 8-bit fixed-length unsigned integer. More... | |
| struct | sourcemeta::blaze::LARGE_CHOICE_INDEX |
| The encoding consists of an index to the enumeration choices encoded as a Base-128 64-bit Little Endian variable-length unsigned integer. More... | |
| struct | sourcemeta::blaze::TOP_LEVEL_BYTE_CHOICE_INDEX |
| If the input value corresponds to the index 0 to the enumeration choices, the encoding stores no data. Otherwise, the encoding consists of an index to the enumeration choices minus 1 encoded as an 8-bit fixed-length unsigned integer. More... | |
| struct | sourcemeta::blaze::CONST_NONE |
| The constant input value is not encoded. More... | |
| struct | sourcemeta::blaze::ANY_PACKED_TYPE_TAG_BYTE_PREFIX |
| struct sourcemeta::blaze::BYTE_CHOICE_INDEX |
The encoding consists of an index to the enumeration choices encoded as an 8-bit fixed-length unsigned integer.
| Option | Type | Description |
|---|---|---|
| choices | any[] | The set of choice values |
| Condition | Description |
|---|---|
| len(choices) > 0 | The choices array must not be empty |
| len(choices) < 2 ** 8 | The number of choices must be representable in 8 bits |
| value in choices | The input value must be included in the set of choices |
Given an enumeration [ "foo", "bar", "baz" ] and an input value "bar", the encoding results in the unsigned 8 bit integer 1:
Given an enumeration [ "foo", "bar", "baz" ] and an input value "foo", the encoding results in the unsigned 8 bit integer 0:
Public Attributes | |
| std::vector< sourcemeta::core::JSON > | choices |
| The set of choice values. | |
| struct sourcemeta::blaze::LARGE_CHOICE_INDEX |
The encoding consists of an index to the enumeration choices encoded as a Base-128 64-bit Little Endian variable-length unsigned integer.
| Option | Type | Description |
|---|---|---|
| choices | any[] | The set of choice values |
| Condition | Description |
|---|---|
| len(choices) > 0 | The choices array must not be empty |
| value in choices | The input value must be included in the set of choices |
Given an enumeration with 1000 members and an input value that equals the 300th enumeration value, the encoding results in the Base-128 64-bit Little Endian variable-length unsigned integer 300:
Public Attributes | |
| std::vector< sourcemeta::core::JSON > | choices |
| The set of choice values. | |
| struct sourcemeta::blaze::TOP_LEVEL_BYTE_CHOICE_INDEX |
If the input value corresponds to the index 0 to the enumeration choices, the encoding stores no data. Otherwise, the encoding consists of an index to the enumeration choices minus 1 encoded as an 8-bit fixed-length unsigned integer.
| Option | Type | Description |
|---|---|---|
| choices | any[] | The set of choice values |
| Condition | Description |
|---|---|
| len(choices) > 0 | The choices array must not be empty |
| len(choices) < 2 ** 8 | The number of choices must be representable in 8 bits |
| value in choices | The input value must be included in the set of choices |
Given an enumeration [ "foo", "bar", "baz" ] and an input value "bar", the encoding results in the unsigned 8 bit integer 0:
Given an enumeration [ "foo", "bar", "baz" ] and an input value "foo", the value is not encoded.
Public Attributes | |
| std::vector< sourcemeta::core::JSON > | choices |
| The set of choice values. | |
| struct sourcemeta::blaze::CONST_NONE |
| struct sourcemeta::blaze::ANY_PACKED_TYPE_TAG_BYTE_PREFIX |