mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 20:42:24 +02:00
Added namespace
This commit is contained in:
@ -8,6 +8,10 @@
|
|||||||
#include "JsonObjectBase.h"
|
#include "JsonObjectBase.h"
|
||||||
#include "StringBuilder.h"
|
#include "StringBuilder.h"
|
||||||
|
|
||||||
|
namespace ArduinoJson
|
||||||
|
{
|
||||||
|
namespace Generator
|
||||||
|
{
|
||||||
template<int N>
|
template<int N>
|
||||||
class JsonArray : public JsonObjectBase
|
class JsonArray : public JsonObjectBase
|
||||||
{
|
{
|
||||||
@ -63,4 +67,5 @@ private:
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,10 @@
|
|||||||
|
|
||||||
#include "JsonObjectBase.h"
|
#include "JsonObjectBase.h"
|
||||||
|
|
||||||
|
namespace ArduinoJson
|
||||||
|
{
|
||||||
|
namespace Generator
|
||||||
|
{
|
||||||
template<int N>
|
template<int N>
|
||||||
class JsonHashTable : public JsonObjectBase
|
class JsonHashTable : public JsonObjectBase
|
||||||
{
|
{
|
||||||
@ -75,4 +79,5 @@ private:
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -9,6 +9,10 @@
|
|||||||
#include "Print.h"
|
#include "Print.h"
|
||||||
#include "Printable.h"
|
#include "Printable.h"
|
||||||
|
|
||||||
|
namespace ArduinoJson
|
||||||
|
{
|
||||||
|
namespace Generator
|
||||||
|
{
|
||||||
class JsonObjectBase : public Printable
|
class JsonObjectBase : public Printable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -21,4 +25,5 @@ public:
|
|||||||
|
|
||||||
virtual size_t printTo(Print& p) const = 0;
|
virtual size_t printTo(Print& p) const = 0;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include "JsonValue.h"
|
#include "JsonValue.h"
|
||||||
|
|
||||||
|
using namespace ArduinoJson::Generator;
|
||||||
|
|
||||||
size_t JsonValue::printBoolTo(Print& p) const
|
size_t JsonValue::printBoolTo(Print& p) const
|
||||||
{
|
{
|
||||||
return p.print(content.asBool ? "true" : "false");
|
return p.print(content.asBool ? "true" : "false");
|
||||||
|
@ -8,6 +8,10 @@
|
|||||||
#include "Printable.h"
|
#include "Printable.h"
|
||||||
#include "StringBuilder.h"
|
#include "StringBuilder.h"
|
||||||
|
|
||||||
|
namespace ArduinoJson
|
||||||
|
{
|
||||||
|
namespace Generator
|
||||||
|
{
|
||||||
class JsonValue : public Printable
|
class JsonValue : public Printable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -92,3 +96,5 @@ private:
|
|||||||
size_t printPrintableTo(Print& p) const;
|
size_t printPrintableTo(Print& p) const;
|
||||||
size_t printStringTo(Print& p) const;
|
size_t printStringTo(Print& p) const;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include "StringBuilder.h"
|
#include "StringBuilder.h"
|
||||||
|
|
||||||
|
using namespace ArduinoJson::Generator;
|
||||||
|
|
||||||
size_t StringBuilder::write(uint8_t c)
|
size_t StringBuilder::write(uint8_t c)
|
||||||
{
|
{
|
||||||
if (length >= capacity) return 0;
|
if (length >= capacity) return 0;
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
|
|
||||||
#include "Print.h"
|
#include "Print.h"
|
||||||
|
|
||||||
|
namespace ArduinoJson
|
||||||
|
{
|
||||||
|
namespace Generator
|
||||||
|
{
|
||||||
class StringBuilder : public Print
|
class StringBuilder : public Print
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -23,4 +27,5 @@ private:
|
|||||||
int capacity;
|
int capacity;
|
||||||
int length;
|
int length;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@
|
|||||||
#include "JsonHashTable.h"
|
#include "JsonHashTable.h"
|
||||||
|
|
||||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||||
|
using namespace ArduinoJson::Generator;
|
||||||
|
|
||||||
namespace JsonGeneratorTests
|
namespace JsonGeneratorTests
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "JsonHashTable.h"
|
#include "JsonHashTable.h"
|
||||||
|
|
||||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||||
|
using namespace ArduinoJson::Generator;
|
||||||
|
|
||||||
namespace JsonGeneratorTests
|
namespace JsonGeneratorTests
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "JsonValue.h"
|
#include "JsonValue.h"
|
||||||
|
|
||||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||||
|
using namespace ArduinoJson::Generator;
|
||||||
|
|
||||||
namespace JsonGeneratorTests
|
namespace JsonGeneratorTests
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "StringBuilder.h"
|
#include "StringBuilder.h"
|
||||||
|
|
||||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||||
|
using namespace ArduinoJson::Generator;
|
||||||
|
|
||||||
namespace JsonGeneratorTests
|
namespace JsonGeneratorTests
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include <JsonGenerator.h>
|
#include <JsonGenerator.h>
|
||||||
|
|
||||||
|
using namespace ArduinoJson::Generator;
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
Reference in New Issue
Block a user