X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fluci-lib-jsonc%2Fsrc%2Fjsonc.luadoc;fp=libs%2Fluci-lib-jsonc%2Fsrc%2Fjsonc.luadoc;h=720b17d1eb76d8eb9a8b47939ac724891cfb3886;hp=2ee9cebdc889242595f5281228783df15b9b8dcd;hb=5335f225374c7ed993348d15b5018411dc776bab;hpb=f0083abed10e8a397ebe9e62801e3b5d536ba7b6 diff --git a/libs/luci-lib-jsonc/src/jsonc.luadoc b/libs/luci-lib-jsonc/src/jsonc.luadoc index 2ee9cebdc..720b17d1e 100644 --- a/libs/luci-lib-jsonc/src/jsonc.luadoc +++ b/libs/luci-lib-jsonc/src/jsonc.luadoc @@ -121,10 +121,22 @@ parser:set({ "some", "data" })` ]] ---[[ -Serialize current parser state as JSON. +Generate an ltn12-compatible sink. @class function @sort 4 +@name parser.sink +@return Returns a function that can be used as an ltn12 sink. +@usage `parser = luci.jsonc.new() +ltn12.pump.all(ltn12.source.file(io.input()), parser:sink()) +print(parser:get())` +]] + +---[[ +Serialize current parser state as JSON. + +@class function +@sort 5 @name parser.stringify @param pretty A boolean value indicating whether the resulting JSON should be pretty printed. @return Returns the serialized JSON data of this parser instance.