source: rtos_arduino/trunk/arduino_lib/libraries/ArduinoJson/src/Internals/IndentedPrint.cpp@ 209

Last change on this file since 209 was 209, checked in by ertl-honda, 8 years ago

BlueMix用のフィアルを追加

File size: 582 bytes
Line 
1// Copyright Benoit Blanchon 2014-2016
2// MIT License
3//
4// Arduino JSON library
5// https://github.com/bblanchon/ArduinoJson
6// If you like this project, please add a star!
7
8#include "../../include/ArduinoJson/Internals/IndentedPrint.hpp"
9
10using namespace ArduinoJson::Internals;
11
12size_t IndentedPrint::write(uint8_t c) {
13 size_t n = 0;
14
15 if (isNewLine) n += writeTabs();
16
17 n += sink->write(c);
18
19 isNewLine = c == '\n';
20
21 return n;
22}
23
24inline size_t IndentedPrint::writeTabs() {
25 size_t n = 0;
26
27 for (int i = 0; i < level * tabSize; i++) n += sink->write(' ');
28
29 return n;
30}
Note: See TracBrowser for help on using the repository browser.