mrdocs::dom::Value

A variant container for any kind of Dom value.

Synopsis

Declared in <mrdocs/Dom/Value.hpp>

class Value;

Member Functions

NameDescription
Value [constructor]Constructors
~Value [destructor]Destroy the contained value, releasing owned storage.
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.
typeKey Return the type key of the value.
operator bool Determine if a value is truthy
operator std::string Return the string.

Data Members

NameDescription
arr_ [variant member]Array payload; shared with lazy arrays.
b_ [variant member]Boolean payload when the value kind is Boolean.
fn_ [variant member]Callable payload used by template helpers.
i_ [variant member]Integer payload when the value kind is Integer.
obj_ [variant member]Object payload; shared with lazy objects.
str_ [variant member]UTF-8 string or safe-string payload.

Friends

NameDescription
mrdocs::dom::toStringReturn 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::swapSwap two values.
mrdocs::safeStringCreate a wrapper for a safe string.
mrdocs::dom::ObjectA container of key and value pairs.
mrdocs::dom::ArrayAn array of values

Non-Member Functions

NameDescription
stringOrNullReturn a non-empty string, or a null.
stringOrNullReturn a non-empty string, or a null.
valueFromConvert an object of type T to dom::Value.
valueFromConvert an object of type T to dom::Value with a context
JSON::stringifyStringify a value as JSON
::mrdocs::buildCorpusDomBuild a DOM object representing an entire corpus.
::mrdocs::buildCorpusDomBuild a DOM object representing an entire corpus.
::mrdocs::buildSymbolDomBuild the DOM value for a single symbol.
::mrdocs::safeStringReturn a DOM string ensuring special characters are escaped.
::mrdocs::safeStringMark an existing string-like value as safe to emit without escaping.
::mrdocs::handlebars::isEmptyDetermine if a value is empty
::mrdocs::handlebars::helpers::blockHelperMissingFnThe blockHelperMissing helper: renders a block for a missing block helper.
::mrdocs::handlebars::helpers::detagFn"detag" helper function
::mrdocs::handlebars::helpers::incrementFn"increment" helper function
::mrdocs::handlebars::helpers::orFn"or" helper function
::mrdocs::handlebars::helpers::selectFn"select" helper function