Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::JSONValue Class Reference

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

Detailed Description

Constructor & Destructor Documentation

◆ JSONValue()

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

◆ 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.

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

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

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

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

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


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