MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / tokenSplit

Function tokenSplit

extern/happly/happly.h:1237–1256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1235}
1236
1237inline std::vector<std::string> tokenSplit(const std::string& input) {
1238 std::vector<std::string> result;
1239 size_t curr = 0;
1240 size_t found = 0;
1241 while ((found = input.find_first_of(' ', curr)) != std::string::npos) {
1242 std::string token = input.substr(curr, found - curr);
1243 token = trimSpaces(token);
1244 if (token.size() > 0) {
1245 result.push_back(token);
1246 }
1247 curr = found + 1;
1248 }
1249 std::string token = input.substr(curr);
1250 token = trimSpaces(token);
1251 if (token.size() > 0) {
1252 result.push_back(token);
1253 }
1254
1255 return result;
1256}
1257
1258inline bool startsWith(const std::string& input, const std::string& query) {
1259 return input.compare(0, query.length(), query) == 0;

Callers 2

parseHeaderMethod · 0.85
parseASCIIMethod · 0.85

Calls 3

trimSpacesFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected