mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			599 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			599 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Arduino JSON library
 | |
|  * Benoit Blanchon 2014 - MIT License
 | |
|  */
 | |
| 
 | |
| #include "JsonValue.h"
 | |
| #include "JsonObjectBase.h"
 | |
| 
 | |
| void JsonValue::writeBooleanTo(StringBuilder& sb)
 | |
| {
 | |
|     sb.append(content.boolean ? "true" : "false");
 | |
| }
 | |
| 
 | |
| void JsonValue::writeNumberTo(StringBuilder& sb)
 | |
| {
 | |
|     sb.append(content.number);
 | |
| }
 | |
| 
 | |
| void JsonValue::writeObjectTo(StringBuilder& sb)
 | |
| {
 | |
|     if (content.object)
 | |
|         ((JsonObjectBase*) content.object)->writeTo(sb);
 | |
|     else
 | |
|         sb.append("null");
 | |
| }
 | |
| 
 | |
| void JsonValue::writeStringTo(StringBuilder& sb)
 | |
| {
 | |
|     sb.appendEscaped(content.string);
 | |
| } |