Arcane  4.1.12.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.
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
Implm_p

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 40 of file arccore/src/common/arccore/common/JSONReader.h.

Constructor & Destructor Documentation

◆ JSONValue() [1/2]

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

◆ JSONValue() [2/2]

Arcane::JSONValue::JSONValue ( )
inline

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 227 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 248 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 236 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 287 of file JSONReader.cc.

◆ isObject()

bool Arcane::JSONValue::isObject ( ) const

Definition at line 299 of file JSONReader.cc.

◆ keyValueChild()

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

Definition at line 212 of file JSONReader.cc.

◆ keyValueChildren()

JSONKeyValueList Arcane::JSONValue::keyValueChildren ( ) const

Definition at line 311 of file JSONReader.cc.

◆ null()

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

True if the node is null.

Definition at line 61 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 267 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:

Member Data Documentation

◆ JSONKeyValue

friend Arcane::JSONValue::JSONKeyValue
private

◆ JSONWrapperUtils

friend Arcane::JSONValue::JSONWrapperUtils
private

◆ m_p

Impl* Arcane::JSONValue::m_p
private

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