GraceFt v2.3
开源图形引擎 EGE(Easy Graphics Engine) 的高层封装库
 
载入中...
搜索中...
未找到
GFt::json::Value< CharT > 模板类 参考

JSON 值对象 更多...

#include <json.hpp>

Public 成员函数

 Value ()
 
 Value (bool b)
 
 Value (const Array< CharT > &a)
 
 Value (const CharT *s)
 
template<size_t N>
 Value (const CharT(&s)[N])
 
 Value (const Object< CharT > &o)
 
 Value (const StdString< CharT > &s)
 
 Value (double d)
 
Array< CharT > & asArray ()
 
const Array< CharT > & asArray () const
 
bool & asBoolean ()
 
const bool & asBoolean () const
 
const int & asInteger () const
 
double & asNumber ()
 
const double & asNumber () const
 
Object< CharT > & asObject ()
 
const Object< CharT > & asObject () const
 
StdString< CharT > & asString ()
 
const StdString< CharT > & asString () const
 
Valueat (const StdString< CharT > &key)
 
const Valueat (const StdString< CharT > &key) const
 
bool isArray () const
 
bool isBool () const
 
bool isFloat () const
 
bool isInteger () const
 
bool isNull () const
 
bool isNumber () const
 
bool isObject () const
 
bool isString () const
 
Valueoperator= (bool b)
 
Valueoperator= (const Array< CharT > &a)
 
Valueoperator= (const CharT *s)
 
template<size_t N>
Valueoperator= (const CharT(&s)[N])
 
Valueoperator= (const Object< CharT > &o)
 
Valueoperator= (const StdString< CharT > &s)
 
Valueoperator= (double d)
 
Valueoperator[] (const StdString< CharT > &key)
 
const Valueoperator[] (const StdString< CharT > &key) const
 
Valueoperator[] (size_t i)
 
const Valueoperator[] (size_t i) const
 
bool toBool () const
 
double toFloat () const
 
int toInt () const
 
const StdString< CharT > & toString () const
 
Type type () const
 获取当前 JSON 值对象持有的 JSON 值类型
 

友元

StdOStream< CharT > & operator<< (StdOStream< CharT > &os, const Value< CharT > &v)
 向流中写入 JSON 值对象
 
StdIStream< CharT > & operator>> (StdIStream< CharT > &is, Value< CharT > &v)
 从流中读取 JSON 值对象
 

详细描述

template<typename CharT>
class GFt::json::Value< CharT >

JSON 值对象

构造及析构函数说明

◆ Value() [1/8]

template<typename CharT >
GFt::json::Value< CharT >::Value ( )
inline

◆ Value() [2/8]

template<typename CharT >
GFt::json::Value< CharT >::Value ( bool b)
inline

◆ Value() [3/8]

template<typename CharT >
GFt::json::Value< CharT >::Value ( double d)
inline

◆ Value() [4/8]

template<typename CharT >
template<size_t N>
GFt::json::Value< CharT >::Value ( const CharT(&) s[N])
inline

◆ Value() [5/8]

template<typename CharT >
GFt::json::Value< CharT >::Value ( const CharT * s)
inline

◆ Value() [6/8]

template<typename CharT >
GFt::json::Value< CharT >::Value ( const StdString< CharT > & s)
inline

◆ Value() [7/8]

template<typename CharT >
GFt::json::Value< CharT >::Value ( const Array< CharT > & a)
inline

◆ Value() [8/8]

template<typename CharT >
GFt::json::Value< CharT >::Value ( const Object< CharT > & o)
inline

成员函数说明

◆ asArray() [1/2]

template<typename CharT >
Array< CharT > & GFt::json::Value< CharT >::asArray ( )
inline

◆ asArray() [2/2]

template<typename CharT >
const Array< CharT > & GFt::json::Value< CharT >::asArray ( ) const
inline

◆ asBoolean() [1/2]

template<typename CharT >
bool & GFt::json::Value< CharT >::asBoolean ( )
inline

◆ asBoolean() [2/2]

template<typename CharT >
const bool & GFt::json::Value< CharT >::asBoolean ( ) const
inline

◆ asInteger()

template<typename CharT >
const int & GFt::json::Value< CharT >::asInteger ( ) const
inline

◆ asNumber() [1/2]

template<typename CharT >
double & GFt::json::Value< CharT >::asNumber ( )
inline

◆ asNumber() [2/2]

template<typename CharT >
const double & GFt::json::Value< CharT >::asNumber ( ) const
inline

◆ asObject() [1/2]

template<typename CharT >
Object< CharT > & GFt::json::Value< CharT >::asObject ( )
inline

◆ asObject() [2/2]

template<typename CharT >
const Object< CharT > & GFt::json::Value< CharT >::asObject ( ) const
inline

◆ asString() [1/2]

template<typename CharT >
StdString< CharT > & GFt::json::Value< CharT >::asString ( )
inline

◆ asString() [2/2]

template<typename CharT >
const StdString< CharT > & GFt::json::Value< CharT >::asString ( ) const
inline

◆ at() [1/2]

template<typename CharT >
Value & GFt::json::Value< CharT >::at ( const StdString< CharT > & key)
inline

◆ at() [2/2]

template<typename CharT >
const Value & GFt::json::Value< CharT >::at ( const StdString< CharT > & key) const
inline

◆ isArray()

template<typename CharT >
bool GFt::json::Value< CharT >::isArray ( ) const
inline

◆ isBool()

template<typename CharT >
bool GFt::json::Value< CharT >::isBool ( ) const
inline

◆ isFloat()

template<typename CharT >
bool GFt::json::Value< CharT >::isFloat ( ) const
inline

◆ isInteger()

template<typename CharT >
bool GFt::json::Value< CharT >::isInteger ( ) const
inline

◆ isNull()

template<typename CharT >
bool GFt::json::Value< CharT >::isNull ( ) const
inline

◆ isNumber()

template<typename CharT >
bool GFt::json::Value< CharT >::isNumber ( ) const
inline

◆ isObject()

template<typename CharT >
bool GFt::json::Value< CharT >::isObject ( ) const
inline

◆ isString()

template<typename CharT >
bool GFt::json::Value< CharT >::isString ( ) const
inline

◆ operator=() [1/7]

template<typename CharT >
Value & GFt::json::Value< CharT >::operator= ( bool b)
inline

◆ operator=() [2/7]

template<typename CharT >
Value & GFt::json::Value< CharT >::operator= ( const Array< CharT > & a)
inline

◆ operator=() [3/7]

template<typename CharT >
Value & GFt::json::Value< CharT >::operator= ( const CharT * s)
inline

◆ operator=() [4/7]

template<typename CharT >
template<size_t N>
Value & GFt::json::Value< CharT >::operator= ( const CharT(&) s[N])
inline

◆ operator=() [5/7]

template<typename CharT >
Value & GFt::json::Value< CharT >::operator= ( const Object< CharT > & o)
inline

◆ operator=() [6/7]

template<typename CharT >
Value & GFt::json::Value< CharT >::operator= ( const StdString< CharT > & s)
inline

◆ operator=() [7/7]

template<typename CharT >
Value & GFt::json::Value< CharT >::operator= ( double d)
inline

◆ operator[]() [1/4]

template<typename CharT >
Value & GFt::json::Value< CharT >::operator[] ( const StdString< CharT > & key)
inline

◆ operator[]() [2/4]

template<typename CharT >
const Value & GFt::json::Value< CharT >::operator[] ( const StdString< CharT > & key) const
inline

◆ operator[]() [3/4]

template<typename CharT >
Value & GFt::json::Value< CharT >::operator[] ( size_t i)
inline

◆ operator[]() [4/4]

template<typename CharT >
const Value & GFt::json::Value< CharT >::operator[] ( size_t i) const
inline

◆ toBool()

template<typename CharT >
bool GFt::json::Value< CharT >::toBool ( ) const
inline

◆ toFloat()

template<typename CharT >
double GFt::json::Value< CharT >::toFloat ( ) const
inline

◆ toInt()

template<typename CharT >
int GFt::json::Value< CharT >::toInt ( ) const
inline

◆ toString()

template<typename CharT >
const StdString< CharT > & GFt::json::Value< CharT >::toString ( ) const
inline

◆ type()

template<typename CharT >
Type GFt::json::Value< CharT >::type ( ) const
inline

获取当前 JSON 值对象持有的 JSON 值类型

友元及相关符号说明

◆ operator<<

template<typename CharT >
StdOStream< CharT > & operator<< ( StdOStream< CharT > & os,
const Value< CharT > & v )
friend

向流中写入 JSON 值对象

◆ operator>>

template<typename CharT >
StdIStream< CharT > & operator>> ( StdIStream< CharT > & is,
Value< CharT > & v )
friend

从流中读取 JSON 值对象

这个函数会尝试解析 JSON 格式的字符串,并将解析结果存储在当前 JSON 值对象中 它会忽略冗余的空白符、注释和尾随逗号

注解
若在读取时遇到错误,会设置流状态为 failbit