DiffModelList* Parser::parse( QStringList& diffLines, bool* malformed ) { /* Basically determine the generator then call the parse method */ ParserBase* parser; m_generator = determineGenerator( diffLines ); int nol = cleanUpCrap( diffLines ); qCDebug(LIBKOMPAREDIFF2) << "Cleaned up " << nol << " line(s) of crap from the diff..."; switch( m_generator ) { case Kompare::CVSDiff : qCDebug(LIBKOMPAREDIFF2) << "It is a CVS generated diff..."; parser = new CVSDiffParser( m_list, diffLines ); break; case Kompare::Diff : qCDebug(LIBKOMPAREDIFF2) << "It is a diff generated diff..."; parser = new DiffParser( m_list, diffLines ); break; case Kompare::Perforce : qCDebug(LIBKOMPAREDIFF2) << "It is a Perforce generated diff..."; parser = new PerforceParser( m_list, diffLines ); break; default: // Nothing to delete, just leave... return 0L; } m_format = parser->format(); DiffModelList* modelList = parser->parse( malformed ); if ( modelList ) { qCDebug(LIBKOMPAREDIFF2) << "Modelcount: " << modelList->count(); DiffModelListIterator modelIt = modelList->begin(); DiffModelListIterator mEnd = modelList->end(); for ( ; modelIt != mEnd; ++modelIt ) { qCDebug(LIBKOMPAREDIFF2) << "Hunkcount: " << (*modelIt)->hunkCount(); qCDebug(LIBKOMPAREDIFF2) << "Diffcount: " << (*modelIt)->differenceCount(); } } delete parser; return modelList; }