MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / ini_join

Function ini_join

simcore/framework/src/cli/cli.hpp:7577–7597  ·  view source on GitHub ↗

Comma separated join, adds quotes if needed

Source from the content-addressed store, hash-verified

7575
7576/// Comma separated join, adds quotes if needed
7577inline 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
7599inline std::vector<std::string> generate_parents(const std::string &section, std::string &name) {
7600 std::vector<std::string> parents;

Callers 1

to_configMethod · 0.85

Calls 4

convert_arg_for_iniFunction · 0.85
appendMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected