载入中...
搜索中...
未找到
eve::json::Value类 参考

EVENGINE_API_FOUNDATION public API. 更多...

#include <Json.h>

Public 成员函数

 Value ()=default
 Value.
 
 operator bool () const
 Bool.
 
bool isNull () const
 True when null.
 
bool isBool () const
 True when bool.
 
bool isNumber () const
 True when number.
 
bool isInt64 () const
 True when the JSON number was an integer literal that fits Int64.
 
bool isIntegerLiteral () const
 True when the JSON number had no fraction or exponent.
 
bool isString () const
 True when string.
 
bool isObject () const
 True when object.
 
bool isArray () const
 True when array.
 
bool has (const char *key) const
 True when active.
 
Value get (const char *key) const
 Returns the value.
 
std::vector< std::string > keys () const
 Keys.
 
size_t size () const
 Returns the size of .
 
Value at (size_t index) const
 At.
 
bool asBool (bool fallback=false) const
 As bool.
 
int asInt (int fallback=0) const
 As int.
 
float asFloat (float fallback=0.f) const
 As float.
 
double asDouble (double fallback=0.0) const
 As double.
 
std::int64_t asInt64 (std::int64_t fallback=0) const
 Read an exact Int64 literal, or return the caller-supplied default for other numbers.
 
std::string asString (const std::string &fallback={}) const
 As string.
 
bool getBool (const char *key, bool fallback=false) const
 Returns the bool.
 
int getInt (const char *key, int fallback=0) const
 Returns the int.
 
float getFloat (const char *key, float fallback=0.f) const
 Returns the float.
 
double getDouble (const char *key, double fallback=0.0) const
 Returns the double.
 
std::string getString (const char *key, const std::string &fallback={}) const
 Returns the string.
 
std::vector< std::string > getStringArray (const char *key) const
 Returns the string array.
 
std::vector< int > getIntArray (const char *key) const
 Returns the int array.
 
std::vector< float > getFloatArray (const char *key) const
 Returns the float array.
 
std::unordered_map< std::string, std::string > getStringMap (const char *key) const
 
std::unordered_map< std::string, int > getIntMap (const char *key) const
 
std::vector< std::string > toStringArray () const
 To string array.
 

友元

class Document
 

详细描述

EVENGINE_API_FOUNDATION public API.

Handle to one node of a parsed Document. Cheap to copy, but only valid while the owning Document is alive.

在文件 Json.h 第 38 行定义.

构造及析构函数说明

◆ Value()

eve::json::Value::Value ( )
default

Value.

被这些函数引用 at() , 以及 get().

成员函数说明

◆ asBool()

bool eve::json::Value::asBool ( bool  fallback = false) const

◆ asDouble()

double eve::json::Value::asDouble ( double  fallback = 0.0) const

◆ asFloat()

float eve::json::Value::asFloat ( float  fallback = 0.f) const

As float.

在文件 Json.cpp 第 407 行定义.

引用了 asDouble().

被这些函数引用 getFloat() , 以及 getFloatArray().

◆ asInt()

int eve::json::Value::asInt ( int  fallback = 0) const

As int.

在文件 Json.cpp 第 392 行定义.

引用了 asDouble(), d, eve::json::Node::hasInt64, eve::json::Node::intVal, eve::json::Node::kind , 以及 eve::json::Node::Number.

被这些函数引用 getInt() , 以及 getIntArray().

◆ asInt64()

std::int64_t eve::json::Value::asInt64 ( std::int64_t  fallback = 0) const

Read an exact Int64 literal, or return the caller-supplied default for other numbers.

在文件 Json.cpp 第 390 行定义.

引用了 eve::json::Node::intVal , 以及 isInt64().

◆ asString()

std::string eve::json::Value::asString ( const std::string &  fallback = {}) const

◆ at()

Value eve::json::Value::at ( size_t  index) const

◆ get()

◆ getBool()

bool eve::json::Value::getBool ( const char *  key,
bool  fallback = false 
) const

Returns the bool.

在文件 Json.cpp 第 421 行定义.

引用了 asBool(), get() , 以及 key.

◆ getDouble()

double eve::json::Value::getDouble ( const char *  key,
double  fallback = 0.0 
) const

Returns the double.

在文件 Json.cpp 第 424 行定义.

引用了 asDouble(), get() , 以及 key.

被这些函数引用 eve::rpg::LootSystem::registerTablesFromJson().

◆ getFloat()

float eve::json::Value::getFloat ( const char *  key,
float  fallback = 0.f 
) const

Returns the float.

在文件 Json.cpp 第 423 行定义.

引用了 asFloat(), get() , 以及 key.

◆ getFloatArray()

std::vector< float > eve::json::Value::getFloatArray ( const char *  key) const

Returns the float array.

在文件 Json.cpp 第 452 行定义.

引用了 asFloat(), at(), get(), isArray(), key, n , 以及 size().

◆ getInt()

int eve::json::Value::getInt ( const char *  key,
int  fallback = 0 
) const

Returns the int.

在文件 Json.cpp 第 422 行定义.

引用了 asInt(), get() , 以及 key.

被这些函数引用 getIntMap(), eve::rpg::ClassRegistry::loadFromJson() , 以及 eve::rpg::LootSystem::registerTablesFromJson().

◆ getIntArray()

std::vector< int > eve::json::Value::getIntArray ( const char *  key) const

Returns the int array.

在文件 Json.cpp 第 443 行定义.

引用了 asInt(), at(), get(), isArray(), key, n , 以及 size().

◆ getIntMap()

std::unordered_map< std::string, int > eve::json::Value::getIntMap ( const char *  key) const

在文件 Json.cpp 第 469 行定义.

引用了 get(), getInt(), isObject(), key, keys() , 以及 name.

◆ getString()

std::string eve::json::Value::getString ( const char *  key,
const std::string &  fallback = {} 
) const

Returns the string.

在文件 Json.cpp 第 427 行定义.

引用了 asString(), get() , 以及 key.

被这些函数引用 getStringMap(), eve::rpg::ClassRegistry::loadFromJson() , 以及 eve::rpg::LootSystem::registerTablesFromJson().

◆ getStringArray()

std::vector< std::string > eve::json::Value::getStringArray ( const char *  key) const

Returns the string array.

在文件 Json.cpp 第 439 行定义.

引用了 get(), key , 以及 toStringArray().

◆ getStringMap()

std::unordered_map< std::string, std::string > eve::json::Value::getStringMap ( const char *  key) const

在文件 Json.cpp 第 461 行定义.

引用了 get(), getString(), isObject(), key, keys() , 以及 name.

◆ has()

bool eve::json::Value::has ( const char *  key) const

True when active.

在文件 Json.cpp 第 334 行定义.

引用了 get() , 以及 key.

◆ isArray()

bool eve::json::Value::isArray ( ) const

True when array.

在文件 Json.cpp 第 332 行定义.

引用了 eve::json::Node::Array , 以及 eve::json::Node::kind.

被这些函数引用 getFloatArray(), getIntArray() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().

◆ isBool()

bool eve::json::Value::isBool ( ) const

True when bool.

在文件 Json.cpp 第 326 行定义.

引用了 eve::json::Node::Bool , 以及 eve::json::Node::kind.

◆ isInt64()

bool eve::json::Value::isInt64 ( ) const

True when the JSON number was an integer literal that fits Int64.

在文件 Json.cpp 第 328 行定义.

引用了 eve::json::Node::hasInt64, eve::json::Node::kind , 以及 eve::json::Node::Number.

被这些函数引用 asInt64().

◆ isIntegerLiteral()

bool eve::json::Value::isIntegerLiteral ( ) const

True when the JSON number had no fraction or exponent.

在文件 Json.cpp 第 329 行定义.

引用了 eve::json::Node::integerLiteral, eve::json::Node::kind , 以及 eve::json::Node::Number.

◆ isNull()

bool eve::json::Value::isNull ( ) const

True when null.

在文件 Json.cpp 第 325 行定义.

引用了 eve::json::Node::kind , 以及 eve::json::Node::Null.

◆ isNumber()

bool eve::json::Value::isNumber ( ) const

True when number.

在文件 Json.cpp 第 327 行定义.

引用了 eve::json::Node::kind , 以及 eve::json::Node::Number.

被这些函数引用 eve::rpg::QuestRegistry::replaceFromJsonStrict().

◆ isObject()

bool eve::json::Value::isObject ( ) const

True when object.

在文件 Json.cpp 第 331 行定义.

引用了 eve::json::Node::kind , 以及 eve::json::Node::Object.

被这些函数引用 getIntMap(), getStringMap() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().

◆ isString()

bool eve::json::Value::isString ( ) const

True when string.

在文件 Json.cpp 第 330 行定义.

引用了 eve::json::Node::kind , 以及 eve::json::Node::String.

被这些函数引用 eve::rpg::QuestRegistry::replaceFromJsonStrict().

◆ keys()

std::vector< std::string > eve::json::Value::keys ( ) const

Keys.

Member names in document order; empty when not an object.

在文件 Json.cpp 第 343 行定义.

引用了 eve::json::Node::kind, eve::json::Node::memberNames, name , 以及 eve::json::Node::Object.

被这些函数引用 getIntMap(), getStringMap() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().

◆ operator bool()

eve::json::Value::operator bool ( ) const
inlineexplicit

Bool.

True when this handle refers to an actual node.

在文件 Json.h 第 45 行定义.

◆ size()

size_t eve::json::Value::size ( ) const

◆ toStringArray()

std::vector< std::string > eve::json::Value::toStringArray ( ) const

To string array.

This node read as an array of strings (for a Value already in hand).

在文件 Json.cpp 第 431 行定义.

引用了 eve::json::Node::Array, asString(), eve::json::Node::elements , 以及 eve::json::Node::kind.

被这些函数引用 getStringArray() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().

友元及相关函数文档

◆ Document

friend class Document
friend

在文件 Json.h 第 127 行定义.


该类的文档由以下文件生成: