StringUtil class Simple utility class for string operations.
More...
#include <Utils.h>
|
template<typename T > |
static std::string | typeToString (const T &var) |
| Convert a type to string. More...
|
|
template<typename T > |
static std::vector< std::string > | typeToString (const std::vector< T > &vars) |
| Convert a vector of type to vector of string. More...
|
|
template<typename T > |
static T | stringToType (const std::string &str) |
| Convert a variable to string. More...
|
|
template<typename T > |
static std::vector< T > | stringToType (const std::vector< std::string > &strs) |
| Convert a string vector to a vector of specified type. More...
|
|
template<typename T > |
static std::vector< T > | split (const std::string &inputString, const std::string &delimiter=" ") |
| Split the string with the corresponding delimiter. More...
|
|
template<typename T > |
static std::string | join (const T &input, const std::string &delimiter=" ") |
| Weird overload for scalar types. More...
|
|
template<typename T > |
static std::string | join (const std::vector< T > &input, const std::string &delimiter=" ") |
| Join the input values from the vector with the corresponding delimiter and returns a string representation of it. More...
|
|
StringUtil class Simple utility class for string operations.
Definition at line 157 of file Utils.h.
◆ join() [1/2]
template<typename T >
std::string marlinmt::StringUtil::join |
( |
const T & |
input, |
|
|
const std::string & |
delimiter = " " |
|
) |
| |
|
inlinestatic |
Weird overload for scalar types.
Just returns the conversion to string. See overload version with vector instead.
- Parameters
-
input | the input value |
delimiter | the string delimiter (unused here) |
Definition at line 320 of file Utils.h.
◆ join() [2/2]
template<typename T >
std::string marlinmt::StringUtil::join |
( |
const std::vector< T > & |
input, |
|
|
const std::string & |
delimiter = " " |
|
) |
| |
|
inlinestatic |
Join the input values from the vector with the corresponding delimiter and returns a string representation of it.
- Parameters
-
input | the input vector or values to join |
delimiter | the string delimiter |
Definition at line 327 of file Utils.h.
◆ split()
template<typename T >
std::vector< T > marlinmt::StringUtil::split |
( |
const std::string & |
inputString, |
|
|
const std::string & |
delimiter = " " |
|
) |
| |
|
inlinestatic |
Split the string with the corresponding delimiter.
- Parameters
-
inputString | the input string to split |
delimiter | the string delimiter |
Definition at line 303 of file Utils.h.
References marlinmt::book::Flags::value().
◆ stringToType() [1/4]
template<typename T >
T marlinmt::StringUtil::stringToType |
( |
const std::string & |
str | ) |
|
|
inlinestatic |
Convert a variable to string.
- Parameters
-
Definition at line 263 of file Utils.h.
◆ stringToType() [2/4]
template<typename T >
std::vector< T > marlinmt::StringUtil::stringToType |
( |
const std::vector< std::string > & |
strs | ) |
|
|
inlinestatic |
Convert a string vector to a vector of specified type.
- Parameters
-
strs | the string vector to convert |
Definition at line 291 of file Utils.h.
◆ stringToType() [3/4]
template<>
std::string marlinmt::StringUtil::stringToType |
( |
const std::string & |
str | ) |
|
|
inline |
◆ stringToType() [4/4]
template<>
bool marlinmt::StringUtil::stringToType |
( |
const std::string & |
str | ) |
|
|
inline |
◆ typeToString() [1/4]
template<typename T >
std::string marlinmt::StringUtil::typeToString |
( |
const T & |
var | ) |
|
|
inlinestatic |
Convert a type to string.
- Parameters
-
Definition at line 226 of file Utils.h.
◆ typeToString() [2/4]
template<typename T >
std::vector< std::string > marlinmt::StringUtil::typeToString |
( |
const std::vector< T > & |
vars | ) |
|
|
inlinestatic |
Convert a vector of type to vector of string.
- Parameters
-
vars | the values to convert |
Definition at line 251 of file Utils.h.
◆ typeToString() [3/4]
template<>
std::string marlinmt::StringUtil::typeToString |
( |
const std::string & |
var | ) |
|
|
inline |
◆ typeToString() [4/4]
template<>
std::string marlinmt::StringUtil::typeToString |
( |
const bool & |
var | ) |
|
|
inline |
The documentation for this class was generated from the following file: