class Value
Required header: <Eclog/Value.h>
The Value class represents an encountered value while parsing.
Name | Description |
---|---|
type | Gets the type of this value. |
isNull | Determines whether this value is a null. |
isBoolean | Determines whether this value is a Boolean. |
isString | Determines whether this value is a string. |
isNumber | Determines whether this value is a number. |
isObject | Determines whether this value is an object. |
isArray | Determines whether this value is an array. |
asNull | Casts this value to a null. |
asBoolean | Casts this value to a Boolean. |
asString | Casts this value to a string. |
asNumber | Casts this value to a number. |
bytes | Gets the UTF-8 byte sequence of this value. |
numberInfo | Gets the number information. |
stringNotation | Gets the string notation. |
stringDelimiter | Gets the string delimiter. |
ValueType type() const;
Gets the type of this value.
ValueType Type of this value.
bool isNull() const;
bool isBoolean() const;
bool isString() const;
bool isNumber() const;
bool isObject() const;
bool isArray() const;
Determines whether this value is of a specific type.
bool
true if this value is of a specific type, false otherwise.
Null asNull() const;
bool asBoolean() const;
cstring asString() const;
Number asNumber() const;
Casts this value to a specific type.
Null Null value.
bool
Boolean value.
cstring String value.
Number Number value.
A BadCast
fault occurs if this value is not of the specific type.
cstring bytes() const;
Gets the UTF-8 byte sequence of this value.
cstring The byte sequence.
int numberInfo() const;
Gets the number information (Only meaningful for number value).
int
The number information, which is a bitmask value (See NumberInfo).
StringNotation stringNotation() const;
Gets the string notation (Only meaningful for string value).
StringNotation The string notation of the string.
cstring stringDelimiter() const;
Gets the string delimiter (Only meaningful for raw string and heredoc string).
cstring The string delimiter of the string.