MCPcopy Create free account
hub / github.com/anjo76/angelscript / FindLast

Method FindLast

sdk/angelscript/source/as_string.cpp:366–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366int asCString::FindLast(const char *str, int *count) const
367{
368 // There is no strstr that starts from the end, so
369 // we'll iterate until we find the last occurrance.
370 // This shouldn't cause a performance problem because
371 // it is not expected that this will be done very often,
372 // and then only on quite short strings anyway.
373
374 if( count ) *count = 0;
375
376 const char *last = 0;
377 const char *curr = AddressOf()-1;
378 while( (curr = strstr(curr+1, str)) != 0 )
379 {
380 if( count ) (*count)++;
381 last = curr;
382 }
383
384 if( last )
385 return int(last - AddressOf());
386
387 return -1;
388}
389
390//-----------------------------------------------------------------------------
391// Helper functions

Callers 10

EndMethod · 0.80
WriteSummaryMethod · 0.80
DetermineSingleFuncMethod · 0.80
ImplicitConvObjectRefMethod · 0.80
SymbolLookupMethod · 0.80
CompileFunctionCallMethod · 0.80
GetNameSpaceByStringMethod · 0.80
GetParentNameSpaceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected