示例#1
0
List Factory::convert(Data::FileList& fileList) 
{
   List list;

   if (!fileList.isEmpty()){
      Data::FileList::iterator iter;
      Files* files( new Files );
      for (iter = fileList.begin(); iter != fileList.end(); ++iter) {
          files->appendLayer(new File(**iter));
      }
      list.append(files);
   }

   return list;
}
示例#2
0
void ParseFile::run()
{
   Data::FileList* fileList = new Data::FileList();

   bool addToFileList(true);
   QStringList::const_iterator file;
   for (file = m_filePaths.begin(); file != m_filePaths.end(); ++file) {
       QString fileName(*file);
       QLOG_INFO() << "Parsing file: " << fileName;
       if (parse(fileName, addToFileList)) {
          if (addToFileList) fileList->append(new Data::File(fileName));
       }
   }

   if (fileList->isEmpty()) {
      delete fileList;
   }else {
      m_dataBank.append(fileList);
   }
}