本文整理汇总了C++中DataList::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ DataList::isEmpty方法的具体用法?C++ DataList::isEmpty怎么用?C++ DataList::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataList
的用法示例。
在下文中一共展示了DataList::isEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseFile
DataList ParseFile(QString const& fileName)
{
DataList dataList;
QFileInfo info(fileName);
if (info.exists()) {
try {
// First, check for a QChem input/output file. For input files
// OB returns an empty molecule, for output files the charge and
// multiplicity don't seem to be parsed correctly.
if (fileName.endsWith(".in", Qt::CaseInsensitive) ||
fileName.endsWith(".inp", Qt::CaseInsensitive) ||
fileName.endsWith(".qcin", Qt::CaseInsensitive) ||
fileName.endsWith(".qcinp", Qt::CaseInsensitive) ||
fileName.endsWith(".out", Qt::CaseInsensitive) ||
fileName.endsWith(".qcout", Qt::CaseInsensitive) ) {
QChem qchemParser;
dataList += qchemParser.parseFile(fileName);
}
// Second, check for external charges, which are not recognized by Open
// Babel. Check the ExternalChargesParser.h file for a description of
// the external charges format.
if (dataList.isEmpty()) {
ExternalCharges chargeParser;
dataList += chargeParser.parseFile(fileName);
}
// Now let Open Babel have a crack.
OpenBabel obParser;
dataList += obParser.parseFile(fileName);
// OB will pull the geometry from a FChk file, but not the MO
// information so we must pass this information explicitly.
if (fileName.endsWith(".fchk", Qt::CaseInsensitive)) {
FormattedCheckpoint fchkParser;
dataList += fchkParser.parseFile(fileName);
}
// Finally, if we have found anything we append the file as well.
if (!dataList.isEmpty()) {
Layer::Files* files(new Layer::Files());
files->appendLayer(new Layer::File(fileName));
dataList.append(files);
}
} catch (IOError& ioerr) {
if (Base::s_displayErrors) QMsgBox::warning(0, "IQmol", ioerr.what());
} catch (std::exception& e) {
if (Base::s_displayErrors) QMsgBox::warning(0, "IQmol", e.what());
}
}
return dataList;
}