ConfigDB::Number Class Reference

Base-10 floating-point storage format. More...

#include <Number.h>

Public Member Functions

 Number ()=default
 
constexpr Number (const number_t &number)
 
constexpr Number (const const_number_t &number)
 
constexpr Number (const Number &number)=default
 
constexpr Number (double value)
 
constexpr Number (int64_t value)
 
constexpr Number (int value)
 
constexpr Number (unsigned int value)
 
 Number (const char *value, unsigned length)
 Parse a number from a string. More...
 
 Number (const char *value)
 
 Number (const String &str)
 
bool operator< (const Number &other) const
 
bool operator> (const Number &other) const
 
bool operator== (const number_t &other) const
 
bool operator!= (const number_t &other) const
 
int compare (const Number &other) const
 
size_t printTo (Print &p) const
 
double asFloat () const
 
int64_t asInt64 () const
 
String toString () const
 
 operator String () const
 
constexpr operator number_t () const
 

Detailed Description

Base-10 floating-point storage format.

The base number_t type cannot have constructors so this class includes those for ease of application use.

Note
Structure is packed to accommodate use in generated class structures

Constructor & Destructor Documentation

◆ Number() [1/11]

ConfigDB::Number::Number ( )
default

◆ Number() [2/11]

constexpr ConfigDB::Number::Number ( const number_t number)
inlineconstexpr

◆ Number() [3/11]

constexpr ConfigDB::Number::Number ( const const_number_t number)
inlineconstexpr

◆ Number() [4/11]

constexpr ConfigDB::Number::Number ( const Number number)
constexprdefault

◆ Number() [5/11]

constexpr ConfigDB::Number::Number ( double  value)
inlineconstexpr

◆ Number() [6/11]

constexpr ConfigDB::Number::Number ( int64_t  value)
inlineconstexpr

◆ Number() [7/11]

constexpr ConfigDB::Number::Number ( int  value)
inlineconstexpr

◆ Number() [8/11]

constexpr ConfigDB::Number::Number ( unsigned int  value)
inlineconstexpr

◆ Number() [9/11]

ConfigDB::Number::Number ( const char *  value,
unsigned  length 
)
inline

Parse a number from a string.

◆ Number() [10/11]

ConfigDB::Number::Number ( const char *  value)
inline

◆ Number() [11/11]

ConfigDB::Number::Number ( const String str)
inline

Member Function Documentation

◆ asFloat()

double ConfigDB::Number::asFloat ( ) const
inline

◆ asInt64()

int64_t ConfigDB::Number::asInt64 ( ) const
inline

◆ compare()

int ConfigDB::Number::compare ( const Number other) const
inline

◆ operator number_t()

constexpr ConfigDB::Number::operator number_t ( ) const
inlineconstexpr

◆ operator String()

ConfigDB::Number::operator String ( ) const
inlineexplicit

◆ operator!=()

bool ConfigDB::Number::operator!= ( const number_t other) const
inline

◆ operator<()

bool ConfigDB::Number::operator< ( const Number other) const
inline

◆ operator==()

bool ConfigDB::Number::operator== ( const number_t other) const
inline

◆ operator>()

bool ConfigDB::Number::operator> ( const Number other) const
inline

◆ printTo()

size_t ConfigDB::Number::printTo ( Print p) const
inline

◆ toString()

String ConfigDB::Number::toString ( ) const
inline

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