Belle II Software development
ZMQLogger::toJSON Struct Reference

Visitor Helper for converting a variant value into a JSON string. More...

Public Member Functions

std::string operator() (long value)
 just stringify longs
 
std::string operator() (double value)
 just stringify doubles
 
std::string operator() (const std::string &value)
 escape strings if needed and surround by "
 

Detailed Description

Visitor Helper for converting a variant value into a JSON string.

Definition at line 65 of file ZMQLogger.h.

Member Function Documentation

◆ operator()() [1/3]

std::string operator() ( const std::string &  value)

escape strings if needed and surround by "

Definition at line 59 of file ZMQLogger.cc.

60{
61 return "\"" + boost::property_tree::json_parser::create_escapes(value) + "\"";
62}

◆ operator()() [2/3]

std::string operator() ( double  value)

just stringify doubles

Definition at line 54 of file ZMQLogger.cc.

55{
56 return std::to_string(value);
57}

◆ operator()() [3/3]

std::string operator() ( long  value)

just stringify longs

Definition at line 49 of file ZMQLogger.cc.

50{
51 return std::to_string(value);
52}

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