MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / ignoreComments

Method ignoreComments

src/thundersvm/util/log.cpp:364–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362 }
363
364 void Configurations::Parser::ignoreComments(std::string* line) {
365 std::size_t foundAt = 0;
366 std::size_t quotesStart = line->find("\"");
367 std::size_t quotesEnd = std::string::npos;
368 if (quotesStart != std::string::npos) {
369 quotesEnd = line->find("\"", quotesStart + 1);
370 while (quotesEnd != std::string::npos && line->at(quotesEnd - 1) == '\\') {
371 // Do not erase slash yet - we will erase it in parseLine(..) while loop
372 quotesEnd = line->find("\"", quotesEnd + 2);
373 }
374 }
375 if ((foundAt = line->find(base::consts::kConfigurationComment)) != std::string::npos) {
376 if (foundAt < quotesEnd) {
377 foundAt = line->find(base::consts::kConfigurationComment, quotesEnd + 1);
378 }
379 *line = line->substr(0, foundAt);
380 }
381 }
382
383 bool Configurations::Parser::isLevel(const std::string& line) {
384 return base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationLevel));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected