#pragma once
#include <string_view>
#include <utility>
#include "dynamic_string.hpp"
#include "matcher/base.hpp"
#include "object_type.hpp"
namespace ddwaf::matcher {
class is_xss : public base_impl<is_xss> {
public:
static constexpr std::string_view matcher_name = "is_xss";
static constexpr std::string_view negated_matcher_name = "!is_xss";
is_xss() = default;
~is_xss() override = default;
is_xss(const is_xss &) = delete;
is_xss(is_xss &&) noexcept = default;
is_xss &operator=(const is_xss &) = delete;
is_xss &operator=(is_xss &&) noexcept = default;
protected:
static constexpr std::string_view to_string_impl() { return ""; }
static constexpr bool is_supported_type_impl(object_type type)
{
return (type & object_type::string) != 0;
}
static std::pair<bool, dynamic_string> match_impl(std::string_view pattern);
friend class base_impl<is_xss>;
};
}