Moved JsonValue to namespace ArduinoJson::Generator

This commit is contained in:
Benoit Blanchon
2014-07-31 19:57:52 +02:00
parent 7877ee1b4c
commit 13c386c7a3
6 changed files with 11 additions and 10 deletions

View File

@ -22,7 +22,7 @@ namespace ArduinoJson
} }
private: private:
Internals::JsonValue items[N]; JsonValue items[N];
}; };
} }
} }

View File

@ -14,7 +14,7 @@ namespace ArduinoJson
class JsonArrayBase : public JsonPrintable class JsonArrayBase : public JsonPrintable
{ {
public: public:
JsonArrayBase(Internals::JsonValue* items, int capacity) JsonArrayBase(JsonValue* items, int capacity)
: items(items), capacity(capacity), count(0) : items(items), capacity(capacity), count(0)
{ {
@ -33,7 +33,7 @@ namespace ArduinoJson
{ {
if (count >= capacity) return; if (count >= capacity) return;
Internals::JsonValue& v = items[count++]; JsonValue& v = items[count++];
v.set<DIGITS>(value); v.set<DIGITS>(value);
} }
@ -42,7 +42,7 @@ namespace ArduinoJson
using JsonPrintable::printTo; using JsonPrintable::printTo;
private: private:
Internals::JsonValue* items; JsonValue* items;
int capacity, count; int capacity, count;
}; };
} }

View File

@ -37,7 +37,7 @@ namespace ArduinoJson
struct KeyValuePair struct KeyValuePair
{ {
Internals::EscapedString key; Internals::EscapedString key;
Internals::JsonValue value; JsonValue value;
}; };
JsonObjectBase(KeyValuePair* items, int capacity) JsonObjectBase(KeyValuePair* items, int capacity)
@ -45,7 +45,7 @@ namespace ArduinoJson
{ {
} }
Internals::JsonValue& getValue(const char* key); JsonValue& getValue(const char* key);
private: private:
KeyValuePair* items; KeyValuePair* items;

View File

@ -6,7 +6,7 @@
#include "EscapedString.h" #include "EscapedString.h"
#include "JsonValue.h" #include "JsonValue.h"
using namespace ArduinoJson::Internals; using namespace ArduinoJson::Generator;
JsonValue JsonValue::nullInstance; JsonValue JsonValue::nullInstance;

View File

@ -11,7 +11,7 @@
namespace ArduinoJson namespace ArduinoJson
{ {
namespace Internals namespace Generator
{ {
class JsonValue class JsonValue
{ {
@ -76,7 +76,7 @@ namespace ArduinoJson
bool asBool; bool asBool;
long asLong; long asLong;
Printable* asPrintable; Printable* asPrintable;
EscapedString asString; Internals::EscapedString asString;
double asDouble; double asDouble;
}; };

View File

@ -8,6 +8,7 @@
#include "JsonValue.h" #include "JsonValue.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework; using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace ArduinoJson::Generator;
using namespace ArduinoJson::Internals; using namespace ArduinoJson::Internals;
namespace JsonGeneratorTests namespace JsonGeneratorTests