Line data Source code
1 : #pragma once 2 : 3 : #include <memory> 4 : 5 : #include "envoy/common/pure.h" 6 : 7 : #include "absl/strings/string_view.h" 8 : 9 : namespace Envoy { 10 : namespace Matchers { 11 : 12 : /** 13 : * Generic string matching interface. 14 : */ 15 : class StringMatcher { 16 : public: 17 2870 : virtual ~StringMatcher() = default; 18 : 19 : /** 20 : * Return whether a passed string value matches. 21 : */ 22 : virtual bool match(const absl::string_view value) const PURE; 23 : }; 24 : 25 : using StringMatcherPtr = std::unique_ptr<const StringMatcher>; 26 : 27 : } // namespace Matchers 28 : } // namespace Envoy