Specification for a single filter criterion.
FilterSpecification provides a type-safe way to specify string matching criteria for use with StringFilter. Each specification defines one of three types of matching: exact match, substring match, or regular expression match. For regular expressions, case sensitivity must be explicitly specified.
Design Intent: All filter semantics are explicit at construction. Users state the filter type and, for regex filters, the case sensitivity.
Thread Safety: FilterSpecification objects are immutable after construction and thus thread-safe for concurrent read access.
Usage Examples:
Specification for a single filter criterion.
const std::string & pattern() const
Property: Pattern string.
Type
Type of filter specification.
CaseSensitivity
Regex case sensitivity mode.
- See also
- StringFilter
Definition at line 227 of file String.h.
#include <Rose/BinaryAnalysis/String.h>
◆ Type
Type of filter specification.
| Enumerator |
|---|
| EXACT_MATCH | Exact string match (case-sensitive)
|
| SUBSTRING | Substring match (case-sensitive)
|
| REGEX | Regular expression match.
|
Definition at line 230 of file String.h.
◆ CaseSensitivity
Regex case sensitivity mode.
| Enumerator |
|---|
| SENSITIVE | Case-sensitive matching.
|
| INSENSITIVE | Case-insensitive matching.
|
Definition at line 237 of file String.h.
◆ FilterSpecification() [1/2]
| Rose::BinaryAnalysis::Strings::FilterSpecification::FilterSpecification |
( |
Type |
type, |
|
|
const std::string & |
pattern |
|
) |
| |
Constructor for exact match or substring filter.
Creates a filter specification for exact string matching or substring matching. Exact match requires the entire string to match exactly (case-sensitive). Substring match succeeds if the pattern appears anywhere in the string (case-sensitive).
- Parameters
-
◆ FilterSpecification() [2/2]
| Rose::BinaryAnalysis::Strings::FilterSpecification::FilterSpecification |
( |
const std::string & |
pattern, |
|
|
CaseSensitivity |
caseSensitivity |
|
) |
| |
Constructor for regex filter with explicit case sensitivity.
Creates a filter specification for regular expression matching. The pattern is interpreted as a boost::regex pattern using ECMAScript syntax. Case sensitivity must be explicitly specified.
- Parameters
-
| pattern | The regular expression pattern (ECMAScript syntax) |
| caseSensitivity | Whether to match case-sensitively or case-insensitively |
◆ type()
| Type Rose::BinaryAnalysis::Strings::FilterSpecification::type |
( |
| ) |
const |
|
inline |
Property: Type of filter.
Definition at line 269 of file String.h.
◆ pattern()
| const std::string & Rose::BinaryAnalysis::Strings::FilterSpecification::pattern |
( |
| ) |
const |
|
inline |
Property: Pattern string.
Definition at line 272 of file String.h.
◆ caseSensitivity()
| CaseSensitivity Rose::BinaryAnalysis::Strings::FilterSpecification::caseSensitivity |
( |
| ) |
const |
|
inline |
Property: Case sensitivity (only meaningful for REGEX type).
Definition at line 275 of file String.h.
◆ isCaseSensitive()
| bool Rose::BinaryAnalysis::Strings::FilterSpecification::isCaseSensitive |
( |
| ) |
const |
|
inline |
Returns true if this is a case-sensitive regex filter.
Definition at line 278 of file String.h.
The documentation for this class was generated from the following file: