MCPcopy Create free account
hub / github.com/UbiquitousLearning/mllm / splitFlags

Method splitFlags

mllm/utils/Argparse.hpp:255–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253 std::vector<std::unique_ptr<ArgumentBase>> args_;
254
255 static std::vector<std::string> splitFlags(const std::string& flags) {
256 std::vector<std::string> result;
257
258 size_t start = 0;
259 size_t pos = 0;
260
261 while ((pos = flags.find('|', start)) != std::string::npos) {
262 std::string token = flags.substr(start, pos - start);
263 if (!token.empty()) { result.push_back(token); }
264 start = pos + 1;
265 }
266 std::string lastToken = flags.substr(start);
267 if (!lastToken.empty()) { result.push_back(lastToken); }
268
269 if (!flags.empty() && result.empty()) result.push_back(flags);
270 return result;
271 }
272
273 static Argparse& instance() {
274 static Argparse inst;

Callers

nothing calls this directly

Calls 2

findMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected