Implement Printable

This commit is contained in:
Benoit Blanchon
2014-09-30 16:43:10 +02:00
parent 6b2705769a
commit 3243f2dc58
6 changed files with 37 additions and 35 deletions

View File

@ -9,33 +9,6 @@
using namespace ArduinoJson::Internals;
//JsonValue& JsonObject::operator[](char const* key)
//{
// addNodeAt(key, innerObject._node);
// return innerObject;
//}
//
//void JsonObject::addNodeAt(const char* key, JsonNode& node)
//{
// JsonNode& keyNode = _buffer.createNode();
// keyNode.becomeKey(key, node);
// appendChild(keyNode);
//}
//
//void JsonObject::appendChild(JsonNode& newChild)
//{
// JsonNode* lastChild = _node.asObjectNode.child;
// while (lastChild->next)
// {
// lastChild = lastChild->next;
// }
//
// if (lastChild)
// lastChild->next = &newChild;
// else
// _node.asObjectNode.child = &newChild;
//}
size_t JsonObject::size()
{
JsonNode* firstChild = _node->content.asObject.child;
@ -94,13 +67,13 @@ JsonNode* JsonObject::getOrCreateNodeAt(char const* key)
return newValueNode;
}
void JsonObject::printTo(char* buffer, size_t bufferSize) const
size_t JsonObject::printTo(char* buffer, size_t bufferSize) const
{
StringBuilder sb(buffer, bufferSize);
printTo(sb);
return printTo(sb);
}
void JsonObject::printTo(Print& p) const
size_t JsonObject::printTo(Print& p) const
{
p.print("{}");
return p.print("{}");
}