MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Search

Method Search

Source/Engine/Debug/DebugCommands.cpp:425–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425void DebugCommands::Search(StringView searchText, Array<StringView>& matches, bool startsWith)
426{
427 if (searchText.IsEmpty())
428 return;
429 PROFILE_MEM(EngineDebug);
430 // TODO: fix missing string handle on 1st command execution (command gets invalid after InitCommands due to dotnet GC or dotnet interop handles flush)
431 String searchTextCopy = searchText;
432 searchText = searchTextCopy;
433
434 EnsureInited();
435 ScopeLock lock(Locker);
436
437 if (startsWith)
438 {
439 for (auto& command : Commands)
440 {
441 if (command.Name.StartsWith(searchText, StringSearchCase::IgnoreCase))
442 {
443 matches.Add(command.Name);
444 }
445 }
446 }
447 else
448 {
449 for (auto& command : Commands)
450 {
451 if (command.Name.Contains(searchText.Get(), StringSearchCase::IgnoreCase))
452 {
453 matches.Add(command.Name);
454 }
455 }
456 }
457}
458
459void DebugCommands::InitAsync()
460{

Callers

nothing calls this directly

Calls 6

EnsureInitedFunction · 0.85
IsEmptyMethod · 0.45
StartsWithMethod · 0.45
AddMethod · 0.45
ContainsMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected