cql3: add static function to_double to property_definitions

Useful for retrieving a double value from a string.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
This commit is contained in:
Raphael S. Carvalho
2015-07-23 14:42:15 -03:00
parent 0ff7ed8a48
commit e3d3d9be71

View File

@@ -137,6 +137,10 @@ public:
// Return a property value, typed as a double
double get_double(sstring key, double default_value) const {
auto value = get_simple(key);
return to_double(key, value, default_value);
}
static double to_double(sstring key, std::experimental::optional<sstring> value, double default_value) {
if (value) {
auto val = value.value();
try {