mrdocs::dom::Value

A variant container for any kind of Dom value.

Synopsis

Declared in <mrdocs/Dom/Value.hpp>

class Value;

Member Functions

Name

Description

Value [constructor]

Constructors

~Value [destructor]

Destructor

operator=

Assignment operators

empty

Return if an Array or Object is empty.

exists

Return true if a key exists.

get

get overloads

getArray

Return the array.

getBool

Return the underlying boolean value.

getFunction

Return the function.

getInteger

Return the underlying integer value.

getObject

Return the object.

getString

Return the underlying string value.

isArray

Return true if this is an array.

isBoolean

Return true if this is a boolean.

isFunction

Return true if this is a function.

isInteger

Return true if this is an integer.

isNull

Return true if this is null.

isObject

Return true if this is an object.

isSafeString

Return true if this is a safe string.

isString

Return true if this is a string.

isTruthy

Determine if a value is truthy

isUndefined

Return true if this is undefined.

kind

Return the type of value contained.

lookup

Lookup a sequence of keys.

operator()

Invoke the function.

set

Set or replace the value for a given key.

size

Return if an Array or Object is empty.

swap

Swap two values.

type_key

Return the type key of the value.

operator std::string

Return the string.

operator bool

Determine if a value is truthy

Data Members

Name

arr_ [variant member]

b_ [variant member]

fn_ [variant member]

i_ [variant member]

obj_ [variant member]

str_ [variant member]

Friends

Name

Description

mrdocs::dom::toString

Return value as a string.

mrdocs::dom::operator&&

mrdocs::dom::operator&&

mrdocs::dom::operator&&

Return the first dom::Value that is not truthy, or the last one.

mrdocs::dom::operator||

mrdocs::dom::operator||

mrdocs::dom::operator||

Return the first dom::Value that is truthy, or the last one.

mrdocs::dom::operator+

mrdocs::dom::operator+

mrdocs::dom::operator+

Add or concatenate two values.

mrdocs::dom::operator<=>

Three‐way comparison operator

mrdocs::dom::operator<=>

Three‐way comparison operator

mrdocs::dom::operator<=>

Compare two values for inequality.

mrdocs::dom::operator==

Compare two values for equality.

mrdocs::dom::swap

Swap two values.

mrdocs::safeString

Create a wrapper for a safe string.

mrdocs::dom::Object

A container of key and value pairs.

mrdocs::dom::Array

An array of values

Non-Member Functions

Name

Description

ValueFrom

Convert an object of type T to dom::Value with a context

ValueFrom

Convert an object of type T to dom::Value.

stringOrNull

Return a non‐empty string, or a null.

stringOrNull

Return a non‐empty string, or a null.

stringOrNull

Return a non‐empty string, or a null.

JSON::stringify

Stringify a value as JSON

::mrdocs::isEmpty

Determine if a value is empty

::mrdocs::helpers::detag_fn

"detag" helper function

::mrdocs::helpers::increment_fn

"increment" helper function

::mrdocs::helpers::or_fn

"or" helper function

::mrdocs::helpers::relativize_fn

"relativize" helper function

::mrdocs::helpers::select_fn

"select" helper function

Created with MrDocs