Given a glob [pattern] and a string [string], return true iff the string matches the glob. If [ignore_case] is true, the match is case-insensitive.
| 257 | // Given a glob [pattern] and a string [string], return true iff the string matches the glob. |
| 258 | // If [ignore_case] is true, the match is case-insensitive. |
| 259 | bool StringMatch(std::string_view glob, std::string_view str, bool ignore_case) { |
| 260 | bool skip_longer_matches = false; |
| 261 | return StringMatchImpl(glob, str, ignore_case, &skip_longer_matches); |
| 262 | } |
| 263 | |
| 264 | // Split a glob pattern into a literal prefix and a suffix containing wildcards. |
| 265 | // For example, if the user calls [KEYS bla*bla], this function will return {"bla", "*bla"}. |