mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 16:14:05 +01:00
Renamed IndentedPrintDecorator into IndentedPrint
This commit is contained in:
33
JsonGenerator/IndentedPrint.h
Normal file
33
JsonGenerator/IndentedPrint.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Arduino JSON library
|
||||
* Benoit Blanchon 2014 - MIT License
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Print.h"
|
||||
|
||||
class IndentedPrint : public Print
|
||||
{
|
||||
public:
|
||||
|
||||
IndentedPrint(Print& p)
|
||||
: sink(p)
|
||||
{
|
||||
level = 0;
|
||||
isNewLine = true;
|
||||
}
|
||||
|
||||
virtual size_t write(uint8_t);
|
||||
|
||||
void indent();
|
||||
void unindent();
|
||||
|
||||
private:
|
||||
Print& sink;
|
||||
uint8_t level : 7;
|
||||
bool isNewLine : 1;
|
||||
|
||||
size_t writeTabs();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user