NIM PC Cross Platform SDK
|
类 | |
struct | BuiltStyledStreamWriter |
class | CharReader |
class | CharReaderBuilder |
Build a CharReader implementation. 更多... | |
struct | CommentStyle |
Scoped enums are not available until C++11. 更多... | |
class | Exception |
class | FastWriter |
Outputs a Value in JSON format without formatting (not human friendly). 更多... | |
class | Features |
Configuration passed to reader and writer. This configuration object can be used to force the Reader or Writer to behave in a standard conforming way. 更多... | |
class | LogicError |
class | OurCharReader |
class | OurFeatures |
class | OurReader |
class | Path |
Experimental and untested: represents a "path" to access a node. 更多... | |
class | PathArgument |
Experimental and untested: represents an element of the "path" to access a node. 更多... | |
class | Reader |
Unserialize a JSON document into a Value. 更多... | |
class | RuntimeError |
class | SecureAllocator |
class | StaticString |
Lightweight wrapper to tag static string. 更多... | |
class | StreamWriter |
class | StreamWriterBuilder |
Build a StreamWriter implementation. 更多... | |
class | StyledStreamWriter |
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string. 更多... | |
class | StyledWriter |
Writes a Value in JSON format in a human friendly way. 更多... | |
class | Value |
Represents a JSON value. 更多... | |
class | ValueConstIterator |
const iterator for object and array value. 更多... | |
class | ValueIterator |
Iterator for object and array value. 更多... | |
class | ValueIteratorBase |
base class for Value iterators. 更多... | |
class | Writer |
Abstract class for writers. 更多... | |
类型定义 | |
using | Int = int |
using | UInt = unsigned int |
using | Int64 = int64_t |
using | UInt64 = uint64_t |
using | LargestInt = Int64 |
using | LargestUInt = UInt64 |
template<typename T > | |
using | Allocator = typename std::conditional< JSONCPP_USING_SECURE_MEMORY, SecureAllocator< T >, std::allocator< T > >::type |
using | String = std::basic_string< char, std::char_traits< char >, Allocator< char > > |
using | IStringStream = std::basic_istringstream< String::value_type, String::traits_type, String::allocator_type > |
using | OStringStream = std::basic_ostringstream< String::value_type, String::traits_type, String::allocator_type > |
using | IStream = std::istream |
using | OStream = std::ostream |
using | ArrayIndex = unsigned int |
using | CharReaderPtr = std::auto_ptr< CharReader > |
using | UIntToStringBuffer = char[uintToStringBufferSize] |
using | StreamWriterPtr = std::auto_ptr< StreamWriter > |
枚举 | |
enum | ValueType { nullValue = 0 , intValue , uintValue , realValue , stringValue , booleanValue , arrayValue , objectValue } |
Type of the value held by a Value object. 更多... | |
enum | CommentPlacement { commentBefore = 0 , commentAfterOnSameLine , commentAfter , numberOfCommentPlacement } |
enum | PrecisionType { significantDigits = 0 , decimalPlaces } |
Type of precision for formatting of real values. 更多... | |
enum | { uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 } |
函数 | |
template<typename T , typename U > | |
bool | operator== (const SecureAllocator< T > &, const SecureAllocator< U > &) |
template<typename T , typename U > | |
bool | operator!= (const SecureAllocator< T > &, const SecureAllocator< U > &) |
bool JSON_API | parseFromStream (CharReader::Factory const &, IStream &, Value *root, String *errs) |
JSON_API IStream & | operator>> (IStream &, Value &) |
Read from 'sin' into 'root'. | |
JSONCPP_NORETURN void | throwRuntimeError (String const &msg) |
used internally | |
JSONCPP_NORETURN void | throwLogicError (String const &msg) |
used internally | |
void | swap (Value &a, Value &b) |
String JSON_API | writeString (StreamWriter::Factory const &factory, Value const &root) |
Write into stringstream, then return string, for convenience. A StreamWriter will be created from the factory, used, and then deleted. | |
String JSON_API | valueToString (Int value) |
String JSON_API | valueToString (UInt value) |
String JSON_API | valueToString (LargestInt value) |
String JSON_API | valueToString (LargestUInt value) |
String JSON_API | valueToString (double value, unsigned int precision=Value::defaultRealPrecision, PrecisionType precisionType=PrecisionType::significantDigits) |
String JSON_API | valueToString (bool value) |
String JSON_API | valueToQuotedString (const char *value) |
JSON_API OStream & | operator<< (OStream &, const Value &root) |
Output using the StyledStreamWriter. | |
static char | getDecimalPoint () |
static String | codePointToUTF8 (unsigned int cp) |
Converts a unicode code-point to UTF-8. | |
static void | uintToString (LargestUInt value, char *¤t) |
template<typename Iter > | |
Iter | fixNumericLocale (Iter begin, Iter end) |
template<typename Iter > | |
void | fixNumericLocaleInput (Iter begin, Iter end) |
template<typename Iter > | |
Iter | fixZerosInTheEnd (Iter begin, Iter end) |
template<typename T > | |
static std::unique_ptr< T > | cloneUnique (const std::unique_ptr< T > &p) |
template<typename T , typename U > | |
static bool | InRange (double d, T min, U max) |
static char * | duplicateStringValue (const char *value, size_t length) |
static char * | duplicateAndPrefixStringValue (const char *value, unsigned int length) |
static void | decodePrefixedString (bool isPrefixed, char const *prefixed, unsigned *length, char const **value) |
static void | releasePrefixedStringValue (char *value) |
static void | releaseStringValue (char *value, unsigned) |
static bool | IsIntegral (double d) |
static bool | doesAnyCharRequireEscaping (char const *s, size_t n) |
static unsigned int | utf8ToCodepoint (const char *&s, const char *e) |
static String | toHex16Bit (unsigned int x) |
static void | appendRaw (String &result, unsigned ch) |
static void | appendHex (String &result, unsigned ch) |
static String | valueToQuotedStringN (const char *value, unsigned length, bool emitUTF8=false) |
变量 | |
static const char | hex2 [] |
using nim_cpp_wrapper_util::Json::Allocator = typedef typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator<T>, std::allocator<T> >::type |
using nim_cpp_wrapper_util::Json::ArrayIndex = typedef unsigned int |
using nim_cpp_wrapper_util::Json::CharReaderPtr = typedef std::auto_ptr<CharReader> |
using nim_cpp_wrapper_util::Json::Int = typedef int |
using nim_cpp_wrapper_util::Json::Int64 = typedef int64_t |
using nim_cpp_wrapper_util::Json::IStream = typedef std::istream |
using nim_cpp_wrapper_util::Json::IStringStream = typedef std::basic_istringstream<String::value_type, String::traits_type, String::allocator_type> |
using nim_cpp_wrapper_util::Json::LargestInt = typedef Int64 |
using nim_cpp_wrapper_util::Json::LargestUInt = typedef UInt64 |
using nim_cpp_wrapper_util::Json::OStream = typedef std::ostream |
using nim_cpp_wrapper_util::Json::OStringStream = typedef std::basic_ostringstream<String::value_type, String::traits_type, String::allocator_type> |
using nim_cpp_wrapper_util::Json::StreamWriterPtr = typedef std::auto_ptr<StreamWriter> |
using nim_cpp_wrapper_util::Json::String = typedef std::basic_string<char, std::char_traits<char>, Allocator<char> > |
using nim_cpp_wrapper_util::Json::UInt = typedef unsigned int |
using nim_cpp_wrapper_util::Json::UInt64 = typedef uint64_t |
using nim_cpp_wrapper_util::Json::UIntToStringBuffer = typedef char[uintToStringBufferSize] |
anonymous enum |
Type of the value held by a Value object.
|
static |
|
static |
|
static |
|
inlinestatic |
Converts a unicode code-point to UTF-8.
|
inlinestatic |
|
static |
|
inlinestatic |
|
inlinestatic |
Duplicates the specified string value.
value | Pointer to the string to duplicate. Must be zero-terminated if length is "unknown". |
length | Length of the value. if equals to unknown, then it will be computed using strlen(value). |
Iter nim_cpp_wrapper_util::Json::fixNumericLocale | ( | Iter | begin, |
Iter | end | ||
) |
Change ',' to '.' everywhere in buffer.
We had a sophisticated way, but it did not work in WinCE.
void nim_cpp_wrapper_util::Json::fixNumericLocaleInput | ( | Iter | begin, |
Iter | end | ||
) |
Iter nim_cpp_wrapper_util::Json::fixZerosInTheEnd | ( | 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 '.'.
|
inlinestatic |
|
inlinestatic |
|
static |
bool nim_cpp_wrapper_util::Json::operator!= | ( | const SecureAllocator< T > & | , |
const SecureAllocator< U > & | |||
) |
Output using the StyledStreamWriter.
bool nim_cpp_wrapper_util::Json::operator== | ( | const SecureAllocator< T > & | , |
const SecureAllocator< U > & | |||
) |
Read from 'sin' into 'root'.
Always keep comments from the input JSON.
This can be used to read a file into a particular sub-object. For example:
Result:
* { * "dir": { * "file": { * // The input stream JSON would be nested here. * } * } * } *
std::exception | on parse error. |
bool nim_cpp_wrapper_util::Json::parseFromStream | ( | CharReader::Factory const & | fact, |
IStream & | sin, | ||
Value * | root, | ||
String * | errs | ||
) |
Consume entire stream and use its begin/end. Someday we might have a real StreamReader, but for now this is convenient.
|
inlinestatic |
Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().
|
inlinestatic |
JSONCPP_NORETURN void nim_cpp_wrapper_util::Json::throwLogicError | ( | String const & | msg | ) |
used internally
JSONCPP_NORETURN void nim_cpp_wrapper_util::Json::throwRuntimeError | ( | String const & | msg | ) |
used internally
|
static |
|
inlinestatic |
Converts an unsigned integer to string.
value | Unsigned integer to convert to string |
current | Input/Output string buffer. Must have at least uintToStringBufferSize chars free. |
|
static |
String nim_cpp_wrapper_util::Json::valueToQuotedString | ( | const char * | value | ) |
|
static |
String nim_cpp_wrapper_util::Json::valueToString | ( | double | value, |
unsigned int | precision = Value::defaultRealPrecision , |
||
PrecisionType | precisionType = PrecisionType::significantDigits |
||
) |
String nim_cpp_wrapper_util::Json::valueToString | ( | LargestInt | value | ) |
String nim_cpp_wrapper_util::Json::valueToString | ( | LargestUInt | value | ) |
String nim_cpp_wrapper_util::Json::writeString | ( | StreamWriter::Factory const & | factory, |
Value const & | root | ||
) |
Write into stringstream, then return string, for convenience. A StreamWriter will be created from the factory, used, and then deleted.
|
static |