MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / buildArgv

Function buildArgv

programs/docker-init/docker-init.cpp:68–76  ·  view source on GitHub ↗

Build an execvp-compatible argv array from a vector of strings.

Source from the content-addressed store, hash-verified

66
67/// Build an execvp-compatible argv array from a vector of strings.
68std::vector<char *> buildArgv(const std::vector<std::string> & args)
69{
70 std::vector<char *> argv;
71 argv.reserve(args.size() + 1);
72 for (const auto & a : args)
73 argv.push_back(const_cast<char *>(a.c_str())); // NOLINT(cppcoreguidelines-pro-type-const-cast)
74 argv.push_back(nullptr);
75 return argv;
76}
77
78/// Run a command and wait for it. Returns the exit code (or -1 on error).
79int runCommand(const std::vector<std::string> & args)

Callers 5

runCommandFunction · 0.85
captureCommandFunction · 0.85
runPipelineFunction · 0.85
initClickHouseDBFunction · 0.85

Calls 3

reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected