source: rtos_arduino/trunk/arduino_lib/libraries/ArduinoJson/src/JsonArray.cpp@ 209

Last change on this file since 209 was 209, checked in by ertl-honda, 8 years ago

BlueMix用のフィアルを追加

File size: 936 bytes
Line 
1// Copyright Benoit Blanchon 2014-2016
2// MIT License
3//
4// Arduino JSON library
5// https://github.com/bblanchon/ArduinoJson
6// If you like this project, please add a star!
7
8#include "../include/ArduinoJson/JsonArray.hpp"
9
10#include "../include/ArduinoJson/JsonBuffer.hpp"
11#include "../include/ArduinoJson/JsonObject.hpp"
12
13using namespace ArduinoJson;
14using namespace ArduinoJson::Internals;
15
16JsonArray JsonArray::_invalid(NULL);
17
18JsonArray::node_type *JsonArray::getNodeAt(size_t index) const {
19 node_type *node = _firstNode;
20 while (node && index--) node = node->next;
21 return node;
22}
23
24void JsonArray::removeAt(size_t index) { removeNode(getNodeAt(index)); }
25
26void JsonArray::writeTo(JsonWriter &writer) const {
27 writer.beginArray();
28
29 const node_type *child = _firstNode;
30 while (child) {
31 child->content.writeTo(writer);
32
33 child = child->next;
34 if (!child) break;
35
36 writer.writeComma();
37 }
38
39 writer.endArray();
40}
Note: See TracBrowser for help on using the repository browser.