clang::mrdocs::dom

Objects representing JSON-like values.

Namespaces

Name
JSON

Types

Name Description
Array An array of values
ArrayImpl Abstract array interface.
DefaultArrayImpl The default array implementation.
DefaultFunctionImpl
DefaultObjectImpl The default Object implementation.
Function
FunctionImpl
LazyArrayImpl Lazy array implementation
LazyObjectImpl Lazy object implementation.
LazyObjectMapTag Customization point tag.
Object A container of key and value pairs.
ObjectImpl Abstract object interface.
String
Value A variant container for any kind of Dom value.
ValueFromTag Customization point tag.
VariadicFunctionImpl
function_traits
function_traits<F>
function_traits<R(*)(Args...)>
function_traits<R(Args...)>
function_traits<R const volatile(C::*)(Args...)>

Enums

Name Description
Kind The type of data in a Value.

Functions

Name Description
LazyArray LazyArray overloads
LazyObject LazyObject overloads
TransformArray Return a new dom::Array based on a transformed lazy array implementation.
ValueFrom ValueFrom overloads
makeInvocable
makeVariadicInvocable
newArray Return a new array using a custom implementation.
newFunction Return a diagnostic string.
newObject Return a new object using a custom implementation.
operator&& Return the first dom::Value that is not truthy, or the last one.
operator+ Addition operators
operator|| Return the first dom::Value that is truthy, or the last one.
stringOrNull Return a non-empty string, or a null.
swap swap overloads
toString toString overloads
operator== Equality operators
operator!= Return the result of comparing two strings.
operator<=> Three-way comparison operators

Concepts

Name Description
HasLazyObjectMap Determine if T can be converted to dom::Value.
HasLazyObjectMapWithContext Concept to determine if a type can be mapped to a dom::LazyObjectImpl with a user-provided conversion.
HasLazyObjectMapWithoutContext Concept to determine if a type can be mapped to a dom::LazyObjectImpl with a user-provided conversion.
HasStandaloneValueFrom Determine if T can be converted to dom::Value without a context.
HasValueFrom Determine if T can be converted to dom::Value.
HasValueFromWithContext Concept to determine if a type can be converted to a dom::Value with a user-provided conversion.
HasValueFromWithoutContext Concept to determine if a type can be converted to a dom::Value with a user-provided conversion.
StringLikeTy Satisfied if StringTy is convertible to String but not a String.
function_traits_convertible_to_value
has_function_args_for_default_function_impl
has_function_traits
has_function_traits_for_default_function_impl
has_invoke_expected_result_convertible_to_dom_value
has_invoke_result_convertible_to_dom_value
has_invoke_result_for_default_function_impl

Description

This class is a variant-like container for holding any kind of value that can be represented in JSON, with extensions for functions and "safe strings".

The class supports the following types:

- Undefined - Null - Boolean - Integer - String - SafeString - Array - Object - Function

The class provides type-safe accessors for each type, as well as methods to check the type of the contained value.

Example:

{.cpp} dom::Value v1 = 42; // Integer dom::Value v2 = "Hello, World!"; // String dom::Value v3 = dom::Array{v1, v2}; // Array if (v1.isInteger()) { std::cout << "v1 is an integer: " << v1.getInteger() << "\n"; } if (v2.isString()) { std::cout << "v2 is a string: " << v2.getString() << "\n"; } if (v3.isArray()) { std::cout << "v3 is an array with " << v3.getArray().size() << " elements.\n"; }

Created with MrDocs