WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
WireCell::String Namespace Reference

Functions

std::vector< std::string > split (const std::string &in, const std::string &delim=":")
 
std::pair< std::string, std::string > parse_pair (const std::string &in, const std::string &delim=":")
 
template<typename TYPE >
boost::format format_flatten (boost::format f, TYPE obj)
 
template<typename TYPE , typename... MORE>
boost::format format_flatten (boost::format start, TYPE o, MORE... objs)
 
boost::format format_flatten (boost::format f)
 
template<typename... TYPES>
std::string format (const std::string &form, TYPES... objs)
 
template<typename T >
std::string stringify (T obj)
 

Function Documentation

◆ format()

template<typename... TYPES>
std::string WireCell::String::format ( const std::string &  form,
TYPES...  objs 
)

The format() function provides an sprintf() like function. It's a wrapper on boost::format() but returns a string instead of a stream and has function calling semantics instead of the "%" list. Use like:

int a=42; std::string foo = "bar"; std::string msg = format("the answer to %s is %d", foo, a);

Definition at line 45 of file String.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ format_flatten() [1/3]

template<typename TYPE >
boost::format WireCell::String::format_flatten ( boost::format  f,
TYPE  obj 
)

Definition at line 22 of file String.h.

Here is the caller graph for this function:

◆ format_flatten() [2/3]

template<typename TYPE , typename... MORE>
boost::format WireCell::String::format_flatten ( boost::format  start,
TYPE  o,
MORE...  objs 
)

Definition at line 26 of file String.h.

Here is the call graph for this function:

◆ format_flatten() [3/3]

boost::format WireCell::String::format_flatten ( boost::format  f)
inline

Definition at line 30 of file String.h.

◆ parse_pair()

std::pair< std::string, std::string > WireCell::String::parse_pair ( const std::string &  in,
const std::string &  delim = ":" 
)

Definition at line 15 of file String.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ split()

std::vector< std::string > WireCell::String::split ( const std::string &  in,
const std::string &  delim = ":" 
)

Definition at line 5 of file String.cxx.

Here is the caller graph for this function:

◆ stringify()

template<typename T >
std::string WireCell::String::stringify ( obj)

Definition at line 55 of file String.h.