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

Exact string matching. More...

#include <IFilterStrategy.hpp>

Inheritance diagram for filters::ExactMatchStrategy:
Inheritance graph
Collaboration diagram for filters::ExactMatchStrategy:
Collaboration graph

Public Member Functions

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

Detailed Description

Exact string matching.

Fast exact comparison, case-sensitive or insensitive. Much faster than regex for exact matches.

Performance:
  • Matching: O(n) string comparison
  • Memory: No additional state
  • Optimization: Could use hash-based lookup for large datasets

Constructor & Destructor Documentation

◆ ExactMatchStrategy()

filters::ExactMatchStrategy::ExactMatchStrategy ( )
default

Member Function Documentation

◆ clone()

std::unique_ptr< IFilterStrategy > filters::ExactMatchStrategy::clone ( ) const
inlineoverridevirtual

Clone this strategy (for copy semantics)

Returns
Unique pointer to cloned strategy

Implements filters::IFilterStrategy.

◆ getName()

std::string filters::ExactMatchStrategy::getName ( ) const
inlineoverridevirtual

Get strategy name for serialization/debugging.

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

Implements filters::IFilterStrategy.

◆ isValidPattern()

bool filters::ExactMatchStrategy::isValidPattern ( const std::string &  pattern) const
inlineoverridevirtual

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.

Implements filters::IFilterStrategy.

◆ matches()

bool filters::ExactMatchStrategy::matches ( const std::string &  value,
const std::string &  pattern,
bool  caseSensitive 
) const
overridevirtual

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.

Implements filters::IFilterStrategy.


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