aboutsummaryrefslogtreecommitdiffstats
path: root/src/ruleparser.h
diff options
context:
space:
mode:
authorTorgny Nyblom <kde@nyblom.org>2010-12-04 20:53:43 +0100
committerTorgny Nyblom <kde@nyblom.org>2010-12-04 20:53:43 +0100
commitce56750e8a47e3be86cf0c0964a145c7d7f943e5 (patch)
tree53f1f80707fc7f147a111a85593ecb92e72a67d5 /src/ruleparser.h
parent6e13e426db84b9137b98ba80552b91e3684085cd (diff)
downloadsvn2git-ce56750e8a47e3be86cf0c0964a145c7d7f943e5.tar
svn2git-ce56750e8a47e3be86cf0c0964a145c7d7f943e5.tar.gz
svn2git-ce56750e8a47e3be86cf0c0964a145c7d7f943e5.tar.bz2
svn2git-ce56750e8a47e3be86cf0c0964a145c7d7f943e5.tar.xz
svn2git-ce56750e8a47e3be86cf0c0964a145c7d7f943e5.zip
Add an option to print some stats after a run.
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 &);