本文整理汇总了C++中Importer::prepareForDeduplication方法的典型用法代码示例。如果您正苦于以下问题:C++ Importer::prepareForDeduplication方法的具体用法?C++ Importer::prepareForDeduplication怎么用?C++ Importer::prepareForDeduplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Importer
的用法示例。
在下文中一共展示了Importer::prepareForDeduplication方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importConfig
void importConfig(const string &import_config,
FWObject *library,
const string &fw_name,
bool deduplicate)
{
QFile f(QString::fromUtf8(import_config.c_str()));
f.open(QFile::ReadOnly);
string buffer = QString(f.readAll()).toStdString();
f.close();
std::istringstream instream(buffer);
QueueLogger *logger = new QueueLogger();
logger->copyToStderr();
Importer* imp = nullptr;
QStringList sl_buf = QString::fromUtf8(buffer.c_str()).split("\n");
PreImport pi(&sl_buf);
pi.scan();
switch (pi.getPlatform())
{
case PreImport::PIX:
case PreImport::FWSM:
imp = new PIXImporter(library, instream, logger, fw_name);
break;
case PreImport::IOSACL:
imp = new IOSImporter(library, instream, logger, fw_name);
break;
case PreImport::IPTABLES:
imp = new IPTImporter(library, instream, logger, fw_name);
break;
case PreImport::IPTABLES_WITH_COUNTERS:
cerr << "This appears to be iptables configuration saved using "
"command \"iptables-save -c\""
"and it includes packet counters. Please save configuration "
"using command \"iptables-save\" without option \"-c\" and "
"try to import it again."
<< endl;
exit(1);
default:
cerr << "Can not import configuration file: unrecognized firewall platform"
<< endl;
exit(1);
}
if (deduplicate) imp->prepareForDeduplication();
try
{
imp->run();
} catch(ImporterException &e)
{
*logger << e.toString() << "\n";
} catch(ObjectMakerException &e)
{
*logger << e.toString() << "\n";
}
imp->finalize();
}