From 3b91a8a2186f31a78140713832a5b6118f4b857d Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Sun, 12 Jan 2014 23:07:15 +0100 Subject: [PATCH] Added README.md --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..17e4288c --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# A malloc-free JSON parser for Arduino + +The library is an convenient and efficient wrapper around the *jsmn* tokenizer: http://zserge.com/jsmn.html + +It works without any allocation on the heap (no malloc) and supports nested objects. + +## Example + + char* json = "{\"Name\":\"Blanchon\",\"Skills\":[\"C\",\"C++\",\"C#\"],\"Age\":32,\"Online\":true}"; + + JsonParser<256> parser; + + JsonHashTable hashTable = parser.parseHashTable(json); + + if (!hashTable.success()) + { + return; + } + + char* name = hashTable.getString("Name"); + + JsonArray skills = hashTable.getArray("Skills"); + + int age = hashTable.getLong("Age"); + + bool online = hashTable.getBool("Online"); +