aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-12-20 23:42:12 +1030
committerMark Pulford <mark@kyne.com.au>2011-12-20 23:42:12 +1030
commitb4f1c4a7bcc306286ada61f6ecf2c78ef4cffa67 (patch)
tree90658283b0124ed7f864ebb118a01c9420258330
parent4f0b8d47af36dcd7cc1c41f3314805265250aa95 (diff)
downloadlua-cjson-b4f1c4a7bcc306286ada61f6ecf2c78ef4cffa67.tar.gz
lua-cjson-b4f1c4a7bcc306286ada61f6ecf2c78ef4cffa67.tar.bz2
lua-cjson-b4f1c4a7bcc306286ada61f6ecf2c78ef4cffa67.zip
Clarify optional args and return values
-rw-r--r--manual.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/manual.txt b/manual.txt
index 594f139..2917339 100644
--- a/manual.txt
+++ b/manual.txt
@@ -304,6 +304,9 @@ not freed until the Lua CJSON module is garbage collected. Setting this
304option to +false+ will cause the buffer to be freed after each call to 304option to +false+ will cause the buffer to be freed after each call to
305+cjson.encode+. 305+cjson.encode+.
306 306
307This setting is only changed when an argument is provided. The current
308setting is always returned.
309
307 310
308[[encode_max_depth]] 311[[encode_max_depth]]
309encode_max_depth 312encode_max_depth
@@ -318,6 +321,9 @@ depth = cjson.encode_max_depth([depth])
318By default, Lua CJSON will reject data structure with more than 20 nested 321By default, Lua CJSON will reject data structure with more than 20 nested
319tables. 322tables.
320 323
324This setting is only changed when an argument is provided. The current
325setting is always returned.
326
321This check prevents a deeply nested or recursive data structure from 327This check prevents a deeply nested or recursive data structure from
322crashing the application. 328crashing the application.
323 329
@@ -340,6 +346,9 @@ precision = cjson.encode_number_precision([precision])
340By default, Lua CJSON will output 14 significant digits when 346By default, Lua CJSON will output 14 significant digits when
341converting a number to text. 347converting a number to text.
342 348
349This setting is only changed when an argument is provided. The current
350setting is always returned.
351
343Reducing number precision to _3_ can improve performance of number 352Reducing number precision to _3_ can improve performance of number
344heavy JSON conversions by up to 50%. 353heavy JSON conversions by up to 50%.
345 354
@@ -360,6 +369,9 @@ Lua CJSON classifies Lua tables into 3 types when encoding as a JSON
360array. This is determined by the number of values missing for keys up 369array. This is determined by the number of values missing for keys up
361to the maximum index: 370to the maximum index:
362 371
372Each particular setting is only changed when that argument is
373provided. The current settings are always returned.
374
363[horizontal] 375[horizontal]
364Normal:: All values are available. 376Normal:: All values are available.
365Sparse:: At least 1 value is missing. 377Sparse:: At least 1 value is missing.
@@ -410,6 +422,9 @@ specification (_invalid numbers_):
410By default Lua CJSON will decode _invalid numbers_, but will refuse to 422By default Lua CJSON will decode _invalid numbers_, but will refuse to
411encode them. 423encode them.
412 424
425This setting is only changed when an argument is provided. The current
426setting is always returned.
427
413This setting can be configured separately for encoding and/or 428This setting can be configured separately for encoding and/or
414decoding: 429decoding:
415 430