Belle II Software development
TokenCast< double > Struct Reference

Double specialization of TokenCast<T> the decimal point is set to '. More...

#include <ARICHDatabaseTools.h>

Public Member Functions

auto isValidChar (const unsigned char character) const noexcept -> bool
 isValidChar defines characters that are allowed for the convertion
 
auto operator() (const std::string &rToken) const -> double
 operator () converts given token to an integer.
 

Detailed Description

Double specialization of TokenCast<T> the decimal point is set to '.

'! Note: the spelication on locale is unclear need basf2 facet defs!

Definition at line 274 of file ARICHDatabaseTools.h.

Member Function Documentation

◆ isValidChar()

auto isValidChar ( const unsigned char  character) const -> bool
inlinenoexcept

isValidChar defines characters that are allowed for the convertion

Parameters
character
Returns
true if its allowed for convertion

Definition at line 280 of file ARICHDatabaseTools.h.

282 {
283 return std::isdigit(character) || (static_cast<unsigned char>('.') == character);
284 }

◆ operator()()

auto operator() ( const std::string &  rToken) const -> double
inline

operator () converts given token to an integer.

Parameters
rToken
Exceptions
invalid_argumentin case the given string is invalid for convertion
std::out_of_rangeif the given number is smaller/greater than a double.

Definition at line 294 of file ARICHDatabaseTools.h.

295 {
296 return std::stod(rToken);
297 }

The documentation for this struct was generated from the following file: