MCPcopy Create free account
hub / github.com/build-cpp/cmkr / cmd

Method cmd

src/cmake_generator.cpp:500–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498 int indent = 0;
499
500 Command cmd(const std::string &command, const std::string &post_comment = "") {
501 if (command.empty())
502 throw std::invalid_argument("command cannot be empty");
503 if (command == "if") {
504 indent++;
505 return Command(ss, indent - 1, command, post_comment);
506 } else if (command == "else" || command == "elseif") {
507 return Command(ss, indent - 1, command, post_comment);
508 } else if (command == "endif") {
509 indent--;
510 }
511 return Command(ss, indent, command, post_comment);
512 }
513
514 CommandEndl comment(const std::string &comment) {
515 ss << Command::indent(indent) << "# " << comment << '\n';

Callers 2

~ConditionScopeMethod · 0.80
generate_cmakeFunction · 0.80

Calls 2

CommandClass · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected