#include "base/convert.h"
#include "base/array.h"
#include "base/objectlock.h"
+#include "base/logger_fwd.h"
#include <boost/foreach.hpp>
+#include <boost/regex.hpp>
using namespace icinga;
using namespace livestatus;
else
return (static_cast<String>(value) == m_Operand);
} else if (m_Operator == "~") {
+ boost::regex expr(static_cast<std::string>(m_Operand));
+ boost::smatch what;
+ String val = static_cast<String>(value);
+ std::string::const_iterator begin = val.Begin();
+ std::string::const_iterator end = val.End();
+ bool ret = boost::regex_search(begin, end, what, expr);
+
+ //Log(LogDebug, "livestatus", "Attribute filter '" + m_Operand + " " + m_Operator + " " +
+ // static_cast<String>(value) + "' " + (ret ? "matches" : "doesn't match") + "." );
+
+ return ret;
} else if (m_Operator == "=~") {
return string_iless()(value, m_Operand);
} else if (m_Operator == "~~") {
+ boost::regex expr(static_cast<std::string>(m_Operand), boost::regex::icase);
+ boost::smatch what;
+ String val = static_cast<String>(value);
+ std::string::const_iterator begin = val.Begin();
+ std::string::const_iterator end = val.End();
+
+ bool ret = boost::regex_search(begin, end, what, expr);
+
+ //Log(LogDebug, "livestatus", "Attribute filter '" + m_Operand + " " + m_Operator + " " +
+ // static_cast<String>(value) + "' " + (ret ? "matches" : "doesn't match") + "." );
+ return ret;
} else if (m_Operator == "<") {
if (value.GetType() == ValueNumber)
return (static_cast<double>(value) < Convert::ToDouble(m_Operand));
Requires: boost%{el5_boost_version}-system
Requires: boost%{el5_boost_version}-test
Requires: boost%{el5_boost_version}-thread
+Requires: boost%{el5_boost_version}-regex
%else
BuildRequires: boost-devel >= 1.41
Requires: boost-program-options >= 1.41
Requires: boost-system >= 1.41
Requires: boost-test >= 1.41
Requires: boost-thread >= 1.41
+Requires: boost-regex >= 1.41
%endif
%endif
Requires: libboost_system%{opensuse_boost_version}
Requires: libboost_test%{opensuse_boost_version}
Requires: libboost_thread%{opensuse_boost_version}
+Requires: libboost_regex%{opensuse_boost_version}
%endif
%endif