Skip to content

Latest commit

 

History

History
80 lines (58 loc) · 2.83 KB

ValueNode.md

File metadata and controls

80 lines (58 loc) · 2.83 KB

ValueNode

class ValueNode

Inherited from: Node. Inherited by: NullNode, BooleanNode, StringNode, NumberNode, ObjectNode, and ArrayNode.

Required header: <Eclog/ValueNode.h>

The ValueNode abstract class represents a value node in a document tree (See Document).

Member functions

Name Description
isNull Determines whether this node is a null node.
isBoolean Determines whether this node is a Boolean node.
isString Determines whether this node is a string node.
isNumber Determines whether this node is a number node.
isObject Determines whether this node is an object node.
isArray Determines whether this node is an array node.
asNull Casts this node to a null node.
asBoolean Casts this node to a Boolean node.
asString Casts this node to a string node.
asNumber Casts this node to a number node.
asObject Casts this node to an object node.
asArray Casts this node to an array node.

isNull, isBoolean, isString, isNumber, isObject, and isArray

bool isNull() const;
bool isBoolean() const;
bool isString() const;
bool isNumber() const;
bool isObject() const;
bool isArray() const;

Determines whether this node is of a specified type.

Return value

bool true if this node is of the specified type, false otherwise.


asNull, asBoolean, asString, asNumber, asObject, and asArray

NullNode& asNull();
const NullNode& asNull() const;
BooleanNode& asBoolean();
const BooleanNode& asBoolean() const;
StringNode& asString();
const StringNode& asString() const;
NumberNode& asNumber();
const NumberNode& asNumber() const;
ObjectNode& asObject();
const ObjectNode& asObject() const;
ArrayNode& asArray();
const ArrayNode& asArray() const;

Casts this node to a specific type.

Return value

(node type)& Reference to this node.

const (node type)& Reference to this node.

Errors

A BadCast fault occurs if this node is not of the specified type.