From: Eric S. Raymond Date: Tue, 23 Sep 2014 22:18:41 +0000 (-0400) Subject: Documentation polishing. X-Git-Tag: 1.0~9 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=0fe331d5a757900ba8ee1bb29229b9f9bdfba37b;p=microjson.git Documentation polishing. --- diff --git a/microjson.asc b/microjson.asc index a400cf3..df67faf 100644 --- a/microjson.asc +++ b/microjson.asc @@ -157,13 +157,17 @@ when the JSON object does not contain the corresponding attribute. You can turn off this defaulting behavior by setting the +nodefault+ member to +true+. -Additionally, an +json_attr_t+ instance with a +t_integer+ or -+t_uinteger+ type field can point at a map (an array of +json_enum_t+ -structures) that lists names and pairs of integral values. If this is -done, the parser expects the values of the JSON attribute to be strings but -internally maps them to corresponding integer values beore setting the -target storage. An un-enumerated string value causes the parse to -error out. +=== Enumerated-value types === + +The parser includes support for string attributes with controlled +vocabularies. + +A +json_attr_t+ instance with a +t_integer+ or +t_uinteger+ type field +can point at a map (an array of +json_enum_t+ structures) that lists +names and pairs of integral values. If this is done, the parser +expects the values of the JSON attribute to be strings but internally +maps them to corresponding integer values before setting the target +storage. An un-enumerated string value causes the parse to error out. (Case 8 in the unit tet source code illistrates how to use this feature.)