Represents a JSON value. More...
Classes | |
| class | Impl |
Public Member Functions | |
| bool | null () const |
| True if the node is null. | |
| bool | operator! () const |
| StringView | valueAsString () const |
| String | value () const |
| Value in String format. The returned string is null if 'null()' is true. | |
| StringView | valueAsStringView () const |
| Value in StringView format. The string is empty if 'null()' is true. | |
| Real | valueAsReal () const |
| Value in Real format. Returns 0.0 if 'null()' is true. | |
| Int64 | valueAsInt64 () const |
| Value in Int64 format. Returns 0 if 'null()' is true. | |
| Int32 | valueAsInt32 () const |
| Value in Int64 format. Returns 0 if 'null()' is true. | |
| bool | valueAsBool () const |
| Value in boolean format. Returns false if 'null()' is true. | |
| JSONValueList | valueAsArray () const |
| JSONKeyValue | keyValueChild (StringView name) const |
| JSONValue | child (StringView name) const |
| Child value with name name. Returns a null value if not found. | |
| JSONValue | expectedChild (StringView name) const |
| Child value with name name. Throws an exception if not found. | |
| JSONValueList | children () const |
| JSONKeyValueList | keyValueChildren () const |
| bool | isArray () const |
| bool | isObject () const |
Private Member Functions | |
| JSONValue (Impl *p) | |
Private Attributes | |
| friend | JSONWrapperUtils |
| friend | JSONKeyValue |
| Impl * | m_p |
Represents a JSON value.
Instances of this class are only valid as long as the associated document exists.
Definition at line 40 of file arccore/src/common/arccore/common/JSONReader.h.
|
inlineexplicitprivate |
Definition at line 48 of file arccore/src/common/arccore/common/JSONReader.h.
|
inline |
Definition at line 54 of file arccore/src/common/arccore/common/JSONReader.h.
| JSONValue Arcane::JSONValue::child | ( | StringView | name | ) | const |
Child value with name name. Returns a null value if not found.
Definition at line 227 of file JSONReader.cc.
References value().
Referenced by Arcane::VariableIOReaderMng::_readMetaData(), and Arcane::Application::initialize().
| JSONValueList Arcane::JSONValue::children | ( | ) | const |
Definition at line 248 of file JSONReader.cc.
| JSONValue Arcane::JSONValue::expectedChild | ( | StringView | name | ) | const |
Child value with name name. Throws an exception if not found.
Definition at line 236 of file JSONReader.cc.
References ARCCORE_FATAL.
Referenced by Arcane::VariableIOReaderMng::_readMetaData().
| bool Arcane::JSONValue::isArray | ( | ) | const |
Definition at line 287 of file JSONReader.cc.
| bool Arcane::JSONValue::isObject | ( | ) | const |
Definition at line 299 of file JSONReader.cc.
| JSONKeyValue Arcane::JSONValue::keyValueChild | ( | StringView | name | ) | const |
Definition at line 212 of file JSONReader.cc.
| JSONKeyValueList Arcane::JSONValue::keyValueChildren | ( | ) | const |
Definition at line 311 of file JSONReader.cc.
|
inline |
True if the node is null.
Definition at line 61 of file arccore/src/common/arccore/common/JSONReader.h.
|
inline |
Definition at line 62 of file arccore/src/common/arccore/common/JSONReader.h.
| String Arcane::JSONValue::value | ( | ) | const |
Value in String format. The returned string is null if 'null()' is true.
Definition at line 115 of file JSONReader.cc.
Referenced by Arcane::VariableIOReaderMng::_readMetaData(), and child().
| JSONValueList Arcane::JSONValue::valueAsArray | ( | ) | const |
Definition at line 267 of file JSONReader.cc.
| bool Arcane::JSONValue::valueAsBool | ( | ) | const |
Value in boolean format. Returns false if 'null()' is true.
Definition at line 166 of file JSONReader.cc.
| Int32 Arcane::JSONValue::valueAsInt32 | ( | ) | const |
Value in Int64 format. Returns 0 if 'null()' is true.
Definition at line 180 of file JSONReader.cc.
References valueAsInt64().
Referenced by Arcane::VariableIOReaderMng::_readMetaData().
| Int64 Arcane::JSONValue::valueAsInt64 | ( | ) | const |
Value in Int64 format. Returns 0 if 'null()' is true.
Definition at line 152 of file JSONReader.cc.
Referenced by valueAsInt32().
| Real Arcane::JSONValue::valueAsReal | ( | ) | const |
Value in Real format. Returns 0.0 if 'null()' is true.
Definition at line 190 of file JSONReader.cc.
References valueAsStringView().
| StringView Arcane::JSONValue::valueAsString | ( | ) | const |
Definition at line 143 of file JSONReader.cc.
| StringView Arcane::JSONValue::valueAsStringView | ( | ) | const |
Value in StringView format. The string is empty if 'null()' is true.
Definition at line 129 of file JSONReader.cc.
Referenced by valueAsReal().
|
private |
Definition at line 44 of file arccore/src/common/arccore/common/JSONReader.h.
|
private |
Definition at line 43 of file arccore/src/common/arccore/common/JSONReader.h.
|
private |
Definition at line 106 of file arccore/src/common/arccore/common/JSONReader.h.