Packed Syntax
Syntax
The form for each element of this codec is as follows:
[type][|name=][data][|endtype]
type
is mandatory, name
must be present for map
attributes and must not be present for list items, endtype
applies
to lists and maps but not to other data types.
Type specifiers
- ( ) for lists
- [ ] for maps
- $ for string
- @ for int
- # for float
Sample output
[@id=17$name=Fred +28the +2b great+29#weight=1.5(args=@1@2@3)]
This example represents a map with the following attributes:
- name="id", type="int", value="17"
- name="name", type="string", value="Fred (the + great)"
- name="weight", type="float", value="1.5"
- name="args", type="list", value=
- type="int", value="1"
- type="int", value="2"
- type="int", value="3"
Special characters
The following characters cannot appear verbatim in strings:
- + (plus symbol)
- [ (left square bracket)
- ] (right square bracket)
- ( (left parenthesis)
- ) (right parenthesis)
- @ (at symbol)
- # (hash symbol)
- $ (dollar symbol)
- = (equals symbol)
- \n (newline character)
- \r (carriage return character)
They are encoded by sending a plus symbol followed by the ascii value of the
character in hexadecimal. See the example above for details.
Notes
No UNICODE or other multibyte character support exists at present.