YARP
Yet Another Robot Platform
yarp::conf::string Namespace Reference

Functions

template<typename ContainerT = std::vector<std::string>>
ContainerT split (const typename ContainerT::value_type &s, std::basic_regex< typename ContainerT::value_type::value_type > regex)
 Utility to split a string by a separator, into a vector of strings. More...
 
template<typename ContainerT = std::vector<std::string>>
ContainerT split (const typename ContainerT::value_type &s, typename ContainerT::value_type separator)
 Utility to split a string by a separator, into a vector of strings. More...
 
template<typename ContainerT = std::vector<std::string>>
ContainerT split (const typename ContainerT::value_type &s, typename ContainerT::value_type::value_type separator)
 Utility to split a string by a separator, into a vector of strings. More...
 
template<typename ContainerT = std::vector<std::string>>
ContainerT::value_type join (typename ContainerT::const_iterator begin, typename ContainerT::const_iterator end, const typename ContainerT::value_type &separator=", ")
 Utility to join the elements in a container to a single string separated by a separator. More...
 
template<typename ContainerT = std::vector<std::string>>
ContainerT::value_type join (typename ContainerT::const_iterator begin, typename ContainerT::const_iterator end, const typename ContainerT::value_type::value_type &separator)
 Utility to join the elements in a container to a single string separated by a separator. More...
 

Function Documentation

◆ join() [1/2]

template<typename ContainerT = std::vector<std::string>>
ContainerT::value_type yarp::conf::string::join ( typename ContainerT::const_iterator  begin,
typename ContainerT::const_iterator  end,
const typename ContainerT::value_type &  separator = ", " 
)
inline

Utility to join the elements in a container to a single string separated by a separator.

Template Parameters
ContainerTthe type of the container
Parameters
beginan iterator to the first element of the container
endan iterator to the end of the container
separatora string to append between elements
Returns
a strings containing all the token separated by separator

Definition at line 93 of file string.h.

◆ join() [2/2]

template<typename ContainerT = std::vector<std::string>>
ContainerT::value_type yarp::conf::string::join ( typename ContainerT::const_iterator  begin,
typename ContainerT::const_iterator  end,
const typename ContainerT::value_type::value_type &  separator 
)
inline

Utility to join the elements in a container to a single string separated by a separator.

Template Parameters
ContainerTthe type of the container
Parameters
beginan iterator to the first element of the container
endan iterator to the end of the container
separatora character to append between elements
Returns
a strings containing all the token separated by separator

Definition at line 123 of file string.h.

◆ split() [1/3]

template<typename ContainerT = std::vector<std::string>>
ContainerT yarp::conf::string::split ( const typename ContainerT::value_type &  s,
std::basic_regex< typename ContainerT::value_type::value_type >  regex 
)
inline

Utility to split a string by a separator, into a vector of strings.

Template Parameters
ContainerTthe type of the container to return
Parameters
sthe string to split
regexa regular expression that is used as separator to separate the elements
Returns
a vector of strings each containing one token

Definition at line 27 of file string.h.

◆ split() [2/3]

template<typename ContainerT = std::vector<std::string>>
ContainerT yarp::conf::string::split ( const typename ContainerT::value_type &  s,
typename ContainerT::value_type  separator 
)
inline

Utility to split a string by a separator, into a vector of strings.

Template Parameters
ContainerTthe type of the container to return
Parameters
sthe string to split
separatora string of characters separating the elements
Returns
a vector of strings each containing one token

Definition at line 51 of file string.h.

◆ split() [3/3]

template<typename ContainerT = std::vector<std::string>>
ContainerT yarp::conf::string::split ( const typename ContainerT::value_type &  s,
typename ContainerT::value_type::value_type  separator 
)
inline

Utility to split a string by a separator, into a vector of strings.

Template Parameters
ContainerTthe type of the container to return
Parameters
sthe string to split
separatora character separating the elements
Returns
a vector of strings each containing one token

Definition at line 74 of file string.h.