mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Added skeleton of class IndentedPrintDecorator
This commit is contained in:
		
							
								
								
									
										11
									
								
								JsonGenerator/IndentedPrintDecorator.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								JsonGenerator/IndentedPrintDecorator.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| /* | ||||
| * Arduino JSON library | ||||
| * Benoit Blanchon 2014 - MIT License | ||||
| */ | ||||
|  | ||||
| #include "IndentedPrintDecorator.h" | ||||
|  | ||||
| size_t IndentedPrintDecorator::write(uint8_t c) | ||||
| { | ||||
|     return print.write(c); | ||||
| } | ||||
							
								
								
									
										26
									
								
								JsonGenerator/IndentedPrintDecorator.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								JsonGenerator/IndentedPrintDecorator.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| #pragma once | ||||
| /* | ||||
| * Arduino JSON library | ||||
| * Benoit Blanchon 2014 - MIT License | ||||
| */ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "Print.h" | ||||
|  | ||||
| class IndentedPrintDecorator : public Print | ||||
| { | ||||
| public: | ||||
|  | ||||
|     IndentedPrintDecorator(Print& p) | ||||
|         : currentLevel(0), print(p) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     virtual size_t write(uint8_t); | ||||
|  | ||||
| private: | ||||
|     int currentLevel; | ||||
|     Print& print; | ||||
| }; | ||||
|  | ||||
| @@ -12,6 +12,7 @@ | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClInclude Include="EscapedString.h" /> | ||||
|     <ClInclude Include="IndentedPrintDecorator.h" /> | ||||
|     <ClInclude Include="JsonArray.h" /> | ||||
|     <ClInclude Include="JsonArrayBase.h" /> | ||||
|     <ClInclude Include="JsonObject.h" /> | ||||
| @@ -24,6 +25,7 @@ | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClCompile Include="EscapedString.cpp" /> | ||||
|     <ClCompile Include="IndentedPrintDecorator.cpp" /> | ||||
|     <ClCompile Include="JsonArrayBase.cpp" /> | ||||
|     <ClCompile Include="JsonObjectBase.cpp" /> | ||||
|     <ClCompile Include="JsonValue.cpp" /> | ||||
|   | ||||
| @@ -45,6 +45,9 @@ | ||||
|     <ClInclude Include="JsonObject.h"> | ||||
|       <Filter>Header Files</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="IndentedPrintDecorator.h"> | ||||
|       <Filter>Header Files</Filter> | ||||
|     </ClInclude> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClCompile Include="EscapedString.cpp"> | ||||
| @@ -65,5 +68,8 @@ | ||||
|     <ClCompile Include="JsonObjectBase.cpp"> | ||||
|       <Filter>Source Files</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="IndentedPrintDecorator.cpp"> | ||||
|       <Filter>Source Files</Filter> | ||||
|     </ClCompile> | ||||
|   </ItemGroup> | ||||
| </Project> | ||||
		Reference in New Issue
	
	Block a user