dune-common 2.9.0
|
Utility functions for std::string. More...
Functions | |
template<typename C > | |
bool | Dune::hasPrefix (const C &c, const char *prefix) |
Check whether a character container has a given prefix. | |
template<typename C > | |
bool | Dune::hasSuffix (const C &c, const char *suffix) |
Check whether a character container has a given suffix. | |
template<class... T> | |
static std::string | Dune::formatString (const std::string &s, const T &... args) |
Format values according to printf format string. | |
Utility functions for std::string.
|
static |
Format values according to printf format string.
s | The format string to be used |
args | The valued to be formatted |
This is a wrapper to std::snprintf that provides overflow save printf functionality. For up to 1000 characters a static buffer is used. If this is not sufficient a dynamic buffer of appropriate size is allocated.
bool Dune::hasPrefix | ( | const C & | c, |
const char * | prefix | ||
) |
Check whether a character container has a given prefix.
The container must support the begin() and size() methods.
bool Dune::hasSuffix | ( | const C & | c, |
const char * | suffix | ||
) |
Check whether a character container has a given suffix.
The container must support the begin() and size() methods and the const_iterator member type.