MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / tokenise

Function tokenise

lib/include/string/StdStringUtil.h:69–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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}

Callers 2

normalisePathMethod · 0.85
parseUserMethod · 0.85

Calls 2

push_backMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected