add Space::to_float(...), to_double(...) and to_long_double(...) methods

This commit is contained in:
2022-07-08 21:59:39 +02:00
parent 4b68eba6d2
commit a524dfa2a7
2 changed files with 25 additions and 0 deletions

View File

@@ -1277,6 +1277,27 @@ unsigned long long Space::to_ulong_long(const wchar_t * field, unsigned long lon
return space ? space->to_ulong_long() : default_value;
}
float Space::to_float(const wchar_t * field, float default_value) const
{
const Space * space = get_space(field);
return space ? space->to_float() : default_value;
}
double Space::to_double(const wchar_t * field, double default_value) const
{
const Space * space = get_space(field);
return space ? space->to_double() : default_value;
}
long double Space::to_long_double(const wchar_t * field, long double default_value) const
{
const Space * space = get_space(field);
return space ? space->to_long_double() : default_value;
}
std::string Space::to_str(const wchar_t * field, const char * default_value) const
{
const Space * space = get_space(field);