Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<url-encoded name>|<space>|<typenum>|<space>|<type-specific-content>|<eol>

<space> := 0x20
<typenum> := 0|1|2|3|4|5|7
<child-count> := Unsigned 32-bit integer in ASCII
<int-val> := Signed 32-bit integer in ASCII
<long-val> := Signed 64-bit integer in ASCII
<float-val> := double precision 15-bit fixed floating point in ASCII
<eol> := 0x0A

DDF_EMPTY:
DDF_POINTER:
    0
DDF_STRING:
    1|<space>|<url-encoded string>
DDF_INT:
    2|<space>|<int-val>
DDF_FLOAT:
    3|<space>|<float-val>
DDF_STRUCT:
    4|<space>|<child-count>
DDF_LIST:
    5|<space>|<child-count>
DDF_STRING_UNSAFE:
    7|<space>|<url-encoded string>
DDF_LONG:
    8|<space>|<long-val>

Pointers are collapsed into empty, so the type value of 6 is unused. The distinction of unsafe strings allows for proper deserialization in languages that need to handle non-UTF8 strings differently since on the wire everything is URL encoded. URL encoding does not actually signal character encoding, so an encoding of a given sequence of bytes is not inherently a deterministic set of specific string characters, which is extremely relevant in Java. Floating point data is handled but in practice this hasn’t been used much and may not work too well.

...