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

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

BlueMix用のフィアルを追加

File size: 1.1 KB
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/Comments.hpp"
9
10inline static const char *skipCStyleComment(const char *ptr) {
11 ptr += 2;
12 for (;;) {
13 if (ptr[0] == '\0') return ptr;
14 if (ptr[0] == '*' && ptr[1] == '/') return ptr + 2;
15 ptr++;
16 }
17}
18
19inline static const char *skipCppStyleComment(const char *ptr) {
20 ptr += 2;
21 for (;;) {
22 if (ptr[0] == '\0' || ptr[0] == '\n') return ptr;
23 ptr++;
24 }
25}
26
27const char *ArduinoJson::Internals::skipSpacesAndComments(const char *ptr) {
28 for (;;) {
29 switch (ptr[0]) {
30 case ' ':
31 case '\t':
32 case '\r':
33 case '\n':
34 ptr++;
35 continue;
36 case '/':
37 switch (ptr[1]) {
38 case '*':
39 ptr = skipCStyleComment(ptr);
40 break;
41 case '/':
42 ptr = skipCppStyleComment(ptr);
43 break;
44 default:
45 return ptr;
46 }
47 break;
48 default:
49 return ptr;
50 }
51 }
52}
Note: See TracBrowser for help on using the repository browser.