#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 |
double | as_double () const |
int64 | as_int () const |
const ValueR & | as_record () const |
String | as_string () const |
size_t | count () const |
void | filter (const std::function< bool(const ValueField &)> &pred) |
bool | has (const String &key) const |
constexpr Type | index () const |
bool | is_numeric (bool boolisnumeric=true) const |
bool | is_string () const |
StringS | keys () const |
bool | operator!= (const Value &other) const |
void | operator= (bool v) |
void | operator= (const char *v) |
void | operator= (const InstanceP &v) |
void | operator= (const String &v) |
void | operator= (const ValueR &v) |
void | operator= (const ValueS &v) |
void | operator= (double v) |
void | operator= (int32 v) |
void | operator= (int64 v) |
void | operator= (uint32 v) |
void | operator= (ValueR &&v) |
void | operator= (ValueS &&v) |
bool | operator== (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 |
String | repr () 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 Value | empty_value |
Value type used to interface with various property types.
enum Type |
Value | ( | ) |
Value | ( | bool | v | ) |
Value | ( | double | v | ) |
Value | ( | const char * | v | ) |
|
constexpr |
size_t count | ( | ) | const |
Number of elements in a RECORD or ARRAY Value.
double as_double | ( | ) | const |
Convert Value to double or return 0.
const ValueR & as_record | ( | ) | const |
bool has | ( | const String & | key | ) | const |
Check for a named field in a RECORD.
void filter | ( | const std::function< bool(const ValueField &)> & | pred | ) |
Recursively purge/remove RECORD elements iff to `pred (recordfield) == true`.
bool is_numeric | ( | bool | boolisnumeric = true | ) | const |
Checks if Value is a DOUBLE, INT64, or BOOL.
bool is_string | ( | ) | const |
void operator= | ( | bool | v | ) |
void operator= | ( | int64 | v | ) |
void operator= | ( | int32 | v | ) |
void operator= | ( | uint32 | v | ) |
void operator= | ( | double | v | ) |
void operator= | ( | const char * | v | ) |
void operator= | ( | const String & | v | ) |
void operator= | ( | const ValueS & | v | ) |
void operator= | ( | ValueS && | v | ) |
void operator= | ( | const ValueR & | v | ) |
void operator= | ( | ValueR && | v | ) |
void operator= | ( | const InstanceP & | v | ) |
Value & operator[] | ( | size_t | i | ) |
const Value & operator[] | ( | size_t | i | ) | const |
bool operator== | ( | const Value & | other | ) | const |
|
static |