mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Added namespace
This commit is contained in:
		| @@ -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; | ||||
|             } | ||||
|         }; | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -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; | ||||
|             } | ||||
|         }; | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -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; | ||||
|         }; | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -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"); | ||||
|   | ||||
| @@ -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; | ||||
|         }; | ||||
|     } | ||||
| } | ||||
| @@ -5,6 +5,8 @@ | ||||
|  | ||||
| #include "StringBuilder.h" | ||||
|  | ||||
| using namespace ArduinoJson::Generator; | ||||
|  | ||||
| size_t StringBuilder::write(uint8_t c) | ||||
| { | ||||
|     if (length >= capacity) return 0; | ||||
|   | ||||
| @@ -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; | ||||
|         }; | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include "JsonHashTable.h" | ||||
|  | ||||
| using namespace Microsoft::VisualStudio::CppUnitTestFramework; | ||||
| using namespace ArduinoJson::Generator; | ||||
|  | ||||
| namespace JsonGeneratorTests | ||||
| {		 | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include "JsonHashTable.h" | ||||
|  | ||||
| using namespace Microsoft::VisualStudio::CppUnitTestFramework; | ||||
| using namespace ArduinoJson::Generator; | ||||
|  | ||||
| namespace JsonGeneratorTests | ||||
| { | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include "JsonValue.h" | ||||
|  | ||||
| using namespace Microsoft::VisualStudio::CppUnitTestFramework; | ||||
| using namespace ArduinoJson::Generator; | ||||
|  | ||||
| namespace JsonGeneratorTests | ||||
| { | ||||
|   | ||||
| @@ -2,6 +2,7 @@ | ||||
| #include "StringBuilder.h" | ||||
|  | ||||
| using namespace Microsoft::VisualStudio::CppUnitTestFramework; | ||||
| using namespace ArduinoJson::Generator; | ||||
|  | ||||
| namespace JsonGeneratorTests | ||||
| { | ||||
|   | ||||
| @@ -5,6 +5,8 @@ | ||||
|  | ||||
| #include <JsonGenerator.h> | ||||
|  | ||||
| using namespace ArduinoJson::Generator; | ||||
|  | ||||
| void setup() | ||||
| { | ||||
|     Serial.begin(9600); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user