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) |
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.
boost::format WireCell::String::format_flatten | ( | boost::format | f, |
TYPE | obj | ||
) |
boost::format WireCell::String::format_flatten | ( | boost::format | start, |
TYPE | o, | ||
MORE... | objs | ||
) |
Definition at line 26 of file String.h.
|
inline |
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.
std::vector< std::string > WireCell::String::split | ( | const std::string & | in, |
const std::string & | delim = ":" |
||
) |
Definition at line 5 of file String.cxx.
std::string WireCell::String::stringify | ( | T | obj | ) |