2
0

json.luadoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ---[[
  2. LuCI JSON-Library
  3. @cstyle instance
  4. ]]
  5. module "luci.json"
  6. ---[[
  7. Directly decode a JSON string
  8. @class function
  9. @name decode
  10. @param json JSON-String
  11. @return Lua object
  12. ]]
  13. ---[[
  14. Direcly encode a Lua object into a JSON string.
  15. @class function
  16. @name encode
  17. @param obj Lua Object
  18. @return JSON string
  19. ]]
  20. ---[[
  21. Null replacement function
  22. @class function
  23. @name null
  24. @return null
  25. ]]
  26. ---[[
  27. Create a new JSON-Encoder.
  28. @class function
  29. @name Encoder
  30. @param data Lua-Object to be encoded.
  31. @param buffersize Blocksize of returned data source.
  32. @param fastescape Use non-standard escaping (don't escape control chars)
  33. @return JSON-Encoder
  34. ]]
  35. ---[[
  36. Create an LTN12 source providing the encoded JSON-Data.
  37. @class function
  38. @name Encoder.source
  39. @return LTN12 source
  40. ]]
  41. ---[[
  42. Create a new JSON-Decoder.
  43. @class function
  44. @name Decoder
  45. @param customnull Use luci.json.null instead of nil for decoding null
  46. @return JSON-Decoder
  47. ]]
  48. ---[[
  49. Create an LTN12 sink from the decoder object which accepts the JSON-Data.
  50. @class function
  51. @name Decoder.sink
  52. @return LTN12 sink
  53. ]]
  54. ---[[
  55. Get the decoded data packets after the rawdata has been sent to the sink.
  56. @class function
  57. @name Decoder.get
  58. @return Decoded data
  59. ]]
  60. ---[[
  61. Create a new Active JSON-Decoder.
  62. @class function
  63. @name ActiveDecoder
  64. @param customnull Use luci.json.null instead of nil for decoding null
  65. @return Active JSON-Decoder
  66. ]]
  67. ---[[
  68. Fetches one JSON-object from given source
  69. @class function
  70. @name ActiveDecoder.get
  71. @return Decoded object
  72. ]]