summaryrefslogtreecommitdiff
path: root/src/desktop/rule/matchEngine/IntMatchEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/desktop/rule/matchEngine/IntMatchEngine.cpp')
-rw-r--r--src/desktop/rule/matchEngine/IntMatchEngine.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/desktop/rule/matchEngine/IntMatchEngine.cpp b/src/desktop/rule/matchEngine/IntMatchEngine.cpp
new file mode 100644
index 00000000..c5bc87f6
--- /dev/null
+++ b/src/desktop/rule/matchEngine/IntMatchEngine.cpp
@@ -0,0 +1,14 @@
+#include "IntMatchEngine.hpp"
+#include "../../../debug/Log.hpp"
+
+using namespace Desktop::Rule;
+
+CIntMatchEngine::CIntMatchEngine(const std::string& s) {
+ try {
+ m_value = std::stoi(s);
+ } catch (...) { Debug::log(ERR, "CIntMatchEngine: invalid input {}", s); }
+}
+
+bool CIntMatchEngine::match(int other) {
+ return m_value == other;
+}