28 std::vector<std::string>
29 stringSplit(
char const* str,
size_t len,
char sep,
size_t max = -1);
31 std::vector<std::string>
32 stringSplit(
char const* str,
char sep,
size_t max = -1);
34 std::vector<std::string>
35 stringSplit(std::string
const& str,
char sep,
size_t max = -1);
38 std::string
joinVector(std::vector<T>
const& v,
char sep);
40 bool startsWith(std::string
const& str, std::string
const& prefix);
42 bool endsWith(std::string
const& str, std::string
const& suffix);
45 bool gmatch(std::string_view str, std::string_view pattern);
48 bool gmatchi(std::string_view str, std::string_view pattern);
55 lowered.resize(str.size());
56 std::transform(str.begin(), str.end(), lowered.begin(), tolower);
61 std::string
joinVector(std::vector<T>
const& v,
char sep) {
62 std::ostringstream oss;
63 for (
size_t i = 0; i < v.size(); i++) {
std::string stringToLower(T &&str)
Definition: str.h:53
bool endsWith(std::string const &str, std::string const &suffix)
Definition: str.cpp:194
bool gmatchi(std::string_view str, std::string_view pattern)
Glob-style pattern matching (case-insensitive)
Definition: str.cpp:206
bool gmatch(std::string_view str, std::string_view pattern)
Glob-style pattern matching.
Definition: str.cpp:201
std::string joinVector(std::vector< T > const &v, char sep)
Definition: str.h:61
General utilities.
Definition: assert.cpp:7
std::vector< std::string > stringSplit(char const *str, size_t len, char sep, size_t max)
Split a string into parts deliminted by the given separtion character.
Definition: str.cpp:152
bool startsWith(std::string const &str, std::string const &prefix)
Definition: str.cpp:187