| 473 | } |
| 474 | |
| 475 | DebugCommands::CommandFlags DebugCommands::GetCommandFlags(StringView command) |
| 476 | { |
| 477 | CommandFlags result = CommandFlags::None; |
| 478 | if (command.FindLast(' ') != -1) |
| 479 | command = command.Left(command.Find(' ')); |
| 480 | // TODO: fix missing string handle on 1st command execution (command gets invalid after InitCommands due to dotnet GC or dotnet interop handles flush) |
| 481 | String commandCopy = command; |
| 482 | command = commandCopy; |
| 483 | EnsureInited(); |
| 484 | for (auto& e : Commands) |
| 485 | { |
| 486 | if (e.Name == command) |
| 487 | { |
| 488 | if (e.Method) |
| 489 | result |= CommandFlags::Exec; |
| 490 | else if (e.Field) |
| 491 | result |= CommandFlags::ReadWrite; |
| 492 | if (e.MethodGet) |
| 493 | result |= CommandFlags::Read; |
| 494 | if (e.MethodSet) |
| 495 | result |= CommandFlags::Write; |
| 496 | break; |
| 497 | } |
| 498 | } |
| 499 | return result; |
| 500 | } |
| 501 | |
| 502 | bool DebugCommands::Iterate(const StringView& searchText, int32& index) |
| 503 | { |
no test coverage detected