mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added double alternative for a few Variant methods.
This commit is contained in:
parent
3533145133
commit
937d7a3d87
@ -367,6 +367,12 @@ void Variant::set_float(const float value) {
|
||||
_type = TYPE_FLOAT;
|
||||
_float = value;
|
||||
}
|
||||
void Variant::set_float(const double value) {
|
||||
clear();
|
||||
|
||||
_type = TYPE_FLOAT;
|
||||
_float = value;
|
||||
}
|
||||
void Variant::set_string(String *value, const bool copy) {
|
||||
clear();
|
||||
|
||||
@ -466,6 +472,9 @@ Variant::operator uint64_t() const {
|
||||
Variant::operator float() const {
|
||||
return to_float();
|
||||
}
|
||||
Variant::operator double() const {
|
||||
return to_float();
|
||||
}
|
||||
Variant::operator String() const {
|
||||
return to_string();
|
||||
}
|
||||
@ -567,6 +576,11 @@ Variant::Variant(const float value) {
|
||||
|
||||
_float = value;
|
||||
}
|
||||
Variant::Variant(const double value) {
|
||||
_type = TYPE_FLOAT;
|
||||
|
||||
_float = value;
|
||||
}
|
||||
Variant::Variant(String *value, bool copy) {
|
||||
_type = TYPE_NULL;
|
||||
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
void set_int(const int value);
|
||||
void set_uint(const uint64_t value);
|
||||
void set_float(const float value);
|
||||
void set_float(const double value);
|
||||
void set_string(String *value, bool copy = false);
|
||||
void set_string(const String &value, bool copy = true);
|
||||
void set_object(Object *value);
|
||||
@ -64,6 +65,7 @@ public:
|
||||
operator int() const;
|
||||
operator uint64_t() const;
|
||||
operator float() const;
|
||||
operator double() const;
|
||||
operator String() const;
|
||||
operator Object *() const;
|
||||
operator Reference *() const;
|
||||
@ -78,6 +80,7 @@ public:
|
||||
Variant(const int value);
|
||||
Variant(const uint64_t value);
|
||||
Variant(const float value);
|
||||
Variant(const double value);
|
||||
Variant(String *value, const bool copy = false);
|
||||
Variant(const String &value, const bool copy = true);
|
||||
Variant(Object *value);
|
||||
|
Loading…
Reference in New Issue
Block a user