Static Public Member Functions | Static Public Attributes | List of all members
TypeUtils Struct Reference
Collaboration diagram for TypeUtils:
Collaboration graph
[legend]

Static Public Member Functions

static const std::type_info & guessType (const std::string &value)
 Given a string, check if it could be stored as int or double instead of std::string . More...
 
template<class C >
static const std::type_info & guessArrayType (const C &container)
 Given a vector or list of strings, suggest a matching storage type (int, double, std::string). More...
 

Static Public Attributes

static const drain::RegExp trueRegExp
 
static const drain::RegExp falseRegExp
 
static const drain::RegExp numeralRegExp
 

Member Function Documentation

◆ guessArrayType()

const std::type_info & guessArrayType ( const C &  container)
static

Given a vector or list of strings, suggest a matching storage type (int, double, std::string).

Template Parameters
C- contrainer, esp. std::list or std::vector

Contains at least one string

Contains at least one decimal value

Contains only true and \false values

◆ guessType()

const std::type_info & guessType ( const std::string &  value)
static

Given a string, check if it could be stored as int or double instead of std::string .

Returns
- std::type_info in priority order: int, double, std::string.

Testing string '-123.456e+789' yields

0 = -123.456e+789 1 = '-123' 2 = '.456' 3 = 'e+789'


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