#include "builder/matcher_builder.hpp"
#include "configuration/common/configuration.hpp"
#include "matcher/base.hpp"
#include "matcher/exact_match.hpp"
#include "matcher/ip_match.hpp"
#include <memory>
namespace ddwaf {
std::unique_ptr<matcher::base> matcher_builder::build(const data_spec &data)
{
std::unique_ptr<matcher::base> matcher;
if (data.type == data_type::ip_with_expiration) {
matcher = std::make_unique<matcher::ip_match>(data.values);
} else if (data.type == data_type::data_with_expiration) {
matcher = std::make_unique<matcher::exact_match>(data.values);
}
return matcher;
}
}