MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / isMatch

Method isMatch

Engine/source/core/strings/findMatch.cpp:101–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101bool FindMatch::isMatch( const char *exp, const char *str, bool caseSensitive )
102{
103 if (str == NULL || exp == NULL)
104 return false;
105
106 while ( *str && ( *exp != '*' ) )
107 {
108 if ( !IsCharMatch( *exp++, *str++, caseSensitive ) )
109 return false;
110 }
111
112 const char* cp = NULL;
113 const char* mp = NULL;
114
115 while ( *str )
116 {
117 if ( *exp == '*' )
118 {
119 if ( !*++exp )
120 return true;
121
122 mp = exp;
123 cp = str+1;
124 }
125 else if ( IsCharMatch( *exp, *str, caseSensitive ) )
126 {
127 exp++;
128 str++;
129 }
130 else
131 {
132 exp = mp;
133 str = cp++;
134 }
135 }
136
137 while ( *exp == '*' )
138 exp++;
139
140 return !*exp;
141}
142
143
144bool FindMatch::isMatchMultipleExprs( const char *exps, const char *str, bool caseSensitive )

Callers

nothing calls this directly

Calls 1

IsCharMatchFunction · 0.85

Tested by

no test coverage detected