6 #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED
7 # define LIB_JSONCPP_JSON_TOOL_H_INCLUDED
18 static inline std::string
28 result[0] =
static_cast<char>(cp);
33 result[1] =
static_cast<char>(0x80 | (0x3f & cp));
34 result[0] =
static_cast<char>(0xC0 | (0x1f & (cp >> 6)));
36 else if (cp <= 0xFFFF)
39 result[2] =
static_cast<char>(0x80 | (0x3f & cp));
40 result[1] = 0x80 |
static_cast<char>((0x3f & (cp >> 6)));
41 result[0] = 0xE0 |
static_cast<char>((0xf & (cp >> 12)));
43 else if (cp <= 0x10FFFF)
46 result[3] =
static_cast<char>(0x80 | (0x3f & cp));
47 result[2] =
static_cast<char>(0x80 | (0x3f & (cp >> 6)));
48 result[1] =
static_cast<char>(0x80 | (0x3f & (cp >> 12)));
49 result[0] =
static_cast<char>(0xF0 | (0x7 & (cp >> 18)));
60 return ch > 0 && ch <= 0x1F;
85 *--current = char(value % 10) +
'0';
93 #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED
static std::string codePointToUTF8(unsigned int cp)
Converts a unicode code-point to UTF-8.
static void uintToString(LargestUInt value, char *¤t)
Converts an unsigned integer to string.
char UIntToStringBuffer[uintToStringBufferSize]
static bool isControlCharacter(char ch)
Returns true if ch is a control character (in range [0,32[).
JSON (JavaScript Object Notation).
Constant that specify the size of the buffer that must be passed to uintToString. ...