rivet is hosted by Hepforge, IPPP Durham
Utils.hh File Reference
#include <Rivet/Math/Math.hh>
#include <Rivet/Tools/RivetSTL.hh>
#include <Rivet/Tools/RivetBoost.hh>
#include <cctype>
#include <algorithm>
#include <cerrno>
Include dependency graph for Utils.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Rivet

Functions

String utils
template<typename T >
std::string to_str (const T &x)
 Convert any object to a string.
template<typename T >
std::string toString (const T &x)
 Convert any object to a string.
int nocase_cmp (const std::string &s1, const std::string &s2)
bool nocase_equals (const std::string &s1, const std::string &s2)
 Case-insensitive string equality function.
std::string toLower (const std::string &s)
std::string toUpper (const std::string &s)
bool startsWith (const std::string &s, const std::string &start)
 Check whether a string start is found at the start of s.
bool endsWith (const std::string &s, const std::string &end)
 Check whether a string end is found at the end of s.
template<typename T >
std::string join (const vector< T > &v, const std::string &sep=" ")
 Make a string containing the string representations of each item in v, separated by sep.
template<typename T >
std::string join (const set< T > &s, const std::string &sep=" ")
 Make a string containing the string representations of each item in s, separated by sep.
Path utils
vector< std::string > pathsplit (const std::string &path)
 Split a path string with colon delimiters.
std::string pathjoin (const vector< std::string > &paths)
 Join several filesystem paths together with the standard ':' delimiter.
Container utils
template<typename CONTAINER , typename FN >
bool any (const CONTAINER &c, const FN &f)
 Return true if f(x) is true for any x in container c, otherwise false.
template<typename CONTAINER , typename FN >
bool all (const CONTAINER &c, const FN &f)
 Return true if f(x) is true for all x in container c, otherwise false.