Arcane  4.2.2.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::JSONValue Class Reference

Represents a JSON value. More...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/common/arccore/common/JSONReader.h>

Collaboration diagram for Arcane::JSONValue:

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.
UInt64 valueAsUInt64 () const
 Value in UInt64 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
bool isNull () const
 True if the value is of 'null' type.
bool isBool () const
 True if the value is a boolean.
bool isString () const
 True if the value is a string.
bool isNumber () const
 True if the value is a number.
bool isInt64 () const
 True if the value is an integer in the 'Int64' range.
bool isUint64 () const
 True if the value is an integer in the 'UInt64' range.

Private Member Functions

 JSONValue (Impl *p)

Private Attributes

friend JSONWrapperUtils
friend JSONKeyValue
Implm_p = nullptr

Detailed Description

Represents a JSON value.

Instances of this class are only valid as long as the associated document exists.

Warning
Internal API. Do not use outside of Arcane.

Definition at line 39 of file arccore/src/common/arccore/common/JSONReader.h.

Constructor & Destructor Documentation

◆ JSONValue()

Arcane::JSONValue::JSONValue ( Impl * p)
inlineexplicitprivate

Member Function Documentation

◆ child()

JSONValue Arcane::JSONValue::child ( StringView name) const

Child value with name name. Returns a null value if not found.

Definition at line 237 of file JSONReader.cc.

References value().

Referenced by Arcane::VariableIOReaderMng::_readMetaData(), and Arcane::Application::initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ children()

JSONValueList Arcane::JSONValue::children ( ) const

Definition at line 258 of file JSONReader.cc.

◆ expectedChild()

JSONValue Arcane::JSONValue::expectedChild ( StringView name) const

Child value with name name. Throws an exception if not found.

Definition at line 246 of file JSONReader.cc.

References ARCCORE_FATAL.

Referenced by Arcane::VariableIOReaderMng::_readMetaData().

Here is the caller graph for this function:

◆ isArray()

bool Arcane::JSONValue::isArray ( ) const

Definition at line 297 of file JSONReader.cc.

◆ isBool()

bool Arcane::JSONValue::isBool ( ) const

True if the value is a boolean.

Definition at line 343 of file JSONReader.cc.

◆ isInt64()

bool Arcane::JSONValue::isInt64 ( ) const

True if the value is an integer in the 'Int64' range.

Definition at line 367 of file JSONReader.cc.

◆ isNull()

bool Arcane::JSONValue::isNull ( ) const

True if the value is of 'null' type.

Definition at line 335 of file JSONReader.cc.

◆ isNumber()

bool Arcane::JSONValue::isNumber ( ) const

True if the value is a number.

Definition at line 359 of file JSONReader.cc.

◆ isObject()

bool Arcane::JSONValue::isObject ( ) const

Definition at line 309 of file JSONReader.cc.

◆ isString()

bool Arcane::JSONValue::isString ( ) const

True if the value is a string.

Definition at line 351 of file JSONReader.cc.

◆ isUint64()

bool Arcane::JSONValue::isUint64 ( ) const

True if the value is an integer in the 'UInt64' range.

Definition at line 375 of file JSONReader.cc.

◆ keyValueChild()

JSONKeyValue Arcane::JSONValue::keyValueChild ( StringView name) const

Definition at line 222 of file JSONReader.cc.

◆ keyValueChildren()

JSONKeyValueList Arcane::JSONValue::keyValueChildren ( ) const

Definition at line 321 of file JSONReader.cc.

◆ null()

bool Arcane::JSONValue::null ( ) const
inline

True if the node is null.

Definition at line 58 of file arccore/src/common/arccore/common/JSONReader.h.

◆ operator!()

bool Arcane::JSONValue::operator! ( ) const
inline

◆ value()

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().

Here is the caller graph for this function:

◆ valueAsArray()

JSONValueList Arcane::JSONValue::valueAsArray ( ) const

Definition at line 277 of file JSONReader.cc.

◆ valueAsBool()

bool Arcane::JSONValue::valueAsBool ( ) const

Value in boolean format. Returns false if 'null()' is true.

Definition at line 166 of file JSONReader.cc.

◆ valueAsInt32()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueAsInt64()

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().

Here is the caller graph for this function:

◆ valueAsReal()

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().

Here is the call graph for this function:

◆ valueAsString()

StringView Arcane::JSONValue::valueAsString ( ) const

Definition at line 143 of file JSONReader.cc.

◆ valueAsStringView()

StringView Arcane::JSONValue::valueAsStringView ( ) const

Value in StringView format. The string is empty if 'null()' is true.

Note
If you want to distinguish between a null value and an empty string, you must use value().

Definition at line 129 of file JSONReader.cc.

Referenced by valueAsReal().

Here is the caller graph for this function:

◆ valueAsUInt64()

UInt64 Arcane::JSONValue::valueAsUInt64 ( ) const

Value in UInt64 format. Returns 0 if 'null()' is true.

Definition at line 208 of file JSONReader.cc.

Member Data Documentation

◆ JSONKeyValue

friend Arcane::JSONValue::JSONKeyValue
private

◆ JSONWrapperUtils

friend Arcane::JSONValue::JSONWrapperUtils
private

◆ m_p

Impl* Arcane::JSONValue::m_p = nullptr
private

The documentation for this class was generated from the following files: