10#include <komparediffdebug.h>
11#include "cvsdiffparser.h"
12#include "diffparser.h"
13#include "perforceparser.h"
15#include "diffmodellist.h"
36 for (; it != diffLines.
end(); ++it)
38 if ((*it).startsWith(noNewLine))
40 it = diffLines.
erase(it);
58 m_generator = determineGenerator(diffLines);
60 int nol = cleanUpCrap(diffLines);
61 qCDebug(LIBKOMPAREDIFF2) <<
"Cleaned up " << nol <<
" line(s) of crap from the diff...";
65 case Kompare::CVSDiff :
66 qCDebug(LIBKOMPAREDIFF2) <<
"It is a CVS generated diff...";
67 parser =
new CVSDiffParser(m_list, diffLines);
70 qCDebug(LIBKOMPAREDIFF2) <<
"It is a diff generated diff...";
71 parser =
new DiffParser(m_list, diffLines);
73 case Kompare::Perforce :
74 qCDebug(LIBKOMPAREDIFF2) <<
"It is a Perforce generated diff...";
75 parser =
new PerforceParser(m_list, diffLines);
82 m_format = parser->format();
86 qCDebug(LIBKOMPAREDIFF2) <<
"Modelcount: " << modelList->
count();
87 DiffModelListIterator modelIt = modelList->
begin();
88 DiffModelListIterator mEnd = modelList->
end();
89 for (; modelIt != mEnd; ++modelIt)
91 qCDebug(LIBKOMPAREDIFF2) <<
"Hunkcount: " << (*modelIt)->hunkCount();
92 qCDebug(LIBKOMPAREDIFF2) <<
"Diffcount: " << (*modelIt)->differenceCount();
110 while (it != linesEnd)
112 if ((*it).startsWith(cvsDiff))
114 qCDebug(LIBKOMPAREDIFF2) <<
"Diff is a CVSDiff";
115 return Kompare::CVSDiff;
117 else if ((*it).startsWith(perforceDiff))
119 qCDebug(LIBKOMPAREDIFF2) <<
"Diff is a Perforce Diff";
120 return Kompare::Perforce;
125 qCDebug(LIBKOMPAREDIFF2) <<
"We'll assume it is a diff Diff";
129 return Kompare::Diff;
KIOCORE_EXPORT QStringList list(const QString &fileClass)
Generator
Patch generator enum.
qsizetype count() const const
iterator erase(const_iterator begin, const_iterator end)