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

Method isMatch

Engine/source/core/strings/findMatch.cpp:100–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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