Files
ArduinoJson/JsonGenerator/IndentedPrint.h

34 lines
464 B
C
Raw Normal View History

/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
#pragma once
#include "Print.h"
class IndentedPrint : public Print
{
public:
IndentedPrint(Print& p)
: sink(p)
{
2014-08-26 09:53:32 +02:00
level = 0;
isNewLine = true;
}
2014-08-26 09:53:32 +02:00
virtual size_t write(uint8_t);
void indent();
void unindent();
private:
Print& sink;
2014-08-26 09:53:32 +02:00
uint8_t level : 7;
bool isNewLine : 1;
2014-08-26 09:53:32 +02:00
size_t writeTabs();
};