| 67 | */ |
| 68 | |
| 69 | inline void tokenise(const std::string& cmdText,const char *separators,std::vector<std::string>& words) { |
| 70 | |
| 71 | std::string::size_type first,last; |
| 72 | |
| 73 | // tokenise the command |
| 74 | |
| 75 | for(first=cmdText.find_first_not_of(separators);first!=std::string::npos && last!=std::string::npos;) { |
| 76 | |
| 77 | if((last=cmdText.find_first_of(separators,first))==std::string::npos) |
| 78 | break; |
| 79 | |
| 80 | words.push_back(cmdText.substr(first,last-first)); |
| 81 | first=cmdText.find_first_not_of(separators,last); |
| 82 | } |
| 83 | |
| 84 | if(first!=std::string::npos) |
| 85 | words.push_back(cmdText.substr(first,cmdText.length()-first)); |
| 86 | } |
| 87 | } |
| 88 | } |
no test coverage detected