aboutsummaryrefslogtreecommitdiffstats
path: root/src/ruleparser.cpp
diff options
context:
space:
mode:
authorTorgny Nyblom <kde@nyblom.org>2010-09-29 19:53:24 +0200
committerTorgny Nyblom <kde@nyblom.org>2010-09-29 19:53:24 +0200
commita741bdb1913c28a320ff0e01518e4d39ed430289 (patch)
tree876438b5e64af3c78a55e4971cdd283e491990e8 /src/ruleparser.cpp
parent7ca174999ae5fa86e5fc39a0b1b7b02c06c80840 (diff)
downloadsvn2git-a741bdb1913c28a320ff0e01518e4d39ed430289.tar
svn2git-a741bdb1913c28a320ff0e01518e4d39ed430289.tar.gz
svn2git-a741bdb1913c28a320ff0e01518e4d39ed430289.tar.bz2
svn2git-a741bdb1913c28a320ff0e01518e4d39ed430289.tar.xz
svn2git-a741bdb1913c28a320ff0e01518e4d39ed430289.zip
Allow more then one rule file to be used in a single run.
Diffstat (limited to 'src/ruleparser.cpp')
-rw-r--r--src/ruleparser.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp
index d8467ac..4ab8f08 100644
--- a/src/ruleparser.cpp
+++ b/src/ruleparser.cpp
@@ -22,6 +22,41 @@
#include "ruleparser.h"
+RulesList::RulesList(const QString &filenames)
+ : m_filenames(filenames)
+{
+}
+
+RulesList::~RulesList() {}
+
+void RulesList::load()
+{
+ foreach(const QString filename, m_filenames.split(',') ) {
+ qDebug() << "Loading rules from:" << filename;
+ Rules *rules = new Rules(filename);
+ m_rules.append(rules);
+ rules->load();
+ m_allrepositories.append(rules->repositories());
+ QList<Rules::Match> matchRules = rules->matchRules();
+ m_allMatchRules.append( QList<Rules::Match>(matchRules));
+ }
+}
+
+const QList<Rules::Repository> RulesList::allRepositories() const
+{
+ return m_allrepositories;
+}
+
+const QList<QList<Rules::Match> > RulesList::allMatchRules() const
+{
+ return m_allMatchRules;
+}
+
+const QList<Rules*> RulesList::rules() const
+{
+ return m_rules;
+}
+
Rules::Rules(const QString &fn)
: filename(fn)
{