aboutsummaryrefslogtreecommitdiffstats
path: root/src/ruleparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruleparser.h')
-rw-r--r--src/ruleparser.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/ruleparser.h b/src/ruleparser.h
index f3f6c6a..9d21937 100644
--- a/src/ruleparser.h
+++ b/src/ruleparser.h
@@ -73,7 +73,7 @@ public:
Match() : minRevision(-1), maxRevision(-1), annotate(false), action(Ignore) { }
const QString info() const {
- const QString info = rx.pattern() % " (" % Rule::filename % ":" % QByteArray::number(Rule::lineNumber) % ")";
+ const QString info = Rule::filename % ":" % QByteArray::number(Rule::lineNumber) % " " % rx.pattern();
return info;
}
};
@@ -83,12 +83,10 @@ public:
const QList<Repository> repositories() const;
const QList<Match> matchRules() const;
-
void load();
private:
void load(const QString &filename);
-
QString filename;
QList<Repository> m_repositories;
QList<Match> m_matchRules;
@@ -113,6 +111,24 @@ private:
QList<QList<Rules::Match> > m_allMatchRules;
};
+class Stats
+{
+public:
+ static Stats *instance();
+ void printStats() const;
+ void ruleMatched(const Rules::Match &rule, const int rev = -1);
+ void addRule( const Rules::Match &rule);
+ static void init();
+ ~Stats();
+
+private:
+ Stats();
+ class Private;
+ Private * const d;
+ static Stats *self;
+ bool use;
+};
+
#ifndef QT_NO_DEBUG_STREAM
class QDebug;
QDebug operator<<(QDebug, const Rules::Match &);