refactored toLower

This commit is contained in:
Phil Nash
2013-03-22 19:00:42 +00:00
parent f4254b8622
commit 6ba2057abd
5 changed files with 13 additions and 12 deletions

View File

@@ -80,9 +80,14 @@ namespace Catch {
inline bool contains( const std::string& s, const std::string& infix ) {
return s.find( infix ) != std::string::npos;
}
inline void toLower( std::string& s ) {
inline void toLowerInPlace( std::string& s ) {
std::transform( s.begin(), s.end(), s.begin(), ::tolower );
}
inline std::string toLower( std::string const& s ) {
std::string lc = s;
toLowerInPlace( lc );
return lc;
}
struct pluralise {
pluralise( std::size_t count, const std::string& label )