mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Reorganized writer classes
This commit is contained in:
		| @@ -9,15 +9,15 @@ | ||||
| #define ARDUINOJSON_ENABLE_NAN 1 | ||||
| #define ARDUINOJSON_ENABLE_INFINITY 1 | ||||
| #include <ArduinoJson/Json/TextFormatter.hpp> | ||||
| #include <ArduinoJson/Serialization/DynamicStringWriter.hpp> | ||||
| #include <ArduinoJson/Serialization/Writer.hpp> | ||||
|  | ||||
| using namespace ARDUINOJSON_NAMESPACE; | ||||
|  | ||||
| template <typename TFloat> | ||||
| void check(TFloat input, const std::string& expected) { | ||||
|   std::string output; | ||||
|   DynamicStringWriter<std::string> sb(output); | ||||
|   TextFormatter<DynamicStringWriter<std::string> > writer(sb); | ||||
|   Writer<std::string> sb(output); | ||||
|   TextFormatter<Writer<std::string> > writer(sb); | ||||
|   writer.writeFloat(input); | ||||
|   REQUIRE(writer.bytesWritten() == output.size()); | ||||
|   CHECK(expected == output); | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
| #include <catch.hpp> | ||||
|  | ||||
| #include <ArduinoJson/Json/TextFormatter.hpp> | ||||
| #include <ArduinoJson/Serialization/StaticStringWriter.hpp> | ||||
| #include <ArduinoJson/Serialization/Writers/StaticStringWriter.hpp> | ||||
|  | ||||
| using namespace ARDUINOJSON_NAMESPACE; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user