MCPcopy Create free account
hub / github.com/crownengine/crown / find

Method find

3rdparty/bx/src/commandline.cpp:265–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263 }
264
265 const char* CommandLine::find(int32_t _skip, const char _short, const char* _long, int32_t _numParams) const
266 {
267 for (int32_t ii = 0; ii < m_argc && 0 != strCmp(m_argv[ii], "--"); ++ii)
268 {
269 const char* arg = m_argv[ii];
270 if ('-' == *arg)
271 {
272 ++arg;
273 if (_short == *arg)
274 {
275 if (1 == strLen(arg) )
276 {
277 if (0 == _skip)
278 {
279 if (0 == _numParams)
280 {
281 return "";
282 }
283 else if (ii+_numParams < m_argc
284 && '-' != *m_argv[ii+1] )
285 {
286 return m_argv[ii+1];
287 }
288
289 return NULL;
290 }
291
292 --_skip;
293 ii += _numParams;
294 }
295 }
296 else if (NULL != _long
297 && '-' == *arg
298 && 0 == strCmpI(arg+1, _long) )
299 {
300 if (0 == _skip)
301 {
302 if (0 == _numParams)
303 {
304 return "";
305 }
306 else if (ii+_numParams < m_argc
307 && '-' != *m_argv[ii+1] )
308 {
309 return m_argv[ii+1];
310 }
311
312 return NULL;
313 }
314
315 --_skip;
316 ii += _numParams;
317 }
318 }
319 }
320
321 return NULL;
322 }

Callers 6

ChannelsInLayerFunction · 0.45
LoadConfigFromFileFunction · 0.45
FillCPUCapsFunction · 0.45
SearchDataFilesFunction · 0.45
theme.jsFile · 0.45
dispatch_visitMethod · 0.45

Calls 3

strCmpFunction · 0.85
strLenFunction · 0.85
strCmpIFunction · 0.85

Tested by

no test coverage detected