Switched to Google coding style to match cpplint expectations

This commit is contained in:
Benoit Blanchon
2014-10-23 23:13:13 +02:00
parent 5c8283b3e4
commit b43da1e421
47 changed files with 262 additions and 308 deletions

View File

@ -3,25 +3,21 @@
using namespace ArduinoJson::Internals;
void IndentedPrint::indent() {
if (level < MAX_LEVEL)
level++;
if (level < MAX_LEVEL) level++;
}
void IndentedPrint::unindent() {
if (level > 0)
level--;
if (level > 0) level--;
}
void IndentedPrint::setTabSize(uint8_t n) {
if (n < MAX_TAB_SIZE)
tabSize = n;
if (n < MAX_TAB_SIZE) tabSize = n;
}
size_t IndentedPrint::write(uint8_t c) {
size_t n = 0;
if (isNewLine)
n += writeTabs();
if (isNewLine) n += writeTabs();
n += sink->write(c);
@ -33,8 +29,7 @@ size_t IndentedPrint::write(uint8_t c) {
inline size_t IndentedPrint::writeTabs() {
size_t n = 0;
for (int i = 0; i < level * tabSize; i++)
n += sink->write(' ');
for (int i = 0; i < level * tabSize; i++) n += sink->write(' ');
return n;
}