本文整理汇总了C++中CKernel::getCoverageReaderPluginManager方法的典型用法代码示例。如果您正苦于以下问题:C++ CKernel::getCoverageReaderPluginManager方法的具体用法?C++ CKernel::getCoverageReaderPluginManager怎么用?C++ CKernel::getCoverageReaderPluginManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKernel
的用法示例。
在下文中一共展示了CKernel::getCoverageReaderPluginManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processArgs
int processArgs(options_description desc, int ac, char* av[])
{
try {
positional_options_description p;
variables_map vm;
store(command_line_parser(ac, av).options(desc).positional(p).run(), vm);
notify(vm);
if (!vm.count("type")) {
std::cerr << "[ERROR] Type is missing." << std::endl << desc;
return 1;
}
if (vm.count("mode") && !vm.count("path")) {
std::cerr << "[ERROR] Path to input directory is missing." << std::endl << desc;
return 1;
}
std::string type = vm["type"].as<std::string>();
if (type == "coverage") {
if (vm.count("list")) {
printPluginNames("coverage", kernel.getCoverageReaderPluginManager().getPluginNames());
return 0;
}
if (vm.count("mode")) {
std::string mode = vm["mode"].as<std::string>();
try {
ICoverageReaderPlugin *plugin = kernel.getCoverageReaderPluginManager().getPlugin(mode);
CCoverageMatrix *matrix = plugin->read(vm);
if (vm.count("output")) {
std::string output = vm["output"].as<std::string>();
matrix->save(output);
}
if (matrix) {
delete matrix;
}
} catch (std::out_of_range &e) {
std::cerr << "[ERROR] Unknown read mode. " << std::endl;
printPluginNames("coverage", kernel.getCoverageReaderPluginManager().getPluginNames());
return 1;
}
return 0;
}
} else if (type == "results") {
if (vm.count("list")) {
printPluginNames("results", kernel.getResultsReaderPluginManager().getPluginNames());
return 0;
}
if (vm.count("mode")) {
std::string mode = vm["mode"].as<std::string>();
std::string path = vm["path"].as<std::string>();
try {
IResultsReaderPlugin *plugin = kernel.getResultsReaderPluginManager().getPlugin(mode);
CResultsMatrix *results = plugin->read(path);
if (vm.count("output")) {
std::string output = vm["output"].as<std::string>();
results->save(output);
}
if (results) {
delete results;
}
} catch (std::out_of_range &e) {
std::cerr << "[ERROR] Unknown read mode. " << std::endl;
printPluginNames("results", kernel.getResultsReaderPluginManager().getPluginNames());
return 1;
}
return 0;
}
} else if (type == "changeset") {
if (vm.count("list")) {
printPluginNames("changeset", kernel.getChangesetReaderPluginManager().getPluginNames());
return 0;
}
if (vm.count("mode")) {
std::string mode = vm["mode"].as<std::string>();
std::string path = vm["path"].as<std::string>();
try {
IChangesetReaderPlugin *plugin = kernel.getChangesetReaderPluginManager().getPlugin(mode);
CChangeset *changeset = plugin->read(path);
if (vm.count("output")) {
std::string output = vm["output"].as<std::string>();
changeset->save(output);
}
if (changeset) {
delete changeset;
}
} catch (std::out_of_range &e) {
std::cerr << "[ERROR] Unknown read mode. " << std::endl;
printPluginNames("changeset", kernel.getChangesetReaderPluginManager().getPluginNames());
return 1;
}
return 0;
}
} else {
std::cerr << "[ERROR] Unknown type." << std::endl << desc;
return 1;
}
} catch(std::exception& e) {
std::cerr << e.what() << std::endl;
//.........这里部分代码省略.........