Added namespace

This commit is contained in:
Benoît Blanchon
2014-07-03 13:54:27 +02:00
parent 538b15b400
commit bae5c36f41
12 changed files with 248 additions and 212 deletions

View File

@ -8,6 +8,10 @@
#include "JsonObjectBase.h"
#include "StringBuilder.h"
namespace ArduinoJson
{
namespace Generator
{
template<int N>
class JsonArray : public JsonObjectBase
{
@ -63,4 +67,5 @@ private:
return n;
}
};
}
}

View File

@ -7,6 +7,10 @@
#include "JsonObjectBase.h"
namespace ArduinoJson
{
namespace Generator
{
template<int N>
class JsonHashTable : public JsonObjectBase
{
@ -75,4 +79,5 @@ private:
return n;
}
};
}
}

View File

@ -9,6 +9,10 @@
#include "Print.h"
#include "Printable.h"
namespace ArduinoJson
{
namespace Generator
{
class JsonObjectBase : public Printable
{
public:
@ -21,4 +25,5 @@ public:
virtual size_t printTo(Print& p) const = 0;
};
}
}

View File

@ -5,6 +5,8 @@
#include "JsonValue.h"
using namespace ArduinoJson::Generator;
size_t JsonValue::printBoolTo(Print& p) const
{
return p.print(content.asBool ? "true" : "false");

View File

@ -8,6 +8,10 @@
#include "Printable.h"
#include "StringBuilder.h"
namespace ArduinoJson
{
namespace Generator
{
class JsonValue : public Printable
{
public:
@ -92,3 +96,5 @@ private:
size_t printPrintableTo(Print& p) const;
size_t printStringTo(Print& p) const;
};
}
}

View File

@ -5,6 +5,8 @@
#include "StringBuilder.h"
using namespace ArduinoJson::Generator;
size_t StringBuilder::write(uint8_t c)
{
if (length >= capacity) return 0;

View File

@ -7,6 +7,10 @@
#include "Print.h"
namespace ArduinoJson
{
namespace Generator
{
class StringBuilder : public Print
{
public:
@ -23,4 +27,5 @@ private:
int capacity;
int length;
};
}
}

View File

@ -3,6 +3,7 @@
#include "JsonHashTable.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace ArduinoJson::Generator;
namespace JsonGeneratorTests
{

View File

@ -3,6 +3,7 @@
#include "JsonHashTable.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace ArduinoJson::Generator;
namespace JsonGeneratorTests
{

View File

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

View File

@ -2,6 +2,7 @@
#include "StringBuilder.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace ArduinoJson::Generator;
namespace JsonGeneratorTests
{

View File

@ -5,6 +5,8 @@
#include <JsonGenerator.h>
using namespace ArduinoJson::Generator;
void setup()
{
Serial.begin(9600);