mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Changed ::String to ArduinoJson::String (issue #275)
				
					
				
			This commit is contained in:
		| @@ -1,6 +1,12 @@ | ||||
| ArduinoJson: change log | ||||
| ======================= | ||||
|  | ||||
| HEAD | ||||
| ---- | ||||
|  | ||||
| * Changed `::String` to `ArduinoJson::String` (issue #275) | ||||
| * Changed `::Print` to `ArduinoJson::Print` too | ||||
|  | ||||
| v5.3.0 | ||||
| ------ | ||||
|  | ||||
|   | ||||
| @@ -22,6 +22,11 @@ | ||||
| #define ARDUINOJSON_USE_INT64 0 | ||||
| #endif | ||||
|  | ||||
| // arduino has its own implementation of String to replace std::string | ||||
| #ifndef ARDUINOJSON_USE_ARDUINO_STRING | ||||
| #define ARDUINOJSON_USE_ARDUINO_STRING 1 | ||||
| #endif | ||||
|  | ||||
| // arduino doesn't support STL stream | ||||
| #ifndef ARDUINOJSON_ENABLE_STD_STREAM | ||||
| #define ARDUINOJSON_ENABLE_STD_STREAM 0 | ||||
| @@ -62,6 +67,11 @@ | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| // on a computer, we can use std::string | ||||
| #ifndef ARDUINOJSON_USE_ARDUINO_STRING | ||||
| #define ARDUINOJSON_USE_ARDUINO_STRING 0 | ||||
| #endif | ||||
|  | ||||
| // on a computer, we can assume that the STL is there | ||||
| #ifndef ARDUINOJSON_ENABLE_STD_STREAM | ||||
| #define ARDUINOJSON_ENABLE_STD_STREAM 1 | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "../Arduino/Print.hpp" | ||||
| #include "../Print.hpp" | ||||
|  | ||||
| namespace ArduinoJson { | ||||
| namespace Internals { | ||||
|   | ||||
| @@ -7,8 +7,8 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "../Arduino/Print.hpp" | ||||
| #include "../Arduino/String.hpp" | ||||
| #include "../Print.hpp" | ||||
| #include "../String.hpp" | ||||
|  | ||||
| namespace ArduinoJson { | ||||
| namespace Internals { | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "../Arduino/Print.hpp" | ||||
| #include "../Print.hpp" | ||||
|  | ||||
| namespace ArduinoJson { | ||||
| namespace Internals { | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "../Arduino/Print.hpp" | ||||
| #include "../Print.hpp" | ||||
|  | ||||
| namespace ArduinoJson { | ||||
| namespace Internals { | ||||
|   | ||||
| @@ -7,10 +7,10 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "../Arduino/Print.hpp" | ||||
| #include "../Polyfills/isNaN.hpp" | ||||
| #include "../Polyfills/isInfinity.hpp" | ||||
| #include "../Polyfills/isNaN.hpp" | ||||
| #include "../Polyfills/normalize.hpp" | ||||
| #include "../Print.hpp" | ||||
| #include "Encoding.hpp" | ||||
| #include "ForceInline.hpp" | ||||
| #include "JsonFloat.hpp" | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "../Arduino/Print.hpp" | ||||
| #include "../Print.hpp" | ||||
|  | ||||
| namespace ArduinoJson { | ||||
| namespace Internals { | ||||
|   | ||||
| @@ -11,7 +11,7 @@ | ||||
|  | ||||
| #if ARDUINOJSON_ENABLE_STD_STREAM | ||||
|  | ||||
| #include "../Arduino/Print.hpp" | ||||
| #include "../Print.hpp" | ||||
|  | ||||
| #include <ostream> | ||||
|  | ||||
|   | ||||
| @@ -11,7 +11,7 @@ | ||||
| #include <stdint.h>  // for uint8_t | ||||
| #include <string.h> | ||||
|  | ||||
| #include "Arduino/String.hpp" | ||||
| #include "String.hpp" | ||||
| #include "JsonVariant.hpp" | ||||
|  | ||||
| #if defined(__clang__) | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "Arduino/String.hpp" | ||||
| #include "String.hpp" | ||||
| #include "Internals/JsonBufferAllocated.hpp" | ||||
| #include "Internals/JsonPrintable.hpp" | ||||
| #include "Internals/List.hpp" | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "Arduino/String.hpp" | ||||
| #include "String.hpp" | ||||
|  | ||||
| namespace ArduinoJson { | ||||
|  | ||||
|   | ||||
| @@ -12,6 +12,7 @@ | ||||
| #include <stddef.h> | ||||
| #include <stdint.h> | ||||
| 
 | ||||
| namespace ArduinoJson { | ||||
| // This class reproduces Arduino's Print class
 | ||||
| class Print { | ||||
|  public: | ||||
| @@ -29,6 +30,7 @@ class Print { | ||||
| 
 | ||||
|   size_t println() { return write('\r') + write('\n'); } | ||||
| }; | ||||
| } | ||||
| 
 | ||||
| #else | ||||
| 
 | ||||
| @@ -7,13 +7,18 @@ | ||||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #ifndef ARDUINO | ||||
| #include "Configuration.hpp" | ||||
| 
 | ||||
| #include <string> | ||||
| typedef std::string String; | ||||
| 
 | ||||
| #else | ||||
| #if ARDUINOJSON_USE_ARDUINO_STRING | ||||
| 
 | ||||
| #include <WString.h> | ||||
| 
 | ||||
| #else | ||||
| 
 | ||||
| #include <string> | ||||
| 
 | ||||
| namespace ArduinoJson { | ||||
| typedef std::string String; | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
| @@ -5,8 +5,8 @@ | ||||
| // https://github.com/bblanchon/ArduinoJson | ||||
| // If you like this project, please add a star! | ||||
|  | ||||
| #include <ArduinoJson.h> | ||||
| #include <gtest/gtest.h> | ||||
| #include <ArduinoJson/Internals/StaticStringBuilder.hpp> | ||||
|  | ||||
| using namespace ArduinoJson::Internals; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user