diff options
Diffstat (limited to 'src/ruleparser.cpp')
-rw-r--r-- | src/ruleparser.cpp | 35 |
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) { |