Changeset 2976

Show
Ignore:
Timestamp:
08/27/08 19:49:52 (5 years ago)
Author:
Cyrus
Message:

Rewrote the API-documentation for luci.json

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ff-luci/trunk/libs/json/luasrc/json.lua

    r2956 r2976  
    5656local getmetatable = getmetatable 
    5757 
     58--- LuCI JSON-Library 
    5859module "luci.json" 
    5960 
     
    6465end 
    6566 
    66  
     67--- JSON-Encoder 
     68-- @class   module 
     69-- @cstyle  instance 
     70-- @name    luci.json.Encoder 
    6771Encoder = util.class() 
    6872 
    6973--- Creates a new Encoder. 
    70 -- @param data          Data to be encoded. 
    71 -- @param buffersize    Buffersize of returned data. 
     74-- @param data          Lua-Object to be encoded. 
     75-- @param buffersize    Blocksize of returned data source. 
    7276-- @param fastescape    Use non-standard escaping (don't escape control chars)  
    7377function Encoder.__init__(self, data, buffersize, fastescape) 
     
    8084end 
    8185 
    82 --- Create an LTN12 source from the encoder object 
     86--- Create an LTN12 source providing the encoded JSON-Data. 
    8387-- @return LTN12 source 
    8488function Encoder.source(self) 
     
    208212 
    209213 
    210  
     214--- JSON-Decoder 
     215-- @class   module 
     216-- @cstyle  instance 
     217-- @name    luci.json.Decoder 
    211218Decoder = util.class() 
    212219 
    213220--- Create a new Decoder object. 
    214 -- @param customnull User luci.json.null instead of nil 
     221-- @param customnull Use luci.json.null instead of nil 
    215222function Decoder.__init__(self, customnull) 
    216223    self.cnull = customnull 
     
    218225end 
    219226 
    220 --- Create an LTN12 sink from the decoder object. 
     227--- Create an LTN12 sink from the decoder object which accepts the JSON-Data. 
    221228-- @return LTN12 sink 
    222229function Decoder.sink(self) 
     
    228235 
    229236 
    230 --- Get the decoded data packets 
     237--- Get the decoded data packets after the rawdata has been sent to the sink. 
    231238-- @return Decoded data 
    232239function Decoder.get(self)