#include <Json.h>
Public 成员函数 | |
| Value ()=default | |
| operator bool () const | |
| bool | isNull () const |
| bool | isBool () const |
| bool | isNumber () const |
| bool | isString () const |
| bool | isObject () const |
| bool | isArray () const |
| bool | has (const char *key) const |
| Value | get (const char *key) const |
| std::vector< std::string > | keys () const |
| size_t | size () const |
| Value | at (size_t index) const |
| bool | asBool (bool fallback=false) const |
| int | asInt (int fallback=0) const |
| float | asFloat (float fallback=0.f) const |
| double | asDouble (double fallback=0.0) const |
| std::string | asString (const std::string &fallback={}) const |
| bool | getBool (const char *key, bool fallback=false) const |
| int | getInt (const char *key, int fallback=0) const |
| float | getFloat (const char *key, float fallback=0.f) const |
| double | getDouble (const char *key, double fallback=0.0) const |
| std::string | getString (const char *key, const std::string &fallback={}) const |
| std::vector< std::string > | getStringArray (const char *key) const |
| std::vector< int > | getIntArray (const char *key) const |
| std::vector< float > | getFloatArray (const char *key) const |
| 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 |
友元 | |
| class | Document |
详细描述
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 |
引用了 asDouble(), d, eve::json::Node::integral, eve::json::Node::intVal, eve::json::Node::kind , 以及 eve::json::Node::Number.
被这些函数引用 getInt() , 以及 getIntArray().
◆ asString()
| std::string eve::json::Value::asString | ( | const std::string & | fallback = {} | ) | const |
◆ at()
| Value eve::json::Value::at | ( | size_t | index | ) | const |
Element at index, or a null Value when out of range / not an array.
引用了 eve::json::Node::Array, eve::json::Node::elements, eve::json::Node::kind , 以及 Value().
被这些函数引用 getFloatArray(), getIntArray(), eve::building::BuildingRegistry::loadFromJson(), eve::inventory::ItemRegistry::loadFromJson(), eve::rpg::EffectRegistry::loadFromJson() , 以及 eve::rpg::SkillRegistry::loadFromJson().
◆ get()
| Value eve::json::Value::get | ( | const char * | key | ) | const |
Member value, or a null Value when absent / not an object.
引用了 eve::json::Node::kind, m, eve::json::Node::members, eve::json::Node::Object , 以及 Value().
被这些函数引用 getBool(), getDouble(), getFloat(), getFloatArray(), getInt(), getIntArray(), getIntMap(), getString(), getStringArray(), getStringMap() , 以及 has().
◆ 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 |
引用了 asDouble() , 以及 get().
◆ 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 |
◆ 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 |
◆ getStringArray()
| std::vector< std::string > eve::json::Value::getStringArray | ( | const char * | key | ) | const |
引用了 get() , 以及 toStringArray().
◆ getStringMap()
| std::unordered_map< std::string, std::string > eve::json::Value::getStringMap | ( | const char * | key | ) | const |
引用了 get(), getString(), isObject(), keys() , 以及 name.
◆ has()
◆ isArray()
| bool eve::json::Value::isArray | ( | ) | const |
◆ isBool()
| bool eve::json::Value::isBool | ( | ) | const |
引用了 eve::json::Node::Bool , 以及 eve::json::Node::kind.
◆ isNull()
| bool eve::json::Value::isNull | ( | ) | const |
引用了 eve::json::Node::kind , 以及 eve::json::Node::Null.
◆ isNumber()
| bool eve::json::Value::isNumber | ( | ) | const |
引用了 eve::json::Node::kind , 以及 eve::json::Node::Number.
◆ isObject()
| bool eve::json::Value::isObject | ( | ) | const |
◆ isString()
| bool eve::json::Value::isString | ( | ) | const |
引用了 eve::json::Node::kind , 以及 eve::json::Node::String.
◆ keys()
| std::vector< std::string > eve::json::Value::keys | ( | ) | const |
Member names in document order; empty when not an object.
引用了 eve::json::Node::kind, m, eve::json::Node::members , 以及 eve::json::Node::Object.
被这些函数引用 getIntMap() , 以及 getStringMap().
◆ operator bool()
|
inlineexplicit |
◆ size()
| size_t eve::json::Value::size | ( | ) | const |
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::members , 以及 eve::json::Node::Object.
被这些函数引用 getFloatArray(), getIntArray(), eve::building::BuildingRegistry::loadFromJson(), eve::inventory::ItemRegistry::loadFromJson(), eve::rpg::EffectRegistry::loadFromJson() , 以及 eve::rpg::SkillRegistry::loadFromJson().
◆ toStringArray()
| std::vector< std::string > eve::json::Value::toStringArray | ( | ) | const |
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().
友元及相关函数文档
◆ Document
该类的文档由以下文件生成: