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.
构造及析构函数说明
◆ Value()
成员函数说明
◆ 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 |
◆ asInt()
| int eve::json::Value::asInt | ( | int | fallback = 0 | ) | const |
As int.
引用了 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.
引用了 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 |
At.
Element at index, or a null Value when out of range / not an array.
引用了 eve::json::Node::Array, eve::json::Node::elements, index, eve::json::Node::kind , 以及 Value().
被这些函数引用 getFloatArray(), getIntArray(), eve::rpg::ClassRegistry::loadFromJson(), eve::rpg::TraitRegistry::loadFromJson(), eve::rpg::LootSystem::registerTablesFromJson() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().
◆ get()
| Value eve::json::Value::get | ( | const char * | key | ) | const |
Returns the value.
Member value, or a null Value when absent / not an object.
引用了 key, eve::json::Node::kind, eve::json::Node::memberNames, eve::json::Node::memberValues, eve::json::Node::Object , 以及 Value().
被这些函数引用 getBool(), getDouble(), getFloat(), getFloatArray(), getInt(), getIntArray(), getIntMap(), getString(), getStringArray(), getStringMap(), has(), eve::rpg::ClassRegistry::loadFromJson(), eve::rpg::TraitRegistry::loadFromJson(), eve::rpg::LootSystem::registerTablesFromJson() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().
◆ getBool()
| bool eve::json::Value::getBool | ( | const char * | key, |
| bool | fallback = false |
||
| ) | const |
◆ getDouble()
| double eve::json::Value::getDouble | ( | const char * | key, |
| double | fallback = 0.0 |
||
| ) | const |
Returns the double.
引用了 asDouble(), get() , 以及 key.
◆ getFloat()
| float eve::json::Value::getFloat | ( | const char * | key, |
| float | fallback = 0.f |
||
| ) | const |
◆ getFloatArray()
| std::vector< float > eve::json::Value::getFloatArray | ( | const char * | key | ) | const |
◆ getInt()
| int eve::json::Value::getInt | ( | const char * | key, |
| int | fallback = 0 |
||
| ) | const |
Returns the int.
被这些函数引用 getIntMap(), eve::rpg::ClassRegistry::loadFromJson() , 以及 eve::rpg::LootSystem::registerTablesFromJson().
◆ getIntArray()
| std::vector< int > eve::json::Value::getIntArray | ( | const char * | key | ) | const |
◆ getIntMap()
| std::unordered_map< std::string, int > eve::json::Value::getIntMap | ( | const char * | key | ) | const |
◆ getString()
| std::string eve::json::Value::getString | ( | const char * | key, |
| const std::string & | fallback = {} |
||
| ) | const |
Returns the string.
引用了 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 |
◆ getStringMap()
| std::unordered_map< std::string, std::string > eve::json::Value::getStringMap | ( | const char * | key | ) | const |
引用了 get(), getString(), isObject(), key, keys() , 以及 name.
◆ has()
| bool eve::json::Value::has | ( | const char * | key | ) | const |
◆ isArray()
| bool eve::json::Value::isArray | ( | ) | const |
True when array.
引用了 eve::json::Node::Array , 以及 eve::json::Node::kind.
被这些函数引用 getFloatArray(), getIntArray() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().
◆ isBool()
| bool eve::json::Value::isBool | ( | ) | const |
◆ isInt64()
| bool eve::json::Value::isInt64 | ( | ) | const |
True when the JSON number was an integer literal that fits Int64.
引用了 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.
引用了 eve::json::Node::integerLiteral, eve::json::Node::kind , 以及 eve::json::Node::Number.
◆ isNull()
| bool eve::json::Value::isNull | ( | ) | const |
◆ isNumber()
| bool eve::json::Value::isNumber | ( | ) | const |
True when number.
引用了 eve::json::Node::kind , 以及 eve::json::Node::Number.
◆ isObject()
| bool eve::json::Value::isObject | ( | ) | const |
True when object.
引用了 eve::json::Node::kind , 以及 eve::json::Node::Object.
被这些函数引用 getIntMap(), getStringMap() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().
◆ isString()
| bool eve::json::Value::isString | ( | ) | const |
True when string.
引用了 eve::json::Node::kind , 以及 eve::json::Node::String.
◆ keys()
| std::vector< std::string > eve::json::Value::keys | ( | ) | const |
Keys.
Member names in document order; empty when not an object.
引用了 eve::json::Node::kind, eve::json::Node::memberNames, name , 以及 eve::json::Node::Object.
被这些函数引用 getIntMap(), getStringMap() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().
◆ operator bool()
|
inlineexplicit |
◆ size()
| size_t eve::json::Value::size | ( | ) | const |
Returns the size of .
Element count for arrays, member count for objects, else 0.
引用了 eve::json::Node::Array, eve::json::Node::elements, eve::json::Node::kind, eve::json::Node::memberValues , 以及 eve::json::Node::Object.
被这些函数引用 getFloatArray(), getIntArray(), eve::rpg::ClassRegistry::loadFromJson(), eve::rpg::TraitRegistry::loadFromJson() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().
◆ 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).
引用了 eve::json::Node::Array, asString(), eve::json::Node::elements , 以及 eve::json::Node::kind.
被这些函数引用 getStringArray() , 以及 eve::rpg::QuestRegistry::replaceFromJsonStrict().
友元及相关函数文档
◆ Document
该类的文档由以下文件生成: