MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / addExample

Function addExample

scripts/mkdoc.cc:13–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13static void addExample(std::vector<std::string>& examples,
14 bool write,
15 std::string name,
16 ConfigProto config,
17 const OptionProto* format)
18{
19 std::string r;
20
21 if (format)
22 config.MergeFrom(format->config());
23
24 if (write && config.has_encoder())
25 r += fmt::format("fluxengine write");
26 else if (!write && config.has_decoder())
27 r += fmt::format("fluxengine read");
28 else
29 return;
30
31 r += fmt::format(" -c {}", name);
32 if (format)
33 r += fmt::format(" --{}", format->name());
34
35 std::string filename = write ? config.image_reader().filename()
36 : config.image_writer().filename();
37 if (filename.empty())
38 filename = fmt::format("{}.img", name);
39
40 if (write)
41 r += fmt::format(" -d drive:0 -i {}", filename);
42 else
43 r += fmt::format(" -s drive:0 -o {}", filename);
44
45 examples.push_back(r);
46}
47
48int main(int argc, const char* argv[])
49{

Callers 1

mainFunction · 0.85

Calls 2

emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected