diff --git a/srcs/Arduino/Print.h b/include/ArduinoJson/Arduino/Print.h similarity index 93% rename from srcs/Arduino/Print.h rename to include/ArduinoJson/Arduino/Print.h index e5b3381d..e55f99f0 100644 --- a/srcs/Arduino/Print.h +++ b/include/ArduinoJson/Arduino/Print.h @@ -2,29 +2,29 @@ * Arduino JSON library * Benoit Blanchon 2014 - MIT License */ - -#pragma once - -#ifndef ARDUINO - -#include -#include - -// This class reproduces Arduino's Print -class Print -{ -public: - - virtual size_t write(uint8_t) = 0; - - size_t print(const char[]); - size_t print(double, int = 2); - size_t print(long); - size_t println(); -}; - -#else - -#include - -#endif + +#pragma once + +#ifndef ARDUINO + +#include +#include + +// This class reproduces Arduino's Print +class Print +{ +public: + + virtual size_t write(uint8_t) = 0; + + size_t print(const char[]); + size_t print(double, int = 2); + size_t print(long); + size_t println(); +}; + +#else + +#include + +#endif diff --git a/srcs/Arduino/Printable.h b/include/ArduinoJson/Arduino/Printable.h similarity index 90% rename from srcs/Arduino/Printable.h rename to include/ArduinoJson/Arduino/Printable.h index 1b82b4c1..dea7d7cc 100644 --- a/srcs/Arduino/Printable.h +++ b/include/ArduinoJson/Arduino/Printable.h @@ -1,26 +1,26 @@ -/* - * Arduino JSON library - * Benoit Blanchon 2014 - MIT License - */ - -#pragma once - -#ifndef ARDUINO - -#include - -class Print; - -class Printable -{ -public: - - virtual size_t printTo(Print& p) const = 0; -}; - -#else - -#include - -#endif - +/* + * Arduino JSON library + * Benoit Blanchon 2014 - MIT License + */ + +#pragma once + +#ifndef ARDUINO + +#include + +class Print; + +class Printable +{ +public: + + virtual size_t printTo(Print& p) const = 0; +}; + +#else + +#include + +#endif + diff --git a/srcs/Internals/CompactJsonWriter.h b/include/ArduinoJson/Internals/CompactJsonWriter.h similarity index 88% rename from srcs/Internals/CompactJsonWriter.h rename to include/ArduinoJson/Internals/CompactJsonWriter.h index 8fc4f466..53911cdb 100644 --- a/srcs/Internals/CompactJsonWriter.h +++ b/include/ArduinoJson/Internals/CompactJsonWriter.h @@ -1,43 +1,43 @@ -#pragma once - -#include "../Internals/JsonWriter.h" - -class CompactJsonWriter : public JsonWriter -{ -public: - explicit CompactJsonWriter(Print* sink) - : JsonWriter(sink) - { - } - - virtual void beginArray() - { - _length += _sink->write('['); - } - - virtual void endArray() - { - _length += _sink->write(']'); - } - - virtual void writeColon() - { - _length += _sink->write(':'); - } - - virtual void writeComma() - { - _length += _sink->write(','); - } - - virtual void beginObject() - { - _length += _sink->write('{'); - } - - virtual void endObject() - { - _length += _sink->write('}'); - } -}; - +#pragma once + +#include "ArduinoJson/Internals/JsonWriter.h" + +class CompactJsonWriter : public JsonWriter +{ +public: + explicit CompactJsonWriter(Print* sink) + : JsonWriter(sink) + { + } + + virtual void beginArray() + { + _length += _sink->write('['); + } + + virtual void endArray() + { + _length += _sink->write(']'); + } + + virtual void writeColon() + { + _length += _sink->write(':'); + } + + virtual void writeComma() + { + _length += _sink->write(','); + } + + virtual void beginObject() + { + _length += _sink->write('{'); + } + + virtual void endObject() + { + _length += _sink->write('}'); + } +}; + diff --git a/srcs/Internals/EscapedString.h b/include/ArduinoJson/Internals/EscapedString.h similarity index 94% rename from srcs/Internals/EscapedString.h rename to include/ArduinoJson/Internals/EscapedString.h index 01a138e7..ea099141 100644 --- a/srcs/Internals/EscapedString.h +++ b/include/ArduinoJson/Internals/EscapedString.h @@ -1,20 +1,20 @@ /* * Arduino JSON library * Benoit Blanchon 2014 - MIT License - */ - -#pragma once - -#include "../Arduino/Print.h" - -namespace ArduinoJson -{ - namespace Internals - { - class EscapedString - { - public: - static size_t printTo(const char*, Print*); - }; - } + */ + +#pragma once + +#include "../Arduino/Print.h" + +namespace ArduinoJson +{ + namespace Internals + { + class EscapedString + { + public: + static size_t printTo(const char*, Print*); + }; + } } \ No newline at end of file diff --git a/srcs/Internals/IndentedPrint.h b/include/ArduinoJson/Internals/IndentedPrint.h similarity index 96% rename from srcs/Internals/IndentedPrint.h rename to include/ArduinoJson/Internals/IndentedPrint.h index abf65c9d..899fb915 100644 --- a/srcs/Internals/IndentedPrint.h +++ b/include/ArduinoJson/Internals/IndentedPrint.h @@ -1,53 +1,53 @@ /* * Arduino JSON library * Benoit Blanchon 2014 - MIT License -*/ - -#pragma once - -#include "../Arduino/Print.h" - -namespace ArduinoJson -{ - namespace Generator - { - // Decorator on top of Print to allow indented output. - // This class is used by JsonPrintable::prettyPrintTo() but can also be used - // for your own purpose, like logging. - class IndentedPrint : public Print - { - public: - - IndentedPrint(Print& p) - : sink(&p) - { - level = 0; - tabSize = 2; - isNewLine = true; - } - - virtual size_t write(uint8_t); - - // Adds one level of indentation - void indent(); - - // Removes one level of indentation - void unindent(); - - // Set the number of space printed for each level of indentation - void setTabSize(uint8_t n); - - private: - Print* sink; - uint8_t level : 4; - uint8_t tabSize : 3; - bool isNewLine : 1; - - size_t writeTabs(); - - static const int MAX_LEVEL = 15; // because it's only 4 bits - static const int MAX_TAB_SIZE = 7; // because it's only 3 bits - }; - } -} - +*/ + +#pragma once + +#include "../Arduino/Print.h" + +namespace ArduinoJson +{ + namespace Generator + { + // Decorator on top of Print to allow indented output. + // This class is used by JsonPrintable::prettyPrintTo() but can also be used + // for your own purpose, like logging. + class IndentedPrint : public Print + { + public: + + IndentedPrint(Print& p) + : sink(&p) + { + level = 0; + tabSize = 2; + isNewLine = true; + } + + virtual size_t write(uint8_t); + + // Adds one level of indentation + void indent(); + + // Removes one level of indentation + void unindent(); + + // Set the number of space printed for each level of indentation + void setTabSize(uint8_t n); + + private: + Print* sink; + uint8_t level : 4; + uint8_t tabSize : 3; + bool isNewLine : 1; + + size_t writeTabs(); + + static const int MAX_LEVEL = 15; // because it's only 4 bits + static const int MAX_TAB_SIZE = 7; // because it's only 3 bits + }; + } +} + diff --git a/srcs/Internals/JsonNode.h b/include/ArduinoJson/Internals/JsonNode.h similarity index 95% rename from srcs/Internals/JsonNode.h rename to include/ArduinoJson/Internals/JsonNode.h index f66ccc85..18a32deb 100644 --- a/srcs/Internals/JsonNode.h +++ b/include/ArduinoJson/Internals/JsonNode.h @@ -1,181 +1,181 @@ -#pragma once - -class JsonBuffer; -class JsonWriter; -class JsonNodeIterator; - -class JsonNode -{ - friend class JsonNodeIterator; - - enum JsonNodeType - { - JSON_UNDEFINED, - JSON_NULL, - JSON_ARRAY, - JSON_OBJECT, - JSON_KEY_VALUE, - JSON_BOOLEAN, - JSON_STRING, - JSON_LONG, - JSON_PROXY, - JSON_DOUBLE_0_DECIMALS, - JSON_DOUBLE_1_DECIMAL, - JSON_DOUBLE_2_DECIMALS, - // etc. - }; - - union JsonNodeContent - { - bool asBoolean; - double asDouble; - long asInteger; - const char* asString; - - struct - { - const char* key; - JsonNode* value; - } asKey; - - struct - { - JsonNode* child; - JsonBuffer* buffer; - } asContainer; - - struct - { - JsonNode* target; - } asProxy; - - }; - -public: - JsonNode() - : type(JSON_UNDEFINED), next(0) - { - - } - - void writeTo(JsonWriter&); // TODO: <- move in JsonNodeSerializer - - void setAsArray(JsonBuffer* buffer) - { - type = JSON_ARRAY; - content.asContainer.child = 0; - content.asContainer.buffer = buffer; - } - - void setAsBoolean(bool value) - { - type = JSON_BOOLEAN; - content.asBoolean = value; - } - - void setAsLong(int value) - { - type = JSON_LONG; - content.asInteger = value; - } - - void setAsString(char const* value) - { - type = JSON_STRING; - content.asString = value; - } - - void setAsDouble(double value, int decimals) - { - type = static_cast(JSON_DOUBLE_0_DECIMALS + decimals); - content.asDouble = value; - } - - void setAsObject(JsonBuffer* buffer) - { - type = JSON_OBJECT; - content.asContainer.child = 0; - content.asContainer.buffer = buffer; - } - - void setAsObjectKeyValue(const char* key, JsonNode* value) - { - type = JSON_KEY_VALUE; - content.asKey.key = key; - content.asKey.value = value; - } - - bool getAsBoolean() - { - return type == JSON_BOOLEAN ? content.asBoolean : false; - } - - double getAsDouble() - { - return type >= JSON_DOUBLE_0_DECIMALS ? content.asDouble : 0; - } - - long getAsInteger() - { - return type == JSON_LONG ? content.asInteger : 0; - } - - const char* getAsString() - { - return type == JSON_STRING ? content.asString : 0; - } - - JsonBuffer* getContainerBuffer() - { - if (type == JSON_PROXY) return content.asProxy.target->getContainerBuffer(); - return type == JSON_ARRAY || type == JSON_OBJECT ? content.asContainer.buffer : 0; - } - - JsonNode* getContainerChild() - { - if (type == JSON_PROXY) return content.asProxy.target->getContainerChild(); - return type == JSON_ARRAY || type == JSON_OBJECT ? content.asContainer.child : 0; - } - - const char* getAsObjectKey() - { - return type == JSON_KEY_VALUE ? content.asKey.key : 0; - } - - JsonNode* getAsObjectValue() - { - return type == JSON_KEY_VALUE ? content.asKey.value : 0; - } - - JsonNode* getProxyTarget() - { - return type == JSON_PROXY ? content.asProxy.target : this; - } - - bool isArray() - { - return type == JSON_ARRAY; - } - - void addChild(JsonNode* childToAdd); - - void removeChild(JsonNode* childToRemove); - - void duplicate(JsonNode* other); - -private: - JsonNode* next; - JsonNodeContent content; - JsonNodeType type; - - inline void writeArrayTo(JsonWriter&);// TODO: <- move in JsonNodeSerializer - inline void writeObjectTo(JsonWriter&);// TODO: <- move in JsonNodeSerializer - - void setAsProxyOfSelf(); - - void setAsProxyOf(JsonNode* target) - { - type = JSON_PROXY; - content.asProxy.target = target; - } +#pragma once + +class JsonBuffer; +class JsonWriter; +class JsonNodeIterator; + +class JsonNode +{ + friend class JsonNodeIterator; + + enum JsonNodeType + { + JSON_UNDEFINED, + JSON_NULL, + JSON_ARRAY, + JSON_OBJECT, + JSON_KEY_VALUE, + JSON_BOOLEAN, + JSON_STRING, + JSON_LONG, + JSON_PROXY, + JSON_DOUBLE_0_DECIMALS, + JSON_DOUBLE_1_DECIMAL, + JSON_DOUBLE_2_DECIMALS, + // etc. + }; + + union JsonNodeContent + { + bool asBoolean; + double asDouble; + long asInteger; + const char* asString; + + struct + { + const char* key; + JsonNode* value; + } asKey; + + struct + { + JsonNode* child; + JsonBuffer* buffer; + } asContainer; + + struct + { + JsonNode* target; + } asProxy; + + }; + +public: + JsonNode() + : type(JSON_UNDEFINED), next(0) + { + + } + + void writeTo(JsonWriter&); // TODO: <- move in JsonNodeSerializer + + void setAsArray(JsonBuffer* buffer) + { + type = JSON_ARRAY; + content.asContainer.child = 0; + content.asContainer.buffer = buffer; + } + + void setAsBoolean(bool value) + { + type = JSON_BOOLEAN; + content.asBoolean = value; + } + + void setAsLong(int value) + { + type = JSON_LONG; + content.asInteger = value; + } + + void setAsString(char const* value) + { + type = JSON_STRING; + content.asString = value; + } + + void setAsDouble(double value, int decimals) + { + type = static_cast(JSON_DOUBLE_0_DECIMALS + decimals); + content.asDouble = value; + } + + void setAsObject(JsonBuffer* buffer) + { + type = JSON_OBJECT; + content.asContainer.child = 0; + content.asContainer.buffer = buffer; + } + + void setAsObjectKeyValue(const char* key, JsonNode* value) + { + type = JSON_KEY_VALUE; + content.asKey.key = key; + content.asKey.value = value; + } + + bool getAsBoolean() + { + return type == JSON_BOOLEAN ? content.asBoolean : false; + } + + double getAsDouble() + { + return type >= JSON_DOUBLE_0_DECIMALS ? content.asDouble : 0; + } + + long getAsInteger() + { + return type == JSON_LONG ? content.asInteger : 0; + } + + const char* getAsString() + { + return type == JSON_STRING ? content.asString : 0; + } + + JsonBuffer* getContainerBuffer() + { + if (type == JSON_PROXY) return content.asProxy.target->getContainerBuffer(); + return type == JSON_ARRAY || type == JSON_OBJECT ? content.asContainer.buffer : 0; + } + + JsonNode* getContainerChild() + { + if (type == JSON_PROXY) return content.asProxy.target->getContainerChild(); + return type == JSON_ARRAY || type == JSON_OBJECT ? content.asContainer.child : 0; + } + + const char* getAsObjectKey() + { + return type == JSON_KEY_VALUE ? content.asKey.key : 0; + } + + JsonNode* getAsObjectValue() + { + return type == JSON_KEY_VALUE ? content.asKey.value : 0; + } + + JsonNode* getProxyTarget() + { + return type == JSON_PROXY ? content.asProxy.target : this; + } + + bool isArray() + { + return type == JSON_ARRAY; + } + + void addChild(JsonNode* childToAdd); + + void removeChild(JsonNode* childToRemove); + + void duplicate(JsonNode* other); + +private: + JsonNode* next; + JsonNodeContent content; + JsonNodeType type; + + inline void writeArrayTo(JsonWriter&);// TODO: <- move in JsonNodeSerializer + inline void writeObjectTo(JsonWriter&);// TODO: <- move in JsonNodeSerializer + + void setAsProxyOfSelf(); + + void setAsProxyOf(JsonNode* target) + { + type = JSON_PROXY; + content.asProxy.target = target; + } }; \ No newline at end of file diff --git a/srcs/Internals/JsonNodeIterator.h b/include/ArduinoJson/Internals/JsonNodeIterator.h similarity index 92% rename from srcs/Internals/JsonNodeIterator.h rename to include/ArduinoJson/Internals/JsonNodeIterator.h index c9f6774a..f0676687 100644 --- a/srcs/Internals/JsonNodeIterator.h +++ b/include/ArduinoJson/Internals/JsonNodeIterator.h @@ -1,37 +1,37 @@ -#pragma once - -#include "JsonNode.h" - -class JsonNodeIterator -{ -public: - - explicit JsonNodeIterator(JsonNode* node) - : node(node) - { - } - - bool operator!= (const JsonNodeIterator& other) const - { - return node != other.node; - } - - void operator++() - { - node = node->next; - } - - JsonNode* operator*() const - { - return node; - } - - JsonNode* operator->() const - { - return node; - } - -private: - JsonNode* node; -}; - +#pragma once + +#include "JsonNode.h" + +class JsonNodeIterator +{ +public: + + explicit JsonNodeIterator(JsonNode* node) + : node(node) + { + } + + bool operator!= (const JsonNodeIterator& other) const + { + return node != other.node; + } + + void operator++() + { + node = node->next; + } + + JsonNode* operator*() const + { + return node; + } + + JsonNode* operator->() const + { + return node; + } + +private: + JsonNode* node; +}; + diff --git a/srcs/Internals/JsonNodeWrapper.h b/include/ArduinoJson/Internals/JsonNodeWrapper.h similarity index 92% rename from srcs/Internals/JsonNodeWrapper.h rename to include/ArduinoJson/Internals/JsonNodeWrapper.h index 522e0735..4447afd2 100644 --- a/srcs/Internals/JsonNodeWrapper.h +++ b/include/ArduinoJson/Internals/JsonNodeWrapper.h @@ -1,37 +1,37 @@ -#pragma once - -#include "JsonNode.h" -class JsonValue; - -class JsonNodeWrapper -{ - friend JsonValue; - -public: - JsonNodeWrapper() - : _node(0) - { - } - - explicit JsonNodeWrapper(JsonNode* node) - : _node(node) - { - } - -protected: - - void duplicate(const JsonNodeWrapper& other) - { - if (!_node) - { - _node = other._node; - } - else - { - _node->duplicate(other._node); - } - } - - JsonNode* _node; -}; - +#pragma once + +#include "JsonNode.h" +class JsonValue; + +class JsonNodeWrapper +{ + friend JsonValue; + +public: + JsonNodeWrapper() + : _node(0) + { + } + + explicit JsonNodeWrapper(JsonNode* node) + : _node(node) + { + } + +protected: + + void duplicate(const JsonNodeWrapper& other) + { + if (!_node) + { + _node = other._node; + } + else + { + _node->duplicate(other._node); + } + } + + JsonNode* _node; +}; + diff --git a/srcs/Internals/JsonParser.h b/include/ArduinoJson/Internals/JsonParser.h similarity index 100% rename from srcs/Internals/JsonParser.h rename to include/ArduinoJson/Internals/JsonParser.h diff --git a/srcs/Internals/JsonWriter.h b/include/ArduinoJson/Internals/JsonWriter.h similarity index 94% rename from srcs/Internals/JsonWriter.h rename to include/ArduinoJson/Internals/JsonWriter.h index f1ce846c..bea6540f 100644 --- a/srcs/Internals/JsonWriter.h +++ b/include/ArduinoJson/Internals/JsonWriter.h @@ -1,49 +1,49 @@ -#pragma once - -#include "../Arduino/Print.h" - -class JsonWriter -{ -public: - explicit JsonWriter(Print* sink) - : _sink(sink), _length(0) - { - } - - size_t bytesWritten() - { - return _length; - } - - virtual void beginArray() = 0; - - virtual void endArray() = 0; - - virtual void beginObject() = 0; - - virtual void endObject() = 0; - - void writeString(const char* value); - void writeInteger(long value); - void writeBoolean(bool value); - void writeDouble(double value, int decimals); - - virtual void writeColon() = 0; - - virtual void writeComma() = 0; - - void writeEmptyArray() - { - _length += _sink->print("[]"); - } - - void writeEmptyObject() - { - _length += _sink->print("{}"); - } - -protected: - Print* _sink; - size_t _length; -}; - +#pragma once + +#include "../Arduino/Print.h" + +class JsonWriter +{ +public: + explicit JsonWriter(Print* sink) + : _sink(sink), _length(0) + { + } + + size_t bytesWritten() + { + return _length; + } + + virtual void beginArray() = 0; + + virtual void endArray() = 0; + + virtual void beginObject() = 0; + + virtual void endObject() = 0; + + void writeString(const char* value); + void writeInteger(long value); + void writeBoolean(bool value); + void writeDouble(double value, int decimals); + + virtual void writeColon() = 0; + + virtual void writeComma() = 0; + + void writeEmptyArray() + { + _length += _sink->print("[]"); + } + + void writeEmptyObject() + { + _length += _sink->print("{}"); + } + +protected: + Print* _sink; + size_t _length; +}; + diff --git a/srcs/Internals/PrettyJsonWriter.h b/include/ArduinoJson/Internals/PrettyJsonWriter.h similarity index 94% rename from srcs/Internals/PrettyJsonWriter.h rename to include/ArduinoJson/Internals/PrettyJsonWriter.h index 8452c8ba..bdc97553 100644 --- a/srcs/Internals/PrettyJsonWriter.h +++ b/include/ArduinoJson/Internals/PrettyJsonWriter.h @@ -1,65 +1,65 @@ -#pragma once - -#include "JsonWriter.h" -#include "IndentedPrint.h" - -using namespace ArduinoJson::Generator; - -class PrettyJsonWriter : public JsonWriter -{ -public: - explicit PrettyJsonWriter(IndentedPrint* sink) - : JsonWriter(sink), _indenter(sink) - { - } - - virtual void beginArray() - { - _length += _sink->write('['); - indent(); - } - - virtual void endArray() - { - unindent(); - _length += _sink->write(']'); - } - - virtual void writeColon() - { - _length += _sink->print(": "); - } - - virtual void writeComma() - { - _length += _sink->write(','); - _length += _indenter->println(); - } - - virtual void beginObject() - { - _length += _sink->write('{'); - indent(); - } - - virtual void endObject() - { - unindent(); - _length += _sink->write('}'); - } - -private: - IndentedPrint* _indenter; - - void indent() - { - _indenter->indent(); - _length += _indenter->println(); - } - - void unindent() - { - _length += _indenter->println(); - _indenter->unindent(); - } -}; +#pragma once + +#include "JsonWriter.h" +#include "IndentedPrint.h" + +using namespace ArduinoJson::Generator; + +class PrettyJsonWriter : public JsonWriter +{ +public: + explicit PrettyJsonWriter(IndentedPrint* sink) + : JsonWriter(sink), _indenter(sink) + { + } + + virtual void beginArray() + { + _length += _sink->write('['); + indent(); + } + + virtual void endArray() + { + unindent(); + _length += _sink->write(']'); + } + + virtual void writeColon() + { + _length += _sink->print(": "); + } + + virtual void writeComma() + { + _length += _sink->write(','); + _length += _indenter->println(); + } + + virtual void beginObject() + { + _length += _sink->write('{'); + indent(); + } + + virtual void endObject() + { + unindent(); + _length += _sink->write('}'); + } + +private: + IndentedPrint* _indenter; + + void indent() + { + _indenter->indent(); + _length += _indenter->println(); + } + + void unindent() + { + _length += _indenter->println(); + _indenter->unindent(); + } +}; diff --git a/srcs/Internals/StringBuilder.h b/include/ArduinoJson/Internals/StringBuilder.h similarity index 94% rename from srcs/Internals/StringBuilder.h rename to include/ArduinoJson/Internals/StringBuilder.h index 47a23337..fc62167b 100644 --- a/srcs/Internals/StringBuilder.h +++ b/include/ArduinoJson/Internals/StringBuilder.h @@ -1,31 +1,31 @@ -/* - * Arduino JSON library - * Benoit Blanchon 2014 - MIT License - */ - -#pragma once - -#include "../Arduino/Print.h" - -namespace ArduinoJson -{ - namespace Internals - { - class StringBuilder : public Print - { - public: - StringBuilder(char* buf, int size) - : buffer(buf), capacity(size - 1), length(0) - { - buffer[0] = 0; - } - - virtual size_t write(uint8_t c); - - private: - char* buffer; - int capacity; - int length; - }; - } +/* + * Arduino JSON library + * Benoit Blanchon 2014 - MIT License + */ + +#pragma once + +#include "../Arduino/Print.h" + +namespace ArduinoJson +{ + namespace Internals + { + class StringBuilder : public Print + { + public: + StringBuilder(char* buf, int size) + : buffer(buf), capacity(size - 1), length(0) + { + buffer[0] = 0; + } + + virtual size_t write(uint8_t c); + + private: + char* buffer; + int capacity; + int length; + }; + } } \ No newline at end of file diff --git a/srcs/JsonArray.h b/include/ArduinoJson/JsonArray.h similarity index 95% rename from srcs/JsonArray.h rename to include/ArduinoJson/JsonArray.h index 27d8cd49..ffe770f0 100644 --- a/srcs/JsonArray.h +++ b/include/ArduinoJson/JsonArray.h @@ -1,34 +1,34 @@ -#pragma once - -#include "JsonContainer.h" - -class JsonArray : public JsonContainer -{ -public: - JsonArray() - { - } - - explicit JsonArray(JsonNode* node) - : JsonContainer(node) - { - } - - JsonValue operator[](int index) const; - - void add(bool value); - void add(const char* value); - void add(double value, int decimals=2); - void add(int value) { add((long) value); } - void add(long value); - void add(JsonContainer nestedArray); // TODO: should allow JsonValue too - - JsonArray createNestedArray(); - JsonObject createNestedObject(); - - bool success() - { - return _node && _node->isArray(); - } -}; - +#pragma once + +#include "JsonContainer.h" + +class JsonArray : public JsonContainer +{ +public: + JsonArray() + { + } + + explicit JsonArray(JsonNode* node) + : JsonContainer(node) + { + } + + JsonValue operator[](int index) const; + + void add(bool value); + void add(const char* value); + void add(double value, int decimals=2); + void add(int value) { add((long) value); } + void add(long value); + void add(JsonContainer nestedArray); // TODO: should allow JsonValue too + + JsonArray createNestedArray(); + JsonObject createNestedObject(); + + bool success() + { + return _node && _node->isArray(); + } +}; + diff --git a/srcs/JsonBuffer.h b/include/ArduinoJson/JsonBuffer.h similarity index 94% rename from srcs/JsonBuffer.h rename to include/ArduinoJson/JsonBuffer.h index 092fbc5b..4dfcfe13 100644 --- a/srcs/JsonBuffer.h +++ b/include/ArduinoJson/JsonBuffer.h @@ -1,44 +1,44 @@ -#pragma once - -#include "JsonArray.h" -#include "JsonObject.h" - -class JsonParser; - -class JsonBuffer -{ - friend class JsonContainer; - friend class JsonNode; - friend class JsonParser; - -public: - virtual ~JsonBuffer() {}; - - JsonArray createArray() - { - return JsonArray(createArrayNode()); - } - - JsonObject createObject() - { - return JsonObject(createObjectNode()); - } - - JsonValue createValue(); - - JsonArray parseArray(char* string); - -protected: - virtual void* allocateNode() = 0; - -private: - JsonNode* createNode(); - - JsonNode* createArrayNode(); - JsonNode* createBoolNode(bool value); - JsonNode* createDoubleNode(double value, int decimals); - JsonNode* createLongNode(long value); - JsonNode* createObjectNode(); - JsonNode* createStringNode(const char* value); -}; - +#pragma once + +#include "JsonArray.h" +#include "JsonObject.h" + +class JsonParser; + +class JsonBuffer +{ + friend class JsonContainer; + friend class JsonNode; + friend class JsonParser; + +public: + virtual ~JsonBuffer() {}; + + JsonArray createArray() + { + return JsonArray(createArrayNode()); + } + + JsonObject createObject() + { + return JsonObject(createObjectNode()); + } + + JsonValue createValue(); + + JsonArray parseArray(char* string); + +protected: + virtual void* allocateNode() = 0; + +private: + JsonNode* createNode(); + + JsonNode* createArrayNode(); + JsonNode* createBoolNode(bool value); + JsonNode* createDoubleNode(double value, int decimals); + JsonNode* createLongNode(long value); + JsonNode* createObjectNode(); + JsonNode* createStringNode(const char* value); +}; + diff --git a/srcs/JsonContainer.h b/include/ArduinoJson/JsonContainer.h similarity index 80% rename from srcs/JsonContainer.h rename to include/ArduinoJson/JsonContainer.h index c320c5a0..a5ff0689 100644 --- a/srcs/JsonContainer.h +++ b/include/ArduinoJson/JsonContainer.h @@ -1,54 +1,55 @@ -#pragma once - -#include "Arduino/Printable.h" -#include "Internals/JsonNodeIterator.h" -#include "Internals/JsonNode.h" -#include "Internals/IndentedPrint.h" -#include "Internals/JsonNodeWrapper.h" -class JsonArray; -class JsonObject; -class JsonValue; - -class JsonContainer : public Printable, public JsonNodeWrapper -{ - // friend JsonValue; - friend JsonArray; - -public: - - - JsonContainer() {} - - explicit JsonContainer(JsonNode* node) - : JsonNodeWrapper(node) - { - } - - size_t size() const; - - bool operator==(JsonContainer const& other) const; - - size_t printTo(char* buffer, size_t bufferSize) const; - virtual size_t printTo(Print& print) const; - - size_t prettyPrintTo(char* buffer, size_t bufferSize) const; - size_t prettyPrintTo(ArduinoJson::Generator::IndentedPrint& print) const; - size_t prettyPrintTo(Print& print) const; - -protected: - - JsonNodeIterator beginChildren() const - { - return JsonNodeIterator(_node ? _node->getContainerChild() : 0); - } - - JsonNodeIterator endChildren() const - { - return JsonNodeIterator(0); - } - - void addChild(JsonNode*); - void removeChild(JsonNode*); - JsonNode* createNode(); -}; - +#pragma once + +#include "ArduinoJson/Arduino/Printable.h" +#include "ArduinoJson/Internals/JsonNodeIterator.h" +#include "ArduinoJson/Internals/JsonNode.h" +#include "ArduinoJson/Internals/IndentedPrint.h" +#include "ArduinoJson/Internals/JsonNodeWrapper.h" + +class JsonArray; +class JsonObject; +class JsonValue; + +class JsonContainer : public Printable, public JsonNodeWrapper +{ + // friend JsonValue; + friend JsonArray; + +public: + + + JsonContainer() {} + + explicit JsonContainer(JsonNode* node) + : JsonNodeWrapper(node) + { + } + + size_t size() const; + + bool operator==(JsonContainer const& other) const; + + size_t printTo(char* buffer, size_t bufferSize) const; + virtual size_t printTo(Print& print) const; + + size_t prettyPrintTo(char* buffer, size_t bufferSize) const; + size_t prettyPrintTo(ArduinoJson::Generator::IndentedPrint& print) const; + size_t prettyPrintTo(Print& print) const; + +protected: + + JsonNodeIterator beginChildren() const + { + return JsonNodeIterator(_node ? _node->getContainerChild() : 0); + } + + JsonNodeIterator endChildren() const + { + return JsonNodeIterator(0); + } + + void addChild(JsonNode*); + void removeChild(JsonNode*); + JsonNode* createNode(); +}; + diff --git a/srcs/JsonObject.h b/include/ArduinoJson/JsonObject.h similarity index 94% rename from srcs/JsonObject.h rename to include/ArduinoJson/JsonObject.h index da8bad8d..23f94001 100644 --- a/srcs/JsonObject.h +++ b/include/ArduinoJson/JsonObject.h @@ -1,26 +1,26 @@ -#pragma once - -#include "JsonContainer.h" - -class JsonObject : public JsonContainer -{ -public: - - JsonObject() - { - } - - explicit JsonObject(JsonNode* node) - : JsonContainer(node) - { - } - - JsonValue operator[](const char* key); - void remove(const char* key); - - JsonArray createNestedArray(const char* key); - JsonObject createNestedObject(const char* key); - -private: - JsonNode* getOrCreateNodeAt(const char* key); +#pragma once + +#include "JsonContainer.h" + +class JsonObject : public JsonContainer +{ +public: + + JsonObject() + { + } + + explicit JsonObject(JsonNode* node) + : JsonContainer(node) + { + } + + JsonValue operator[](const char* key); + void remove(const char* key); + + JsonArray createNestedArray(const char* key); + JsonObject createNestedObject(const char* key); + +private: + JsonNode* getOrCreateNodeAt(const char* key); }; \ No newline at end of file diff --git a/srcs/JsonValue.h b/include/ArduinoJson/JsonValue.h similarity index 95% rename from srcs/JsonValue.h rename to include/ArduinoJson/JsonValue.h index 9ad98acd..2eb7c078 100644 --- a/srcs/JsonValue.h +++ b/include/ArduinoJson/JsonValue.h @@ -1,36 +1,36 @@ -#pragma once - -#include "Internals/JsonNodeWrapper.h" - -class JsonArray; -class JsonContainer; -class JsonObject; - -class JsonValue : public JsonNodeWrapper -{ -public: - - JsonValue() {} - - explicit JsonValue(JsonNode* node) - : JsonNodeWrapper(node) - { - } - - void operator=(bool); - void operator=(const char*); - void operator=(double x) { set(x, 2); } - void operator=(int); - void operator=(const JsonValue& value) { duplicate(value); } - void operator=(const JsonNodeWrapper& object) { duplicate(object); } - - operator bool() const; - operator const char*() const; - operator double() const; - operator long() const; - operator int() const { return operator long(); } - operator JsonArray() const; - operator JsonObject() const; - - void set(double value, int decimals); +#pragma once + +#include "Internals/JsonNodeWrapper.h" + +class JsonArray; +class JsonContainer; +class JsonObject; + +class JsonValue : public JsonNodeWrapper +{ +public: + + JsonValue() {} + + explicit JsonValue(JsonNode* node) + : JsonNodeWrapper(node) + { + } + + void operator=(bool); + void operator=(const char*); + void operator=(double x) { set(x, 2); } + void operator=(int); + void operator=(const JsonValue& value) { duplicate(value); } + void operator=(const JsonNodeWrapper& object) { duplicate(object); } + + operator bool() const; + operator const char*() const; + operator double() const; + operator long() const; + operator int() const { return operator long(); } + operator JsonArray() const; + operator JsonObject() const; + + void set(double value, int decimals); }; \ No newline at end of file diff --git a/srcs/StaticJsonBuffer.h b/include/ArduinoJson/StaticJsonBuffer.h similarity index 93% rename from srcs/StaticJsonBuffer.h rename to include/ArduinoJson/StaticJsonBuffer.h index 7a904d1e..c3e9ee64 100644 --- a/srcs/StaticJsonBuffer.h +++ b/include/ArduinoJson/StaticJsonBuffer.h @@ -1,42 +1,42 @@ -#pragma once - -#include "JsonBuffer.h" -#include "JsonObject.h" - -template -class StaticJsonBuffer : public JsonBuffer -{ - friend JsonObject; - -public: - - explicit StaticJsonBuffer() - : _size(0) - { - } - - virtual ~StaticJsonBuffer() {} - - int capacity() - { - return CAPACITY; - } - - int size() - { - return _size; - } - -protected: - virtual void* allocateNode() - { - if (_size >= CAPACITY) return 0; - - return &_buffer[_size++]; - } - -private: - JsonNode _buffer[CAPACITY]; - int _size; -}; - +#pragma once + +#include "JsonBuffer.h" +#include "JsonObject.h" + +template +class StaticJsonBuffer : public JsonBuffer +{ + friend JsonObject; + +public: + + explicit StaticJsonBuffer() + : _size(0) + { + } + + virtual ~StaticJsonBuffer() {} + + int capacity() + { + return CAPACITY; + } + + int size() + { + return _size; + } + +protected: + virtual void* allocateNode() + { + if (_size >= CAPACITY) return 0; + + return &_buffer[_size++]; + } + +private: + JsonNode _buffer[CAPACITY]; + int _size; +}; + diff --git a/srcs/Arduino/Print.cpp b/srcs/Arduino/Print.cpp index daa26b43..664178cc 100644 --- a/srcs/Arduino/Print.cpp +++ b/srcs/Arduino/Print.cpp @@ -1,13 +1,13 @@ -/* - * Arduino JSON library - * Benoit Blanchon 2014 - MIT License - */ - -#ifndef ARDUINO - -#include "Print.h" +/* + * Arduino JSON library + * Benoit Blanchon 2014 - MIT License + */ + +#ifndef ARDUINO + +#include "ArduinoJson/Arduino/Print.h" #include - + size_t Print::print(const char s[]) { size_t n = 0; diff --git a/srcs/CMakeLists.txt b/srcs/CMakeLists.txt index 63733a2e..36b669f1 100644 --- a/srcs/CMakeLists.txt +++ b/srcs/CMakeLists.txt @@ -1,3 +1,6 @@ -file(GLOB_RECURSE SRCS_FILES *.cpp *.h) +file(GLOB_RECURSE INC_FILES ../include/*.h) +file(GLOB_RECURSE SRC_FILES *.cpp) -add_library(ArduinoJson ${SRCS_FILES}) \ No newline at end of file +include_directories(../include) + +add_library(ArduinoJson ${SRC_FILES} ${INC_FILES}) \ No newline at end of file diff --git a/srcs/Internals/CompactJsonWriter.cpp b/srcs/Internals/CompactJsonWriter.cpp index 18c74747..a0f68a4d 100644 --- a/srcs/Internals/CompactJsonWriter.cpp +++ b/srcs/Internals/CompactJsonWriter.cpp @@ -1 +1 @@ -#include "CompactJsonWriter.h" +#include "ArduinoJson/Internals/CompactJsonWriter.h" diff --git a/srcs/Internals/EscapedString.cpp b/srcs/Internals/EscapedString.cpp index 0472c9a4..e4bc4231 100644 --- a/srcs/Internals/EscapedString.cpp +++ b/srcs/Internals/EscapedString.cpp @@ -1,9 +1,9 @@ -/* - * Arduino JSON library - * Benoit Blanchon 2014 - MIT License - */ +/* + * Arduino JSON library + * Benoit Blanchon 2014 - MIT License + */ -#include "EscapedString.h" +#include "ArduinoJson/Internals/EscapedString.h" using namespace ArduinoJson::Internals; diff --git a/srcs/Internals/IndentedPrint.cpp b/srcs/Internals/IndentedPrint.cpp index 6a2f3dc2..86c36529 100644 --- a/srcs/Internals/IndentedPrint.cpp +++ b/srcs/Internals/IndentedPrint.cpp @@ -1,4 +1,4 @@ -#include "IndentedPrint.h" +#include "ArduinoJson/Internals/IndentedPrint.h" using namespace ArduinoJson::Generator; diff --git a/srcs/Internals/JsonNode.cpp b/srcs/Internals/JsonNode.cpp index 216220d2..2dab693c 100644 --- a/srcs/Internals/JsonNode.cpp +++ b/srcs/Internals/JsonNode.cpp @@ -1,9 +1,9 @@ -#include "JsonNode.h" +#include "ArduinoJson/Internals/JsonNode.h" -#include "JsonWriter.h" -#include "../JsonArray.h" -#include "../JsonObject.h" -#include "../JsonBuffer.h" +#include "ArduinoJson/Internals/JsonWriter.h" +#include "ArduinoJson/JsonArray.h" +#include "ArduinoJson/JsonObject.h" +#include "ArduinoJson/JsonBuffer.h" void JsonNode::writeTo(JsonWriter& writer) { diff --git a/srcs/Internals/JsonParser.cpp b/srcs/Internals/JsonParser.cpp index 07c2a698..04e360c7 100644 --- a/srcs/Internals/JsonParser.cpp +++ b/srcs/Internals/JsonParser.cpp @@ -1,5 +1,5 @@ -#include "JsonParser.h" -#include "../JsonBuffer.h" +#include "ArduinoJson/Internals/JsonParser.h" +#include "ArduinoJson/JsonBuffer.h" #include // for strtol, strtod #include diff --git a/srcs/Internals/JsonWriter.cpp b/srcs/Internals/JsonWriter.cpp index d564d9e7..185c1a74 100644 --- a/srcs/Internals/JsonWriter.cpp +++ b/srcs/Internals/JsonWriter.cpp @@ -1,5 +1,5 @@ -#include "JsonWriter.h" -#include "EscapedString.h" +#include "ArduinoJson/Internals/JsonWriter.h" +#include "ArduinoJson/Internals/EscapedString.h" using namespace ArduinoJson::Internals; diff --git a/srcs/Internals/PrettyJsonWriter.cpp b/srcs/Internals/PrettyJsonWriter.cpp index 7965d675..bee97566 100644 --- a/srcs/Internals/PrettyJsonWriter.cpp +++ b/srcs/Internals/PrettyJsonWriter.cpp @@ -1 +1 @@ -#include "PrettyJsonWriter.h" +#include "ArduinoJson/Internals/PrettyJsonWriter.h" diff --git a/srcs/Internals/StringBuilder.cpp b/srcs/Internals/StringBuilder.cpp index debf4fd7..23f9eb57 100644 --- a/srcs/Internals/StringBuilder.cpp +++ b/srcs/Internals/StringBuilder.cpp @@ -1,9 +1,9 @@ -/* - * Arduino JSON library - * Benoit Blanchon 2014 - MIT License +/* + * Arduino JSON library + * Benoit Blanchon 2014 - MIT License */ -#include "StringBuilder.h" +#include "ArduinoJson/Internals/StringBuilder.h" using namespace ArduinoJson::Internals; diff --git a/srcs/JsonArray.cpp b/srcs/JsonArray.cpp index bd7d2dd1..7e7a9534 100644 --- a/srcs/JsonArray.cpp +++ b/srcs/JsonArray.cpp @@ -1,7 +1,6 @@ -#include "JsonArray.h" - -#include "JsonObject.h" -#include "JsonValue.h" +#include "ArduinoJson/JsonArray.h" +#include "ArduinoJson/JsonObject.h" +#include "ArduinoJson/JsonValue.h" JsonValue JsonArray::operator[](int index) const { diff --git a/srcs/JsonBuffer.cpp b/srcs/JsonBuffer.cpp index bc964c6f..217c6321 100644 --- a/srcs/JsonBuffer.cpp +++ b/srcs/JsonBuffer.cpp @@ -1,10 +1,10 @@ -#include "JsonBuffer.h" +#include "ArduinoJson/JsonBuffer.h" #include -#include "JsonValue.h" -#include "Internals/JsonParser.h" -#include "Internals/JsonNode.h" +#include "ArduinoJson/JsonValue.h" +#include "ArduinoJson/Internals/JsonParser.h" +#include "ArduinoJson/Internals/JsonNode.h" JsonValue JsonBuffer::createValue() { diff --git a/srcs/JsonContainer.cpp b/srcs/JsonContainer.cpp index 00524d7f..323ca050 100644 --- a/srcs/JsonContainer.cpp +++ b/srcs/JsonContainer.cpp @@ -1,9 +1,9 @@ -#include "JsonContainer.h" +#include "ArduinoJson/JsonContainer.h" -#include "JsonBuffer.h" -#include "Internals/StringBuilder.h" -#include "Internals/CompactJsonWriter.h" -#include "Internals/PrettyJsonWriter.h" +#include "ArduinoJson/JsonBuffer.h" +#include "ArduinoJson/Internals/StringBuilder.h" +#include "ArduinoJson/Internals/CompactJsonWriter.h" +#include "ArduinoJson/Internals/PrettyJsonWriter.h" using namespace ArduinoJson::Internals; diff --git a/srcs/JsonObject.cpp b/srcs/JsonObject.cpp index f02c366d..a7173972 100644 --- a/srcs/JsonObject.cpp +++ b/srcs/JsonObject.cpp @@ -1,12 +1,12 @@ -#include "JsonObject.h" +#include "ArduinoJson/JsonObject.h" #include // for strcmp -#include "JsonBuffer.h" -#include "JsonValue.h" -#include "Internals/EscapedString.h" -#include "Internals/JsonNode.h" -#include "Internals/StringBuilder.h" +#include "ArduinoJson/JsonBuffer.h" +#include "ArduinoJson/JsonValue.h" +#include "ArduinoJson/Internals/EscapedString.h" +#include "ArduinoJson/Internals/JsonNode.h" +#include "ArduinoJson/Internals/StringBuilder.h" using namespace ArduinoJson::Internals; diff --git a/srcs/JsonValue.cpp b/srcs/JsonValue.cpp index 61093fac..7cb6e105 100644 --- a/srcs/JsonValue.cpp +++ b/srcs/JsonValue.cpp @@ -1,8 +1,8 @@ -#include "JsonValue.h" +#include "ArduinoJson/JsonValue.h" -#include "JsonArray.h" -#include "JsonObject.h" -#include "Internals/JsonNode.h" +#include "ArduinoJson/JsonArray.h" +#include "ArduinoJson/JsonObject.h" +#include "ArduinoJson/Internals/JsonNode.h" void JsonValue::operator=(bool value) { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d1a8c667..4f140ead 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,14 +1,16 @@ set(GTEST_DIR ../third-party/gtest-1.7.0) +file(GLOB_RECURSE INC_FILES ../include/*.h) file(GLOB TESTS_FILES *.cpp) include_directories( - ../srcs + ../include ${GTEST_DIR} ${GTEST_DIR}/include) add_executable(ArduinoJsonTests ${TESTS_FILES} + ${INC_FILES} ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) diff --git a/tests/EscapedStringTests.cpp b/tests/EscapedStringTests.cpp index 58f13578..04de670b 100644 --- a/tests/EscapedStringTests.cpp +++ b/tests/EscapedStringTests.cpp @@ -1,7 +1,7 @@ #include -#include -#include +#include +#include using namespace ArduinoJson::Internals; diff --git a/tests/Issue10.cpp b/tests/Issue10.cpp index e958f1f2..3bf04c4b 100644 --- a/tests/Issue10.cpp +++ b/tests/Issue10.cpp @@ -1,8 +1,8 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include using namespace ArduinoJson::Generator; diff --git a/tests/JsonArray_Container_Tests.cpp b/tests/JsonArray_Container_Tests.cpp index 2b9438c1..03042397 100644 --- a/tests/JsonArray_Container_Tests.cpp +++ b/tests/JsonArray_Container_Tests.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include class JsonArray_Container_Tests : public ::testing::Test { diff --git a/tests/JsonArray_Parser_Tests.cpp b/tests/JsonArray_Parser_Tests.cpp index e7929fbd..0b45ab8c 100644 --- a/tests/JsonArray_Parser_Tests.cpp +++ b/tests/JsonArray_Parser_Tests.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include class JsonArray_Parser_Tests : public testing::Test { diff --git a/tests/JsonArray_PrettyPrintTo_Tests.cpp b/tests/JsonArray_PrettyPrintTo_Tests.cpp index 46834498..a61432f2 100644 --- a/tests/JsonArray_PrettyPrintTo_Tests.cpp +++ b/tests/JsonArray_PrettyPrintTo_Tests.cpp @@ -4,10 +4,10 @@ */ #include -#include -#include -#include -#include +#include +#include +#include +#include class JsonArray_PrettyPrintTo_Tests : public testing::Test { diff --git a/tests/JsonArray_PrintTo_Tests.cpp b/tests/JsonArray_PrintTo_Tests.cpp index 3f22fc7b..57e6434c 100644 --- a/tests/JsonArray_PrintTo_Tests.cpp +++ b/tests/JsonArray_PrintTo_Tests.cpp @@ -4,9 +4,9 @@ */ #include -#include -#include -#include +#include +#include +#include class JsonArray_PrintTo_Tests : public testing::Test { diff --git a/tests/JsonObject_Container_Tests.cpp b/tests/JsonObject_Container_Tests.cpp index 0da4d493..5234df82 100644 --- a/tests/JsonObject_Container_Tests.cpp +++ b/tests/JsonObject_Container_Tests.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include class JsonObject_Container_Tests : public ::testing::Test { diff --git a/tests/JsonObject_PrettyPrintTo_Tests.cpp b/tests/JsonObject_PrettyPrintTo_Tests.cpp index 83abbff1..f27b3fc0 100644 --- a/tests/JsonObject_PrettyPrintTo_Tests.cpp +++ b/tests/JsonObject_PrettyPrintTo_Tests.cpp @@ -4,9 +4,9 @@ */ #include -#include -#include -#include +#include +#include +#include class JsonObject_PrettyPrintTo_Tests : public testing::Test { diff --git a/tests/JsonObject_Serialization_Tests.cpp b/tests/JsonObject_Serialization_Tests.cpp index 3364be16..795a9ce6 100644 --- a/tests/JsonObject_Serialization_Tests.cpp +++ b/tests/JsonObject_Serialization_Tests.cpp @@ -1,8 +1,8 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include class JsonObject_Serialization_Tests : public testing::Test { diff --git a/tests/JsonValueTests.cpp b/tests/JsonValueTests.cpp index c9a3a98f..5d6bcb89 100644 --- a/tests/JsonValueTests.cpp +++ b/tests/JsonValueTests.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include class JsonValueTests : public ::testing::Test { diff --git a/tests/StaticJsonBufferTests.cpp b/tests/StaticJsonBufferTests.cpp index 55081099..f5061442 100644 --- a/tests/StaticJsonBufferTests.cpp +++ b/tests/StaticJsonBufferTests.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include TEST(StaticJsonBuffer, CapacityMatchTemplateParameter) { diff --git a/tests/StringBuilderTests.cpp b/tests/StringBuilderTests.cpp index cea27b4a..e0edea59 100644 --- a/tests/StringBuilderTests.cpp +++ b/tests/StringBuilderTests.cpp @@ -1,5 +1,5 @@ #include -#include +#include using namespace ArduinoJson::Internals;