Updated API Reference (markdown)

Benoît Blanchon
2016-07-09 18:42:25 +02:00
parent 3996d38e51
commit 35d581d6e4

@@ -87,11 +87,79 @@ array.printTo(Serial);
will write will write
``` ```json
["hello",3.1416] ["hello",3.1416]
``` ```
### JsonArray::createNestedArray()
##### Description
Adds a new nested array to the end of the array.
##### Signature
```c++
JsonArray& createNestedArray();
```
##### Return value
A reference to the new `JsonArray`.
You can check `JsonArray::success()` to verify that the allocation succeeded.
##### Example
```c++
StaticJsonBuffer<200> jsonBuffer;
JsonArray& array = jsonBuffer.createArray();
array.add("hello");
JsonArray& nested = array.createNestedArray();
nested.add("world");
array.printTo(Serial);
```
will write
```json
["hello",["world"]]
```
### JsonArray::createNestedObject()
##### Description
Adds a new nested object to the end of the array.
##### Signature
```c++
JsonObject& createNestedObject();
```
##### Return value
A reference to the new `JsonObject`.
You can check `JsonObject::success()` to verify that the allocation succeeded.
##### Example
```c++
StaticJsonBuffer<200> jsonBuffer;
JsonArray& array = jsonBuffer.createArray();
JsonObject& nested = array.createNestedObject();
nested["hello"] = "world";
array.printTo(Serial);
```
will write
```json
[{"hello":"world"}]
```
### JsonArray::get() ### JsonArray::get()
@@ -693,7 +761,8 @@ To avoid this behavior, use a `const char*` key instead.
##### Return value ##### Return value
A reference to the new `JsonArray` A reference to the new `JsonArray`.
You can check `JsonArray::success()` to verify that the allocatio succeeded.
##### Example ##### Example
@@ -744,7 +813,8 @@ To avoid this behavior, use a `const char*` key instead.
##### Return value ##### Return value
A reference to the new `JsonObject` A reference to the new `JsonObject`.
You can check `JsonObject::success()` to verify that the allocatio succeeded.
##### Example ##### Example