LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
filters::IFilterStrategy Class Referenceabstract

Abstract strategy interface for filter matching. More...

#include <IFilterStrategy.hpp>

Inheritance diagram for filters::IFilterStrategy:
Inheritance graph
Collaboration diagram for filters::IFilterStrategy:
Collaboration graph

Public Member Functions

virtual ~IFilterStrategy ()=default
 
virtual bool matches (const std::string &value, const std::string &pattern, bool caseSensitive) const =0
 Match a value against the pattern.
 
virtual bool isValidPattern (const std::string &pattern) const =0
 Validate pattern syntax.
 
virtual std::string getName () const =0
 Get strategy name for serialization/debugging.
 
virtual std::unique_ptr< IFilterStrategy > clone () const =0
 Clone this strategy (for copy semantics)
 

Detailed Description

Abstract strategy interface for filter matching.

Defines the contract for all filter matching strategies. Concrete strategies implement different matching algorithms.

Immutability: Strategy instances should be immutable after construction to ensure thread safety for concurrent filter evaluations.

Constructor & Destructor Documentation

◆ ~IFilterStrategy()

virtual filters::IFilterStrategy::~IFilterStrategy ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< IFilterStrategy > filters::IFilterStrategy::clone ( ) const
pure virtual

Clone this strategy (for copy semantics)

Returns
Unique pointer to cloned strategy

Implemented in filters::RegexFilterStrategy, filters::ExactMatchStrategy, filters::FuzzyMatchStrategy, and filters::WildcardStrategy.

◆ getName()

virtual std::string filters::IFilterStrategy::getName ( ) const
pure virtual

Get strategy name for serialization/debugging.

Returns
Strategy identifier (e.g., "regex", "exact", "fuzzy")

Implemented in filters::RegexFilterStrategy, filters::ExactMatchStrategy, filters::FuzzyMatchStrategy, and filters::WildcardStrategy.

◆ isValidPattern()

virtual bool filters::IFilterStrategy::isValidPattern ( const std::string &  pattern) const
pure virtual

Validate pattern syntax.

Parameters
patternThe pattern to validate
Returns
true if pattern is valid for this strategy, false otherwise

Used to provide early feedback when constructing filters.

Implemented in filters::ExactMatchStrategy, filters::WildcardStrategy, filters::RegexFilterStrategy, and filters::FuzzyMatchStrategy.

◆ matches()

virtual bool filters::IFilterStrategy::matches ( const std::string &  value,
const std::string &  pattern,
bool  caseSensitive 
) const
pure virtual

Match a value against the pattern.

Parameters
valueThe string to test
patternThe pattern to match against
caseSensitiveWhether matching should be case-sensitive
Returns
true if value matches pattern, false otherwise
Thread Safety:
Must be thread-safe for concurrent calls.

Implemented in filters::RegexFilterStrategy, filters::ExactMatchStrategy, filters::FuzzyMatchStrategy, and filters::WildcardStrategy.


The documentation for this class was generated from the following file: