Formated code with clang-format

This commit is contained in:
Benoit Blanchon
2014-10-23 19:54:00 +02:00
parent 888fdc1d54
commit 9175046f35
52 changed files with 2002 additions and 2638 deletions

View File

@ -8,76 +8,68 @@
using namespace ArduinoJson;
using namespace ArduinoJson::Internals;
size_t JsonContainer::printTo(char* buffer, size_t bufferSize) const
{
StringBuilder sb(buffer, bufferSize);
return printTo(sb);
size_t JsonContainer::printTo(char *buffer, size_t bufferSize) const {
StringBuilder sb(buffer, bufferSize);
return printTo(sb);
}
size_t JsonContainer::printTo(Print& p) const
{
CompactJsonWriter writer(&p);
_node->writeTo(writer);
return writer.bytesWritten();
size_t JsonContainer::printTo(Print &p) const {
CompactJsonWriter writer(&p);
_node->writeTo(writer);
return writer.bytesWritten();
}
size_t JsonContainer::prettyPrintTo(char* buffer, size_t bufferSize) const
{
StringBuilder sb(buffer, bufferSize);
return prettyPrintTo(sb);
size_t JsonContainer::prettyPrintTo(char *buffer, size_t bufferSize) const {
StringBuilder sb(buffer, bufferSize);
return prettyPrintTo(sb);
}
size_t JsonContainer::prettyPrintTo(IndentedPrint& p) const
{
PrettyJsonWriter writer(&p);
_node->writeTo(writer);
return writer.bytesWritten();
size_t JsonContainer::prettyPrintTo(IndentedPrint &p) const {
PrettyJsonWriter writer(&p);
_node->writeTo(writer);
return writer.bytesWritten();
}
size_t JsonContainer::prettyPrintTo(Print& print) const
{
IndentedPrint indentedPrint = IndentedPrint(print);
return prettyPrintTo(indentedPrint);
size_t JsonContainer::prettyPrintTo(Print &print) const {
IndentedPrint indentedPrint = IndentedPrint(print);
return prettyPrintTo(indentedPrint);
}
JsonNode* JsonContainer::createNode()
{
if (!_node) return 0;
JsonNode *JsonContainer::createNode() {
if (!_node)
return 0;
JsonBuffer* buffer = _node->getContainerBuffer();
if (!buffer) return 0;
JsonBuffer *buffer = _node->getContainerBuffer();
if (!buffer)
return 0;
return buffer->createNode();
return buffer->createNode();
}
bool JsonContainer::operator==(const JsonContainer & other) const
{
if (_node == other._node) return true;
if (!_node || !other._node) return false;
return _node->getProxyTarget() == other._node->getProxyTarget();
bool JsonContainer::operator==(const JsonContainer &other) const {
if (_node == other._node)
return true;
if (!_node || !other._node)
return false;
return _node->getProxyTarget() == other._node->getProxyTarget();
}
void JsonContainer::addChild(JsonNode* childToAdd)
{
if (_node)
_node->addChild(childToAdd);
void JsonContainer::addChild(JsonNode *childToAdd) {
if (_node)
_node->addChild(childToAdd);
}
void JsonContainer::removeChild(JsonNode* childToRemove)
{
if (_node)
_node->removeChild(childToRemove);
void JsonContainer::removeChild(JsonNode *childToRemove) {
if (_node)
_node->removeChild(childToRemove);
}
size_t JsonContainer::size() const
{
int n = 0;
size_t JsonContainer::size() const {
int n = 0;
for (JsonNodeIterator it = beginChildren(); it != endChildren(); ++it)
{
n++;
}
for (JsonNodeIterator it = beginChildren(); it != endChildren(); ++it) {
n++;
}
return n;
return n;
}