MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / wildCardMatch

Method wildCardMatch

src/thundersvm/util/log.cpp:782–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

780// Str
781
782 bool Str::wildCardMatch(const char* str, const char* pattern) {
783 while (*pattern) {
784 switch (*pattern) {
785 case '?':
786 if (!*str)
787 return false;
788 ++str;
789 ++pattern;
790 break;
791 case '*':
792 if (wildCardMatch(str, pattern + 1))
793 return true;
794 if (*str && wildCardMatch(str + 1, pattern))
795 return true;
796 return false;
797 default:
798 if (*str++ != *pattern++)
799 return false;
800 break;
801 }
802 }
803 return !*str && !*pattern;
804 }
805
806 std::string& Str::ltrim(std::string& str) {
807 str.erase(str.begin(), std::find_if(str.begin(), str.end(), [](char c) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected