dict
A dictionary is a key-value container of arbitrary key/value pairs and heterogeneous types.
Attributes
| Attribute | Data Type | Allowed Values | Occurrence | Description |
|---|---|---|---|---|
| type | string | dict |
0-1 | Type of the element. |
| version | unsigned integer | 7 |
0-1 | Version of the XML element. |
Note: Optional attributes (0 occurrence attributes) will be inferred from the parent node.
Children
No child elements are defined for a dict element since its data structure is undefined; each child element created by the client must define its data type using the type attribute. The allowed data types are listed below.
| Children Attribute | Data Type | Allowed Values | Occurrence | Description |
|---|---|---|---|---|
| type | string | Children Data Type | 0-1 | Type of the element. String is assumed if not specified. |
| label | string | any | 0-1 | Display label for complex type. Value converted to string if possible and not specified. |
| Children Data Type | Type Description |
|---|---|
| int | integer |
| uint | unsigned Integer |
| int8 | 8-bit integer |
| uint8 | 8-bit unsigned integer |
| int16 | 16-bit integer |
| uint16 | 16-bit unsigned integer |
| int32 | 32-bit integer |
| uint32 | 32-bit unsigned integer |
| int64 | 64-bit integer |
| uint64 | 64-bit unsigned integer |
| float | single precision floating point number |
| double | double precision floating point number |
| bool | boolean (True, False, Yes, No, 1, 0) |
| string | string |
| binary | escaped string to allow XML encoding |
| rate | rate |
| rational | rational |
| time | time |
| uid | string |
| keycode | space-separated keycode |
| dict | this data type |
Examples
Example 1 - Simple example
<userData type="dict">
<appName type="string">Flame</appName>
<appVersion type="int16">2017</appVersion>
<mode type="int16" label="Full Res / No Proxy">0x12341</mode>
</userData>
Example 2 - Example with nested complex types
<userData type="dict">
<options type="dict">
<disable type="bool">True</disable>
<sampleRate type="rate">
<numerator>24</numerator>
<denominator>1001</denominator>
</sampleRate>
<speed type="int8">23</speed>
</options>
</userData>
