- inline bool operator()(const QPair<char, uint> &a, const QPair<char, uint> &b) const
+ inline bool operator()(const QPair<QChar, uint> &a, const QPair<QChar, uint> &b) const
- QHash<char, uint> counts;
- foreach(char c, firstLineContent)
+ QHash<QChar, uint> counts;
+ foreach(const QChar c, firstLineContent)
qSort(orderedCounts.begin(), orderedCounts.end(), SortByValueDesc());
// Work around Q_FOREACH macro limitation when dealing with
// multi-typed templates (comma issue)
qSort(orderedCounts.begin(), orderedCounts.end(), SortByValueDesc());
// Work around Q_FOREACH macro limitation when dealing with
// multi-typed templates (comma issue)
foreach(bodge count, orderedCounts)
qDebug() << count.first << " = " << count.second;
foreach(bodge count, orderedCounts)
qDebug() << count.first << " = " << count.second;
// No-one would be mad enough to use quotation marks or apostrophes
// as their delimiter,but just in case, check the second most
// frequent character is present thr right number of times for
// No-one would be mad enough to use quotation marks or apostrophes
// as their delimiter,but just in case, check the second most
// frequent character is present thr right number of times for
-CSVSymbianEventLogParser::CSVSymbianEventLogParser(const Settings &settings, const QString &filename, const char delimiter, const int numColumnsPerRecord, const ColumnIndicesHash &headingIndices)
+CSVSymbianEventLogParser::CSVSymbianEventLogParser(const Settings &settings, const QString &filename, const QChar delimiter, const int numColumnsPerRecord, const ColumnIndicesHash &headingIndices)
: m_Settings(settings), m_Delimiter(delimiter), m_NumColumnsPerRecord(numColumnsPerRecord), m_HeadingIndices(headingIndices)
{
}
: m_Settings(settings), m_Delimiter(delimiter), m_NumColumnsPerRecord(numColumnsPerRecord), m_HeadingIndices(headingIndices)
{
}
QStringList firstLineValues(QString(firstLineContent).split(m_Delimiter));
if(firstLineValues.count() != m_NumColumnsPerRecord)
throw new std::runtime_error(QString("Unexpected number of columns (%1, expected %2) on line %3 of %4")
.arg(firstLineValues.count())
QStringList firstLineValues(QString(firstLineContent).split(m_Delimiter));
if(firstLineValues.count() != m_NumColumnsPerRecord)
throw new std::runtime_error(QString("Unexpected number of columns (%1, expected %2) on line %3 of %4")
.arg(firstLineValues.count())
++lineNumber;
// Make sure we have enough columns (i.e. handle newlines in values)
while(lineValues.count() < m_NumColumnsPerRecord)
{
++lineNumber;
// Make sure we have enough columns (i.e. handle newlines in values)
while(lineValues.count() < m_NumColumnsPerRecord)
{