Comma separated join, adds quotes if needed
| 7575 | |
| 7576 | /// Comma separated join, adds quotes if needed |
| 7577 | inline std::string ini_join(const std::vector<std::string> &args, char sepChar = ',', char arrayStart = '[', |
| 7578 | char arrayEnd = ']') { |
| 7579 | std::string joined; |
| 7580 | if (args.size() > 1 && arrayStart != '\0') { |
| 7581 | joined.push_back(arrayStart); |
| 7582 | } |
| 7583 | std::size_t start = 0; |
| 7584 | for (const auto &arg : args) { |
| 7585 | if (start++ > 0) { |
| 7586 | joined.push_back(sepChar); |
| 7587 | if (isspace(sepChar) == 0) { |
| 7588 | joined.push_back(' '); |
| 7589 | } |
| 7590 | } |
| 7591 | joined.append(convert_arg_for_ini(arg)); |
| 7592 | } |
| 7593 | if (args.size() > 1 && arrayEnd != '\0') { |
| 7594 | joined.push_back(arrayEnd); |
| 7595 | } |
| 7596 | return joined; |
| 7597 | } |
| 7598 | |
| 7599 | inline std::vector<std::string> generate_parents(const std::string §ion, std::string &name) { |
| 7600 | std::vector<std::string> parents; |
no test coverage detected