X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=libs%2Fluci-lib-json%2Fluasrc%2Fjson.lua;fp=libs%2Fluci-lib-json%2Fluasrc%2Fjson.lua;h=9cf206e9600468083703a07b10646042ffe04774;hb=7a3493b1f7d75a3945279115324cf2ff4da26b7b;hp=8dbaf91836422dbfc1fbb90636f588227ae13cc0;hpb=998011462408e76c1a766afd5a6fe7ce82393218;p=project%2Fluci.git diff --git a/libs/luci-lib-json/luasrc/json.lua b/libs/luci-lib-json/luasrc/json.lua index 8dbaf9183..9cf206e96 100644 --- a/libs/luci-lib-json/luasrc/json.lua +++ b/libs/luci-lib-json/luasrc/json.lua @@ -1,43 +1,6 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ - -Decoder: - Info: - null will be decoded to luci.json.null if first parameter of Decoder() is true - - Example: - decoder = luci.json.Decoder() - luci.ltn12.pump.all(luci.ltn12.source.string("decodableJSON"), decoder:sink()) - luci.util.dumptable(decoder:get()) - - Known issues: - does not support unicode conversion \uXXYY with XX != 00 will be ignored - - -Encoder: - Info: - Accepts numbers, strings, nil, booleans as they are - Accepts luci.json.null as replacement for nil - Accepts full associative and full numerically indexed tables - Mixed tables will loose their associative values during conversion - Iterator functions will be encoded as an array of their return values - Non-iterator functions will probably corrupt the encoder - - Example: - encoder = luci.json.Encoder(encodableData) - luci.ltn12.pump.all(encoder:source(), luci.ltn12.sink.file(io.open("someFile", w))) -]]-- +-- Copyright 2008 Steven Barth +-- Copyright 2008 Jo-Philipp Wich +-- Licensed to the public under the Apache License 2.0. local nixio = require "nixio" local util = require "luci.util"