| 581 | namespace |
| 582 | { |
| 583 | bool CheckHeldKeysMatch(juce::String name, std::string heldKeys, bool continuous) |
| 584 | { |
| 585 | name = name.toLowerCase(); |
| 586 | |
| 587 | if (name.isEmpty() || heldKeys.empty()) |
| 588 | return false; |
| 589 | |
| 590 | if (continuous) |
| 591 | return name.contains(heldKeys); |
| 592 | |
| 593 | if (name[0] != heldKeys[0]) |
| 594 | return false; |
| 595 | |
| 596 | int stringPos = 0; |
| 597 | int end = name.indexOfChar('.'); |
| 598 | if (end == -1) |
| 599 | end = name.indexOfChar(' '); |
| 600 | if (end == -1) |
| 601 | end = name.length() - 1; |
| 602 | for (size_t j = 1; j < heldKeys.length(); ++j) |
| 603 | { |
| 604 | stringPos = name.substring(stringPos + 1, end + 1).indexOfChar(heldKeys[j]); |
| 605 | if (stringPos == -1) //couldn't find key in remaining string |
| 606 | return false; |
| 607 | } |
| 608 | |
| 609 | return true; |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | std::vector<ModuleFactory::Spawnable> ModuleFactory::GetSpawnableModules(std::string keys, bool continuousString) |
no test coverage detected