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

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

BlueMix用のフィアルを追加

File size: 1.1 KB
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/JsonObject.hpp"
9
10#include <string.h> // for strcmp
11
12#include "../include/ArduinoJson/Internals/StaticStringBuilder.hpp"
13#include "../include/ArduinoJson/JsonArray.hpp"
14#include "../include/ArduinoJson/JsonBuffer.hpp"
15
16using namespace ArduinoJson;
17using namespace ArduinoJson::Internals;
18
19JsonObject JsonObject::_invalid(NULL);
20
21JsonObject::node_type *JsonObject::getNodeAt(const char *key) const {
22 for (node_type *node = _firstNode; node; node = node->next) {
23 if (!strcmp(node->content.key, key)) return node;
24 }
25 return NULL;
26}
27
28void JsonObject::writeTo(JsonWriter &writer) const {
29 writer.beginObject();
30
31 const node_type *node = _firstNode;
32 while (node) {
33 writer.writeString(node->content.key);
34 writer.writeColon();
35 node->content.value.writeTo(writer);
36
37 node = node->next;
38 if (!node) break;
39
40 writer.writeComma();
41 }
42
43 writer.endObject();
44}
Note: See TracBrowser for help on using the repository browser.