| 25 | } |
| 26 | |
| 27 | void SimpleCLI::unpause() { |
| 28 | pauseParsing = false; |
| 29 | |
| 30 | // Go through queued errors |
| 31 | while (onError && errored()) { |
| 32 | onError(getError().getPtr()); |
| 33 | } |
| 34 | |
| 35 | // Go through queued commands |
| 36 | if(available()) { |
| 37 | cmd* prev = NULL; |
| 38 | cmd* current = cmdQueue; |
| 39 | cmd* next = NULL; |
| 40 | |
| 41 | while(current) { |
| 42 | next = current->next; |
| 43 | |
| 44 | // Has callback, then run it and remove from queue |
| 45 | if(current->callback) { |
| 46 | current->callback(current); |
| 47 | if(prev) prev->next = next; |
| 48 | cmd_destroy(current); |
| 49 | } else { |
| 50 | prev = current; |
| 51 | } |
| 52 | |
| 53 | current = next; |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void SimpleCLI::parse(const String& input) { |
| 59 | parse(input.c_str(), input.length()); |
nothing calls this directly
no test coverage detected