Changed splitString to splitStringRef

Now takes and returns StringRefs
This commit is contained in:
Phil Nash 2019-04-21 20:03:44 +03:00
parent 02f13cf95a
commit 9d5d719868
5 changed files with 13 additions and 10 deletions

View file

@ -22,8 +22,10 @@ namespace Catch {
void toLowerInPlace( std::string& s );
std::string toLower( std::string const& s );
std::string trim( std::string const& str );
// !!! Be aware, returns refs into original string - make sure original string outlives them
std::vector<StringRef> splitStringRef( StringRef str, char delimiter );
bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
std::vector<std::string> splitString( StringRef str, char delimiter );
struct pluralise {
pluralise( std::size_t count, std::string const& label );