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

#include <eda_pattern_match.h>

Public Member Functions

 EDA_COMBINED_MATCHER (const wxString &aPattern, COMBINED_MATCHER_CONTEXT aContext)
 
 EDA_COMBINED_MATCHER (EDA_COMBINED_MATCHER const &)=delete
 Deleted copy or else we have to implement copy constructors for all EDA_PATTERN_MATCH classes due to this class' m_matchers member being copied.
 
EDA_COMBINED_MATCHERoperator= (EDA_COMBINED_MATCHER const &)=delete
 Deleted copy or else we have to implement copy constructors for all EDA_PATTERN_MATCH classes due to this class' m_matchers member being copied.
 
bool Find (const wxString &aTerm, int &aMatchersTriggered, int &aPosition)
 Look in all existing matchers, return the earliest match of any of the existing.
 
bool Find (const wxString &aTerm)
 
bool StartsWith (const wxString &aTerm)
 
const wxString & GetPattern () const
 
int ScoreTerms (std::vector< SEARCH_TERM > &aWeightedTerms)
 

Private Member Functions

void AddMatcher (const wxString &aPattern, std::unique_ptr< EDA_PATTERN_MATCH > aMatcher)
 Add matcher if it can compile the pattern.
 

Private Attributes

std::vector< std::unique_ptr< EDA_PATTERN_MATCH > > m_matchers
 
wxString m_pattern
 

Detailed Description

Definition at line 211 of file eda_pattern_match.h.

Constructor & Destructor Documentation

◆ EDA_COMBINED_MATCHER() [1/2]

EDA_COMBINED_MATCHER::EDA_COMBINED_MATCHER ( const wxString &  aPattern,
COMBINED_MATCHER_CONTEXT  aContext 
)

Definition at line 390 of file eda_pattern_match.cpp.

References AddMatcher(), CTX_LIBITEM, CTX_NET, CTX_NETCLASS, CTX_SEARCH, and CTX_SIGNAL.

◆ EDA_COMBINED_MATCHER() [2/2]

EDA_COMBINED_MATCHER::EDA_COMBINED_MATCHER ( EDA_COMBINED_MATCHER const &  )
delete

Deleted copy or else we have to implement copy constructors for all EDA_PATTERN_MATCH classes due to this class' m_matchers member being copied.

Member Function Documentation

◆ AddMatcher()

void EDA_COMBINED_MATCHER::AddMatcher ( const wxString &  aPattern,
std::unique_ptr< EDA_PATTERN_MATCH aMatcher 
)
private

Add matcher if it can compile the pattern.

Definition at line 523 of file eda_pattern_match.cpp.

References m_matchers.

Referenced by EDA_COMBINED_MATCHER().

◆ Find() [1/2]

bool EDA_COMBINED_MATCHER::Find ( const wxString &  aTerm)

Definition at line 455 of file eda_pattern_match.cpp.

References m_matchers.

◆ Find() [2/2]

bool EDA_COMBINED_MATCHER::Find ( const wxString &  aTerm,
int &  aMatchersTriggered,
int &  aPosition 
)

Look in all existing matchers, return the earliest match of any of the existing.

Parameters
aTermterm to look for.
aMatchersTriggeredout: number of matcher that found the term.
aPostionout: where the term was found, or EDA_PATTERN_NOT_FOUND.
Returns
true if any matchers found the term

Definition at line 433 of file eda_pattern_match.cpp.

References EDA_PATTERN_NOT_FOUND, m_matchers, and EDA_PATTERN_MATCH::FIND_RESULT::start.

Referenced by EDA_ITEM::Matches(), DIALOG_SIM_COMMAND::OnFilterText(), SIMULATOR_FRAME_UI::rebuildSignalsGrid(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), and ScoreTerms().

◆ GetPattern()

wxString const & EDA_COMBINED_MATCHER::GetPattern ( ) const

Definition at line 517 of file eda_pattern_match.cpp.

References m_pattern.

Referenced by ScoreTerms().

◆ operator=()

EDA_COMBINED_MATCHER & EDA_COMBINED_MATCHER::operator= ( EDA_COMBINED_MATCHER const &  )
delete

Deleted copy or else we have to implement copy constructors for all EDA_PATTERN_MATCH classes due to this class' m_matchers member being copied.

◆ ScoreTerms()

◆ StartsWith()

bool EDA_COMBINED_MATCHER::StartsWith ( const wxString &  aTerm)

Member Data Documentation

◆ m_matchers

std::vector<std::unique_ptr<EDA_PATTERN_MATCH> > EDA_COMBINED_MATCHER::m_matchers
private

Definition at line 251 of file eda_pattern_match.h.

Referenced by AddMatcher(), Find(), and StartsWith().

◆ m_pattern

wxString EDA_COMBINED_MATCHER::m_pattern
private

Definition at line 252 of file eda_pattern_match.h.

Referenced by GetPattern().


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