From 13c386c7a37a61b0f14d5a8a85202ab318ded798 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Thu, 31 Jul 2014 19:57:52 +0200 Subject: [PATCH] Moved JsonValue to namespace ArduinoJson::Generator --- JsonGenerator/JsonArray.h | 2 +- JsonGenerator/JsonArrayBase.h | 6 +++--- JsonGenerator/JsonObjectBase.h | 6 +++--- JsonGenerator/JsonValue.cpp | 2 +- JsonGenerator/JsonValue.h | 4 ++-- JsonGeneratorTests/JsonValueTests.cpp | 1 + 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/JsonGenerator/JsonArray.h b/JsonGenerator/JsonArray.h index 52e748a3..f0251fcf 100644 --- a/JsonGenerator/JsonArray.h +++ b/JsonGenerator/JsonArray.h @@ -22,7 +22,7 @@ namespace ArduinoJson } private: - Internals::JsonValue items[N]; + JsonValue items[N]; }; } } \ No newline at end of file diff --git a/JsonGenerator/JsonArrayBase.h b/JsonGenerator/JsonArrayBase.h index 40710ecb..ab1f8aee 100644 --- a/JsonGenerator/JsonArrayBase.h +++ b/JsonGenerator/JsonArrayBase.h @@ -14,7 +14,7 @@ namespace ArduinoJson class JsonArrayBase : public JsonPrintable { public: - JsonArrayBase(Internals::JsonValue* items, int capacity) + JsonArrayBase(JsonValue* items, int capacity) : items(items), capacity(capacity), count(0) { @@ -33,7 +33,7 @@ namespace ArduinoJson { if (count >= capacity) return; - Internals::JsonValue& v = items[count++]; + JsonValue& v = items[count++]; v.set(value); } @@ -42,7 +42,7 @@ namespace ArduinoJson using JsonPrintable::printTo; private: - Internals::JsonValue* items; + JsonValue* items; int capacity, count; }; } diff --git a/JsonGenerator/JsonObjectBase.h b/JsonGenerator/JsonObjectBase.h index f3e95060..e76ba7c3 100644 --- a/JsonGenerator/JsonObjectBase.h +++ b/JsonGenerator/JsonObjectBase.h @@ -26,7 +26,7 @@ namespace ArduinoJson void add(const char* key, double value) { getValue(key).set(value); - } + } using JsonPrintable::printTo; @@ -37,7 +37,7 @@ namespace ArduinoJson struct KeyValuePair { Internals::EscapedString key; - Internals::JsonValue value; + JsonValue value; }; JsonObjectBase(KeyValuePair* items, int capacity) @@ -45,7 +45,7 @@ namespace ArduinoJson { } - Internals::JsonValue& getValue(const char* key); + JsonValue& getValue(const char* key); private: KeyValuePair* items; diff --git a/JsonGenerator/JsonValue.cpp b/JsonGenerator/JsonValue.cpp index f039abb2..8c444b00 100644 --- a/JsonGenerator/JsonValue.cpp +++ b/JsonGenerator/JsonValue.cpp @@ -6,7 +6,7 @@ #include "EscapedString.h" #include "JsonValue.h" -using namespace ArduinoJson::Internals; +using namespace ArduinoJson::Generator; JsonValue JsonValue::nullInstance; diff --git a/JsonGenerator/JsonValue.h b/JsonGenerator/JsonValue.h index 85b7cfc0..56318e75 100644 --- a/JsonGenerator/JsonValue.h +++ b/JsonGenerator/JsonValue.h @@ -11,7 +11,7 @@ namespace ArduinoJson { - namespace Internals + namespace Generator { class JsonValue { @@ -76,7 +76,7 @@ namespace ArduinoJson bool asBool; long asLong; Printable* asPrintable; - EscapedString asString; + Internals::EscapedString asString; double asDouble; }; diff --git a/JsonGeneratorTests/JsonValueTests.cpp b/JsonGeneratorTests/JsonValueTests.cpp index c0cfab0a..df5505b2 100644 --- a/JsonGeneratorTests/JsonValueTests.cpp +++ b/JsonGeneratorTests/JsonValueTests.cpp @@ -8,6 +8,7 @@ #include "JsonValue.h" using namespace Microsoft::VisualStudio::CppUnitTestFramework; +using namespace ArduinoJson::Generator; using namespace ArduinoJson::Internals; namespace JsonGeneratorTests