KiCad PCB EDA Suite
Loading...
Searching...
No Matches
EDA_PATTERN_MATCH_REGEX Class Reference

#include <eda_pattern_match.h>

Inheritance diagram for EDA_PATTERN_MATCH_REGEX:
EDA_PATTERN_MATCH EDA_PATTERN_MATCH_REGEX_ANCHORED EDA_PATTERN_MATCH_WILDCARD EDA_PATTERN_MATCH_WILDCARD_ANCHORED

Public Member Functions

virtual bool SetPattern (const wxString &aPattern) override
 Set the pattern against which candidates will be matched.
 
virtual wxString const & GetPattern () const override
 Return the pattern passed to SetPattern().
 
virtual FIND_RESULT Find (const wxString &aCandidate) const override
 Return the location and possibly length of a match iff a given candidate string matches the set pattern.
 

Protected Attributes

wxString m_pattern
 
wxRegEx m_regex
 

Detailed Description

Definition at line 124 of file eda_pattern_match.h.

Member Function Documentation

◆ Find()

EDA_PATTERN_MATCH::FIND_RESULT EDA_PATTERN_MATCH_REGEX::Find ( const wxString &  aCandidate) const
overridevirtual

Return the location and possibly length of a match iff a given candidate string matches the set pattern.

Otherwise, return an invalid FIND_RESULT.

Implements EDA_PATTERN_MATCH.

Reimplemented in EDA_PATTERN_MATCH_WILDCARD.

Definition at line 127 of file eda_pattern_match.cpp.

References CLAMPED_VAL_INT_MAX, m_pattern, and m_regex.

Referenced by EDA_PATTERN_MATCH_WILDCARD::Find().

◆ GetPattern()

wxString const & EDA_PATTERN_MATCH_REGEX::GetPattern ( ) const
overridevirtual

Return the pattern passed to SetPattern().

Implements EDA_PATTERN_MATCH.

Reimplemented in EDA_PATTERN_MATCH_WILDCARD.

Definition at line 121 of file eda_pattern_match.cpp.

References m_pattern.

◆ SetPattern()

bool EDA_PATTERN_MATCH_REGEX::SetPattern ( const wxString &  aPattern)
overridevirtual

Set the pattern against which candidates will be matched.

If the pattern can not be processed, returns false.

Implements EDA_PATTERN_MATCH.

Reimplemented in EDA_PATTERN_MATCH_REGEX_ANCHORED, EDA_PATTERN_MATCH_WILDCARD, and EDA_PATTERN_MATCH_WILDCARD_ANCHORED.

Definition at line 79 of file eda_pattern_match.cpp.

References m_pattern, and m_regex.

Referenced by EDA_PATTERN_MATCH_REGEX_ANCHORED::SetPattern(), EDA_PATTERN_MATCH_WILDCARD::SetPattern(), and EDA_PATTERN_MATCH_WILDCARD_ANCHORED::SetPattern().

Member Data Documentation

◆ m_pattern

wxString EDA_PATTERN_MATCH_REGEX::m_pattern
protected

Definition at line 133 of file eda_pattern_match.h.

Referenced by Find(), GetPattern(), and SetPattern().

◆ m_regex

wxRegEx EDA_PATTERN_MATCH_REGEX::m_regex
protected

Definition at line 134 of file eda_pattern_match.h.

Referenced by Find(), and SetPattern().


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