summaryrefslogtreecommitdiff
path: root/project2/regexCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/regexCheck.cpp')
-rw-r--r--project2/regexCheck.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/project2/regexCheck.cpp b/project2/regexCheck.cpp
new file mode 100644
index 0000000..abe134c
--- /dev/null
+++ b/project2/regexCheck.cpp
@@ -0,0 +1,22 @@
+#include "regexCheck.h"
+#include "xmlObjectLoader.h"
+#include "appEngine.h"
+#include <boost/regex.hpp>
+
+_RegexCheck::_RegexCheck(const xmlpp::Element * p) :
+ _ParamChecker(p),
+ regex(xmlChildText(p, "regex").raw())
+{
+}
+
+_RegexCheck::~_RegexCheck()
+{
+}
+
+bool
+_RegexCheck::performCheck(const ApplicationEngine * ep) const
+{
+ const Glib::ustring & param = ep->env()->getParamQuery(applyTo);
+ return boost::regex_match(param.begin(), param.end(), regex);
+}
+