OpenM++ runtime library (libopenm)
openm::ValueFormatter Class Reference

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

Inheritance diagram for openm::ValueFormatter:
Collaboration diagram for openm::ValueFormatter:

Public Member Functions

 ValueFormatter (const type_info &i_type, const char *i_doubleFormat="")
 false boolean value as string More...
 
const char * formatValue (const void *i_value, bool i_isNull=false) override
 IValueFormatter interface implementation: convert value to string using snprintf. More...
 

Static Public Attributes

static const char * nullValueString = "null"
 
static const char * trueValueString = "true"
 NULL value as string.
 
static const char * falseValueString = "false"
 true boolean value as string
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ValueFormatter()

ValueFormatter::ValueFormatter ( const type_info &  i_type,
const char *  i_doubleFormat = "" 
)

false boolean value as string

new converter for value column, use std::string type for VARCHAR input parameters

new converter for value column.

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

Member Function Documentation

◆ formatValue()

const char * ValueFormatter::formatValue ( const void *  i_value,
bool  i_isNull = false 
)
overridevirtual

IValueFormatter interface implementation: convert value to string using snprintf.

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 files: