Rivet API documentation
![]() |
Rivet 4.1.3
|
Classes | |
| struct | Rivet::bad_lexical_cast |
| Exception class for throwing from lexical_cast when a parse goes wrong. More... | |
Functions | |
| template<typename T, typename U> | |
| T | Rivet::lexical_cast (const U &in) |
| Convert between any types via stringstream. | |
| template<typename T> | |
| string | Rivet::to_str (const T &x) |
| Convert any object to a string. | |
| string & | Rivet::ireplace_first (string &str, const string &patt, const string &repl) |
| Replace the first instance of patt with repl in-place. | |
| template<typename T> | |
| string | Rivet::toString (T &&x) |
| Convert any object to a string. | |
| template<typename T> | |
| string | Rivet::toStr (T &&x) |
| Perfect-forwarding alias for to_str() with a more Rivet-user-facing name. | |
| string | Rivet::replace_first (string str, const string &patt, const string &repl) |
| Replace the first instance of patt with repl. | |
| string & | Rivet::ireplace_all (string &str, const string &patt, const string &repl) |
| Replace all instances of patt with repl in-place. | |
| string | Rivet::replace_all (string str, const string &patt, const string &repl) |
| Replace all instances of patt with repl. | |
| int | Rivet::nocase_cmp (const string &s1, const string &s2) |
| Case-insensitive string comparison function. | |
| bool | Rivet::nocase_equals (const string &s1, const string &s2) |
| Case-insensitive string equality function. | |
| string | Rivet::toLower (const string &s) |
| Convert a string to lower-case. | |
| string | Rivet::toUpper (const string &s) |
| Convert a string to upper-case. | |
| bool | Rivet::startsWith (const string &s, const string &start) |
| Check whether a string start is found at the start of s. | |
| bool | Rivet::endsWith (const string &s, const string &end) |
| Check whether a string end is found at the end of s. | |
| string | Rivet::strcat () |
| template<typename T, typename... Ts> | |
| string | Rivet::strcat (T value, Ts... fargs) |
| Make a string containing the concatenated string representations of each item in the variadic list. | |
| template<typename T> | |
| string | Rivet::join (const vector< T > &v, const string &sep=" ") |
| Make a string containing the string representations of each item in v, separated by sep. | |
| template<> | |
| string | Rivet::join (const vector< string > &v, const string &sep) |
| Make a string containing the string representations of each item in v, separated by sep. | |
| template<typename T> | |
| string | Rivet::join (const set< T > &s, const string &sep=" ") |
| Make a string containing the string representations of each item in s, separated by sep. | |
| template<> | |
| string | Rivet::join (const set< string > &s, const string &sep) |
| Make a string containing the string representations of each item in s, separated by sep. | |
| vector< string > | Rivet::split (const string &s, const string &sep) |
| Split a string on a specified separator string. | |
| string | Rivet::lpad (const string &s, size_t width, const string &padchar=" ") |
| Left-pad the given string s to width width. | |
| string | Rivet::rpad (const string &s, size_t width, const string &padchar=" ") |
| Right-pad the given string s to width width. | |
Detailed Description
Function Documentation
◆ ireplace_all()
Replace all instances of patt with repl in-place.
- Note
- Finding is interleaved with replacement, so the second search happens after first replacement, etc. This could lead to infinite loops and other counterintuitive behaviours if not careful.
References contains().
Referenced by replace_all().
◆ replace_all()
Replace all instances of patt with repl.
- Note
- Finding is interleaved with replacement, so the second search happens after first replacement, etc. This could lead to infinite loops and other counterintuitive behaviours if not careful.
References ireplace_all().
◆ to_str()
template<typename T>
|
inline |
Convert any object to a string.
Just a convenience wrapper for the more general Boost lexical_cast
References lexical_cast().
Referenced by join(), join(), Rivet::FourMomentum::setPE(), Rivet::FourMomentum::setPM(), toStr(), toString(), and Rivet::VetoedFinalState::vetoFinalState().
◆ toString()
Generated on for Rivet by
