From 1eceec61928486e5f6a812a88d022a849bfbec1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Blanchon?= Date: Fri, 6 Nov 2015 22:03:39 +0100 Subject: [PATCH] Updated API Reference (markdown) --- API-Reference.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/API-Reference.md b/API-Reference.md index b4ee4b5..8326381 100644 --- a/API-Reference.md +++ b/API-Reference.md @@ -1,9 +1,27 @@ :construction: Work in progress, feel free to edit :construction: ## JsonArray -Create an empty JsonArray attached to the specified JsonBuffer. -You should not call this constructor directly. -Instead, use JsonBuffer::createArray() or JsonBuffer::parseArray(). + +Represents an array in a JSON object tree. + +### Constructor + +The constructor is private, you cannot instanciate a `JsonArray` directly, you have to use a `JsonBuffer`. + +Because the actual memory location of a `JsonArray` is in the `JsonBuffer`, you always manipulate them through reference and you cannot copy them. + +##### Example + +```c++ +StaticJsonBuffer<200> jsonBuffer; + +// create an empty array +JsonArray& array1 = jsonBuffer.createArray(); + +// parse a JSON array +char json[] = "[1,2,3]"; +JsonArray& array2 = jsonBuffer.parseArray(json); +``` ### JsonArray::add()