CatapultServer  v0.5.0.1 (Elephant)
catapult::tools::KeyValueOutputBuilder Class Reference

Public Member Functions

void add (const std::string &key, const std::string &value)
 Adds a key with a string value. More...
 
void add (const std::string &key, const std::vector< std::string > &values, const std::string &separator)
 Adds a key with multiple values that should be joined with separator. More...
 
template<size_t N>
void add (const std::string &key, const std::array< uint8_t, N > &value)
 Adds a key with a hex-formatted array value. More...
 
template<typename T >
void add (const std::string &key, const T &value)
 Adds a key with a default formatted value. More...
 
std::string str (const std::string &prefix) const
 

Private Member Functions

int maxKeySize () const
 

Private Attributes

std::vector< std::pair< std::string, std::string > > m_keyValuePairs
 

Detailed Description

Builder for aggregating and formatting key value pairs for output.

Note
Empty values will be ignored and not output.

Member Function Documentation

◆ add() [1/4]

template<size_t N>
void catapult::tools::KeyValueOutputBuilder::add ( const std::string &  key,
const std::array< uint8_t, N > &  value 
)
inline

Adds a key with a hex-formatted array value.

Here is the call graph for this function:

◆ add() [2/4]

void catapult::tools::KeyValueOutputBuilder::add ( const std::string &  key,
const std::string &  value 
)

Adds a key with a string value.

Here is the caller graph for this function:

◆ add() [3/4]

void catapult::tools::KeyValueOutputBuilder::add ( const std::string &  key,
const std::vector< std::string > &  values,
const std::string &  separator 
)

Adds a key with multiple values that should be joined with separator.

Here is the call graph for this function:

◆ add() [4/4]

template<typename T >
void catapult::tools::KeyValueOutputBuilder::add ( const std::string &  key,
const T &  value 
)
inline

Adds a key with a default formatted value.

Here is the call graph for this function:

◆ maxKeySize()

int catapult::tools::KeyValueOutputBuilder::maxKeySize ( ) const
private
Here is the caller graph for this function:

◆ str()

std::string catapult::tools::KeyValueOutputBuilder::str ( const std::string &  prefix) const

Gets a string composed of all formatted key value pairs. Each pair is on its own line and prefixed with prefix.

Here is the call graph for this function:

Member Data Documentation

◆ m_keyValuePairs

std::vector<std::pair<std::string, std::string> > catapult::tools::KeyValueOutputBuilder::m_keyValuePairs
private

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