| 1671 | } |
| 1672 | |
| 1673 | bool DuckyScriptEngine::loadFromString(String script) { |
| 1674 | commands.clear(); |
| 1675 | int start = 0, end = script.indexOf('\n'); |
| 1676 | while (end != -1) { |
| 1677 | String line = script.substring(start, end); |
| 1678 | if (!parseLine(line)) return false; |
| 1679 | start = end + 1; |
| 1680 | end = script.indexOf('\n', start); |
| 1681 | } |
| 1682 | String line = script.substring(start); |
| 1683 | if (line.length() > 0) |
| 1684 | if (!parseLine(line)) return false; |
| 1685 | scriptLoaded = true; |
| 1686 | return true; |
| 1687 | } |
| 1688 | |
| 1689 | std::vector<DuckyCommand> DuckyScriptEngine::getCommands() { return commands; } |
| 1690 | bool DuckyScriptEngine::isLoaded() { return scriptLoaded; } |
no test coverage detected