source: rtos_arduino/trunk/arduino_lib/libraries/ArduinoJson/include/ArduinoJson/Internals/Encoding.hpp@ 209

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

BlueMix用のフィアルを追加

File size: 761 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#pragma once
9
10#include "../Arduino/Print.hpp"
11
12namespace ArduinoJson {
13namespace Internals {
14
15class Encoding {
16 public:
17 // Optimized for code size on a 8-bit AVR
18 static char escapeChar(char c) {
19 const char *p = _escapeTable;
20 while (p[0] && p[1] != c) {
21 p += 2;
22 }
23 return p[0];
24 }
25
26 // Optimized for code size on a 8-bit AVR
27 static char unescapeChar(char c) {
28 const char *p = _escapeTable + 4;
29 for (;;) {
30 if (p[0] == '\0') return c;
31 if (p[0] == c) return p[1];
32 p += 2;
33 }
34 }
35
36 private:
37 static const char _escapeTable[];
38};
39}
40}
Note: See TracBrowser for help on using the repository browser.