1 #define SCARAB_API_EXPORTS 12 LOGGER( dlog,
"parsable" );
22 if( t_val_pos != std::string::npos )
24 add_next( *
this, a_addr_with_value.substr( 0, t_val_pos ), a_addr_with_value.substr( t_val_pos + 1 ) );
28 add_next( *
this, a_addr_with_value,
"" );
49 if( t_div_pos == a_addr.npos )
54 a_parent.
add( a_addr, std::move(
param()) );
55 LDEBUG( dlog,
"Parsed value as NULL" << *
this );
58 else if( a_value ==
"true" )
61 LDEBUG( dlog,
"Parsed value (" << a_value <<
") as bool(true)" << *
this );
63 else if( a_value ==
"false" )
66 LDEBUG( dlog,
"Parsed value (" << a_value <<
") as bool(false):" << *
this );
74 std::stringstream t_conv_double( a_value );
75 if( a_value.find(
'.' ) == a_value.rfind(
'.' ) &&
76 a_value.find(
'-' ) == a_value.rfind(
'-' ) &&
77 ! (t_conv_double >> t_double).fail() )
80 if( a_value.find(
'.' ) != std::string::npos ||
81 a_value.find(
'e' ) != std::string::npos ||
82 a_value.find(
'E' ) != std::string::npos )
86 LDEBUG( dlog,
"Parsed value (" << a_value <<
") as double(" << t_double <<
"):" << *
this );
88 else if( a_value[ 0 ] ==
'-' )
91 a_parent.
add( a_addr, std::move(
param_value( (int64_t)t_double )) );
92 LDEBUG( dlog,
"Parsed value (" << a_value <<
") as int(" << (int64_t)t_double <<
"):" << *
this );
97 a_parent.
add( a_addr, std::move(
param_value( (uint64_t)t_double )) );
98 LDEBUG( dlog,
"Parsed value (" << a_value <<
") as uint(" << (uint64_t)t_double <<
");" << *
this );
105 LDEBUG( dlog,
"Parsed value (" << a_value <<
") as a string:" << *
this );
111 a_parent.
add( a_addr.substr( 0, t_div_pos ), std::move(t_new_node) );
112 add_next( t_new_node, a_addr.substr( t_div_pos + 1 ), a_value );
void add_next(param_node &a_parent, const std::string &a_addr, const std::string &a_value)
Contains the logger class and macros, based on Kasper's KLogger class.
static const char f_node_separator
static const char f_value_separator
bool add(const std::string &a_name, const param &a_value)
Areates a copy of a_value.
LOGGER(mtlog,"authentication")