Go to the documentation of this file.
6 #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED
7 #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED
9 #ifndef NO_LOCALE_SUPPORT
21 #ifdef NO_LOCALE_SUPPORT
24 struct lconv* lc = localeconv();
25 return lc ? *(lc->decimal_point) :
'\0';
37 result[0] =
static_cast<char>(cp);
38 }
else if (cp <= 0x7FF) {
40 result[1] =
static_cast<char>(0x80 | (0x3f & cp));
41 result[0] =
static_cast<char>(0xC0 | (0x1f & (cp >> 6)));
42 }
else if (cp <= 0xFFFF) {
44 result[2] =
static_cast<char>(0x80 | (0x3f & cp));
45 result[1] =
static_cast<char>(0x80 | (0x3f & (cp >> 6)));
46 result[0] =
static_cast<char>(0xE0 | (0xf & (cp >> 12)));
47 }
else if (cp <= 0x10FFFF) {
49 result[3] =
static_cast<char>(0x80 | (0x3f & cp));
50 result[2] =
static_cast<char>(0x80 | (0x3f & (cp >> 6)));
51 result[1] =
static_cast<char>(0x80 | (0x3f & (cp >> 12)));
52 result[0] =
static_cast<char>(0xF0 | (0x7 & (cp >> 18)));
78 *--current =
static_cast<char>(value % 10U +
static_cast<unsigned>(
'0'));
99 if (decimalPoint !=
'\0' && decimalPoint !=
'.') {
100 while (begin < end) {
102 *begin = decimalPoint;
111 #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED
static JSONCPP_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.
static void fixNumericLocale(char *begin, char *end)
Change ',' to '.
char UIntToStringBuffer[uintToStringBufferSize]
@ uintToStringBufferSize
Constant that specify the size of the buffer that must be passed to uintToString.
static char getDecimalPoint()
static bool isControlCharacter(char ch)
Returns true if ch is a control character (in range [1,31]).
JSON (JavaScript Object Notation).
static void fixNumericLocaleInput(char *begin, char *end)