| 1508 | } |
| 1509 | |
| 1510 | static bool matchCmdArgs(std::string const& str, std::vector<std::string>& matchResult) { |
| 1511 | matchResult.clear(); |
| 1512 | auto idxOpen = str.find('('); |
| 1513 | auto idxClose = str.find(')', idxOpen); |
| 1514 | if (idxClose == std::string::npos) { |
| 1515 | return false; |
| 1516 | } |
| 1517 | |
| 1518 | matchResult.emplace_back(str.substr(0, idxOpen)); |
| 1519 | |
| 1520 | // split by comma |
| 1521 | matchResult.emplace_back(std::string{}); |
| 1522 | for (size_t i = idxOpen + 1; i != idxClose; ++i) { |
| 1523 | if (str[i] == ' ' || str[i] == '\t') { |
| 1524 | // skip whitespace |
| 1525 | continue; |
| 1526 | } |
| 1527 | if (str[i] == ',') { |
| 1528 | // got a comma => new string |
| 1529 | matchResult.emplace_back(std::string{}); |
| 1530 | continue; |
| 1531 | } |
| 1532 | // no whitespace no comma, append |
| 1533 | matchResult.back() += str[i]; |
| 1534 | } |
| 1535 | return true; |
| 1536 | } |
| 1537 | |
| 1538 | static bool generateConfigTag(Node const& n, Config const& config, std::ostream& out) { |
| 1539 | using detail::d; |
no test coverage detected