Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
Value

#include "value.hh"

Inherits ValueVariant.

Public Types

enum Type {
  NONE , BOOL , INT64 , DOUBLE ,
  STRING , ARRAY , RECORD , INSTANCE
}

Public Member Functions

const ValueS &as_array () const
doubleas_double () const
int64as_int () const
const ValueR &as_record () const
Stringas_string () const
size_tcount () const
voidfilter (const std::function< bool(const ValueField &)> &pred)
boolhas (const String &key) const
constexpr Typeindex () const
boolis_numeric (bool boolisnumeric=true) const
boolis_string () const
StringSkeys () const
booloperator!= (const Value &other) const
voidoperator= (bool v)
voidoperator= (const char *v)
voidoperator= (const InstanceP &v)
voidoperator= (const String &v)
voidoperator= (const ValueR &v)
voidoperator= (const ValueS &v)
voidoperator= (double v)
voidoperator= (int32 v)
voidoperator= (int64 v)
voidoperator= (uint32 v)
voidoperator= (ValueR &&v)
voidoperator= (ValueS &&v)
booloperator== (const Value &other) const
Value &operator[] (const String &name)
const Value &operator[] (const String &name) const
Value &operator[] (size_t i)
const Value &operator[] (size_t i) const
Stringrepr () const
Value ()
Value (bool v)
Value (const char *v)
Value (const String &v)
Value (double v)
Value (int32 v)
Value (int64 v)
Value (uint32 v)

Static Public Attributes

static const Valueempty_value

Detailed Description

Value type used to interface with various property types.

Member Enumeration Documentation

Type

enum Type
Enumerator
NONE
BOOL
INT64
DOUBLE
STRING
ARRAY
RECORD
INSTANCE

Constructor & Destructor Documentation

Value() [1/8]

Value ( )

Value() [2/8]

Value ( bool v)

Value() [3/8]

Value ( int64 v)

Value() [4/8]

Value ( int32 v)

Value() [5/8]

Value ( uint32 v)

Value() [6/8]

Value ( double v)

Value() [7/8]

Value ( const char * v)

Value() [8/8]

Value ( const String & v)

Member Function Documentation

index()

constexpr Type index ( ) const
constexpr

count()

size_t count ( ) const

Number of elements in a RECORD or ARRAY Value.

as_int()

int64 as_int ( ) const

Convert Value to int64 or return 0.

as_double()

double as_double ( ) const

Convert Value to double or return 0.

as_string()

String as_string ( ) const

Convert Value to a string, not very useful for RECORD or ARRAY.

as_array()

const ValueS & as_array ( ) const

Retrive a non-empty array if Value contains a non-empty array.

as_record()

const ValueR & as_record ( ) const

repr()

String repr ( ) const

Convert Value to a string representation, useful for debugging.

keys()

StringS keys ( ) const

List the field names of a RECORD Value.

has()

bool has ( const String & key) const

Check for a named field in a RECORD.

filter()

void filter ( const std::function< bool(const ValueField &)> & pred)

Recursively purge/remove RECORD elements iff to `pred (recordfield) == true`.

is_numeric()

bool is_numeric ( bool boolisnumeric = true) const

Checks if Value is a DOUBLE, INT64, or BOOL.

is_string()

bool is_string ( ) const

operator=() [1/12]

void operator= ( bool v)

operator=() [2/12]

void operator= ( int64 v)

operator=() [3/12]

void operator= ( int32 v)

operator=() [4/12]

void operator= ( uint32 v)

operator=() [5/12]

void operator= ( double v)

operator=() [6/12]

void operator= ( const char * v)

operator=() [7/12]

void operator= ( const String & v)

operator=() [8/12]

void operator= ( const ValueS & v)

operator=() [9/12]

void operator= ( ValueS && v)

operator=() [10/12]

void operator= ( const ValueR & v)

operator=() [11/12]

void operator= ( ValueR && v)

operator=() [12/12]

void operator= ( const InstanceP & v)

operator[]() [1/4]

Value & operator[] ( size_t i)

operator[]() [2/4]

const Value & operator[] ( size_t i) const

operator[]() [3/4]

Value & operator[] ( const String & name)

operator[]() [4/4]

const Value & operator[] ( const String & name) const

operator==()

bool operator== ( const Value & other) const

operator!=()

bool operator!= ( const Value & other) const

Member Data Documentation

empty_value

const Value empty_value
static