From aa2cd0db0027250ffaf28807ee32e3544569fe21 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Tue, 26 Aug 2014 10:16:13 +0200 Subject: [PATCH] Moved IndentedPrint into the namespace ArduinoJson::Generator --- JsonGenerator/IndentedPrint.cpp | 2 ++ JsonGenerator/IndentedPrint.h | 46 +++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 20 deletions(-) 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(); -}; +}