MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / main

Function main

lib/mdflib/mdf2csv/src/main.cpp:17–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16
17int main(int argc, char* argv[]) {
18 ProgramArgument& arguments = ProgramArgument::Instance();
19
20 arguments.Parse(argc,argv);
21
22 if (arguments.Help()) {
23 arguments.ShowHelp();
24 return EXIT_SUCCESS;
25 }
26
27 if (arguments.Version()) {
28 arguments.ShowVersion();
29 return EXIT_SUCCESS;
30 }
31
32 LogToConsole logger;
33
34 const auto& input_files = arguments.InputFiles();
35 const auto& output_dir = arguments.OutputDirectory();
36
37 CreateFileList creator;
38 creator.OutputPath(output_dir);
39 creator.MakeFileList(input_files);
40
41 if (creator.Files().empty()) {
42 MDF_ERROR() << "There is no MDF files to convert.";
43 return EXIT_FAILURE;
44 }
45
46 for (const auto& file : creator.Files()) {
47 creator.ConvertMdfFile(file);
48 }
49
50 return EXIT_SUCCESS;
51}

Callers

nothing calls this directly

Calls 9

HelpMethod · 0.80
ShowHelpMethod · 0.80
ShowVersionMethod · 0.80
OutputPathMethod · 0.80
MakeFileListMethod · 0.80
emptyMethod · 0.80
ConvertMdfFileMethod · 0.80
ParseMethod · 0.45
VersionMethod · 0.45

Tested by

no test coverage detected