6#ifndef ACTIVE_SETTING_BOOL_VALUE
7#define ACTIVE_SETTING_BOOL_VALUE
9#include "Active/Setting/Values/ValueBase.h"
10#include "Active/Utility/MathFunctions.h"
66 data = !math::isZero(val);
76 if ((val.lowercase() ==
"true") || (val.lowercase() ==
"1"))
78 else if ((val.lowercase() ==
"false") || (val.lowercase() ==
"0"))
103 BoolValue::operator bool()
const {
return data; }
109 BoolValue::operator int32_t()
const {
return data ? 1 : 0; }
115 BoolValue::operator uint32_t()
const {
return data ? 1 : 0; }
121 BoolValue::operator int64_t()
const {
return data ? 1 : 0; }
127 BoolValue::operator double()
const {
return data ? 1.0 : 0.0; }
133 BoolValue::operator utility::String()
const {
return data ?
"true" :
"false"; }
Definition ValueBase.h:21
virtual bool isNull() const override
Definition ValueBase.h:193
virtual Value & operator=(const Value &val) override
Definition ValueBase.h:85
T data
The value data.
Definition ValueBase.h:58
virtual Type getType() const override
Definition ValueBase.h:198
Type
Supported value types (broad groups, e.g. int32_t and int64_t are both intType)
Definition Value.h:51
Status status
The value status.
Definition Value.h:100
Definition Transportable.h:13