OpenM++ runtime library (libopenm)
openm::ValueFormatterBase< valueLen > Class Template Reference

false boolean value as string More...

#include <dbValue.h>

Inheritance diagram for openm::ValueFormatterBase< valueLen >:
Collaboration diagram for openm::ValueFormatterBase< valueLen >:

Public Member Functions

 ValueFormatterBase (const type_info &i_type, bool i_isSqlFormat=false, const char *i_doubleFormat="")
 converter for value column into string. More...
 
 ValueFormatterBase (const type_info &i_type, const char *i_doubleFormat="")
 converter for value column into string. More...
 
const char * formatValue (const void *i_value, bool i_isNull=false) override
 IValueFormatter interface implementation: convert value to string using snprintf. More...
 
virtual const char * formatValue (const void *i_value, bool i_isNull=false)=0
 convert value to string using snprintf. More...
 

Detailed Description

template<const size_t valueLen>
class openm::ValueFormatterBase< valueLen >

false boolean value as string

converter for value column (parameter, accumulator or expression value) to string

Constructor & Destructor Documentation

◆ ValueFormatterBase() [1/2]

template<const size_t valueLen>
openm::ValueFormatterBase< valueLen >::ValueFormatterBase ( const type_info &  i_type,
bool  i_isSqlFormat = false,
const char *  i_doubleFormat = "" 
)
inline

converter for value column into string.

Parameters
[in]i_typevalue type, use std::string type for VARCHAR values
[in]i_isSqlFormatif true then convert into SQL constant: 'quoted string values' and 1/0 for boolean values
[in]i_doubleFormatif not null or empty then printf format for float and doubles, default: %.15g

◆ ValueFormatterBase() [2/2]

template<const size_t valueLen>
openm::ValueFormatterBase< valueLen >::ValueFormatterBase ( const type_info &  i_type,
const char *  i_doubleFormat = "" 
)
inline

converter for value column into string.

Parameters
[in]i_typevalue type, use std::string type for VARCHAR values
[in]i_doubleFormatif not null or empty then printf format for float and doubles, default: %.15g

Member Function Documentation

◆ formatValue()

template<const size_t valueLen>
const char * openm::ValueFormatterBase< valueLen >::formatValue ( const void *  i_value,
bool  i_isNull = false 
)
inlineoverridevirtual

IValueFormatter interface implementation: convert value to string using snprintf.

Parameters
[in]i_valuedb-field value, casted to the target column type
[in]i_isNullif true then value is NULL and return is "null"
Returns
value converted to string, must be copied before next call.

Implements openm::IValueFormatter.


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