// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include <json/config.h> #endif // Also support old flag NO_LOCALE_SUPPORT #ifdef NO_LOCALE_SUPPORT #define JSONCPP_NO_LOCALE_SUPPORT #endif #ifndef JSONCPP_NO_LOCALE_SUPPORT #include <clocale> #endif /* This header provides common string manipulation support, such as UTF-8, * portable conversion from/to string... * * It is an internal header that must not be exposed. */ namespace Json { static inline char getDecimalPoint() { … } /// Converts a unicode code-point to UTF-8. static inline String codePointToUTF8(unsigned int cp) { … } enum { … }; // Defines a char buffer for use with uintToString(). UIntToStringBuffer; /** Converts an unsigned integer to string. * @param value Unsigned integer to convert to string * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ static inline void uintToString(LargestUInt value, char*& current) { … } /** Change ',' to '.' everywhere in buffer. * * We had a sophisticated way, but it did not work in WinCE. * @see https://github.com/open-source-parsers/jsoncpp/pull/9 */ template <typename Iter> Iter fixNumericLocale(Iter begin, Iter end) { … } template <typename Iter> void fixNumericLocaleInput(Iter begin, Iter end) { … } /** * Return iterator that would be the new end of the range [begin,end), if we * were to delete zeros in the end of string, but not the last zero before '.'. */ template <typename Iter> Iter fixZerosInTheEnd(Iter begin, Iter end, unsigned int precision) { … } } // namespace Json #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED