LibParse

This library will encode/decode common serialization formats. The first two formats being added are JSON and CSV. Other formats such as XML may be added later. I was surprised no such library already exists (as far as I could tell) as I plan on using JSON and CSV in one of my other addons so thought it'd be useful to put this in its own library.

The JSON functions are a modified version of a publicly available, MIT licensed Lua JSON library (http://www.chipmunkav.com/downloads/Json.lua).

CSV support was introduced with v1.0.


Library APIs:

lib:JSONEncode(o)
Encodes the passed lua table into a JSON string.

lib:JSONDecode(s)
Decodes the passed JSON string into a lua table.

lib:JSONNull()
Returns a reference to the table used to represent NULL.

lib:CSVEncode(keys, data)
Encodes the passed data as CSV with the passed keys.

lib:CSVDecode(str)
Decodes the passed CSV string into keys / data.

You must login to post a comment. Don't have an account? Register to get one!

Table of contents

  1. 1 Library APIs:

Facts

Date created
Jun 05, 2012
Last updated
Aug 15, 2014

Author