diff --git a/JsonGenerator/IndentedPrint.cpp b/JsonGenerator/IndentedPrint.cpp index 700d5f92..62072569 100644 --- a/JsonGenerator/IndentedPrint.cpp +++ b/JsonGenerator/IndentedPrint.cpp @@ -1,5 +1,7 @@ #include "IndentedPrint.h" +using namespace ArduinoJson::Generator; + void IndentedPrint::indent() { if (level<127) diff --git a/JsonGenerator/IndentedPrint.h b/JsonGenerator/IndentedPrint.h index 79ab43b9..ab1a4b08 100644 --- a/JsonGenerator/IndentedPrint.h +++ b/JsonGenerator/IndentedPrint.h @@ -7,27 +7,33 @@ #include "Print.h" -class IndentedPrint : public Print +namespace ArduinoJson { -public: - - IndentedPrint(Print& p) - : sink(p) + namespace Generator { - level = 0; - isNewLine = true; + 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(); + }; } - - virtual size_t write(uint8_t); - - void indent(); - void unindent(); - -private: - Print& sink; - uint8_t level : 7; - bool isNewLine : 1; - - size_t writeTabs(); -}; +}