diff options
author | Torgny Nyblom <kde@nyblom.org> | 2011-05-08 09:19:57 +0200 |
---|---|---|
committer | Torgny Nyblom <kde@nyblom.org> | 2011-05-08 09:19:57 +0200 |
commit | 4c241d532e2f07c7f1c188cebebb712b752ed1ed (patch) | |
tree | fe285061d7298746feb06825a767abd3f999ca61 /src/ruleparser.h | |
parent | e8a16c9a47eef7c625686d2a868ec91d05fd95c5 (diff) | |
parent | c630dd763cf6ec096489bea551ca959540969c94 (diff) | |
download | svn2git-4c241d532e2f07c7f1c188cebebb712b752ed1ed.tar svn2git-4c241d532e2f07c7f1c188cebebb712b752ed1ed.tar.gz svn2git-4c241d532e2f07c7f1c188cebebb712b752ed1ed.tar.bz2 svn2git-4c241d532e2f07c7f1c188cebebb712b752ed1ed.tar.xz svn2git-4c241d532e2f07c7f1c188cebebb712b752ed1ed.zip |
Merge commit 'refs/merge-requests/12' of git://gitorious.org/svn2git/svn2git into merge-requests/12
Conflicts:
src/ruleparser.cpp
Diffstat (limited to 'src/ruleparser.h')
-rw-r--r-- | src/ruleparser.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ruleparser.h b/src/ruleparser.h index 5eaba49..9878735 100644 --- a/src/ruleparser.h +++ b/src/ruleparser.h @@ -58,9 +58,19 @@ public: struct Match : Rule { + struct Substitution { + QRegExp pattern; + QString replacement; + + bool isValid() { return !pattern.isEmpty(); } + QString& apply(QString &string) { return string.replace(pattern, replacement); } + }; + QRegExp rx; QString repository; + QList<Substitution> repo_substs; QString branch; + QList<Substitution> branch_substs; QString prefix; int minRevision; int maxRevision; @@ -84,6 +94,7 @@ public: const QList<Repository> repositories() const; const QList<Match> matchRules() const; + Match::Substitution parseSubstitution(const QString &string); void load(); private: |