6 #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED 7 #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED 25 result[0] =
static_cast<char>(cp);
26 }
else if (cp <= 0x7FF) {
28 result[1] =
static_cast<char>(0x80 | (0x3f & cp));
29 result[0] =
static_cast<char>(0xC0 | (0x1f & (cp >> 6)));
30 }
else if (cp <= 0xFFFF) {
32 result[2] =
static_cast<char>(0x80 | (0x3f & cp));
33 result[1] =
static_cast<char>(0x80 | (0x3f & (cp >> 6)));
34 result[0] =
static_cast<char>(0xE0 | (0xf & (cp >> 12)));
35 }
else if (cp <= 0x10FFFF) {
37 result[3] =
static_cast<char>(0x80 | (0x3f & cp));
38 result[2] =
static_cast<char>(0x80 | (0x3f & (cp >> 6)));
39 result[1] =
static_cast<char>(0x80 | (0x3f & (cp >> 12)));
40 result[0] =
static_cast<char>(0xF0 | (0x7 & (cp >> 18)));
66 *--current =
static_cast<signed char>(value % 10U +
static_cast<unsigned>(
'0'));
87 #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 [1,31]).
static void fixNumericLocale(char *begin, char *end)
Change ',' to '.
JSON (JavaScript Object Notation).
Constant that specify the size of the buffer that must be passed to uintToString. ...