29#ifndef EDA_PATTERN_MATCH_H
30#define EDA_PATTERN_MATCH_H
77 explicit operator bool()
const
114 virtual bool SetPattern(
const wxString& aPattern )
override;
115 virtual wxString
const& GetPattern()
const override;
116 virtual FIND_RESULT Find(
const wxString& aCandidate )
const override;
130 virtual bool SetPattern(
const wxString& aPattern )
override;
131 virtual wxString
const& GetPattern()
const override;
132 virtual FIND_RESULT Find(
const wxString& aCandidate )
const override;
143 virtual bool SetPattern(
const wxString& aPattern )
override;
151 virtual bool SetPattern(
const wxString& aPattern )
override;
152 virtual wxString
const& GetPattern()
const override;
153 virtual FIND_RESULT Find(
const wxString& aCandidate )
const override;
163 virtual bool SetPattern(
const wxString& aPattern )
override;
183 virtual bool SetPattern(
const wxString& aPattern )
override;
184 virtual wxString
const& GetPattern()
const override;
185 virtual FIND_RESULT Find(
const wxString& aCandidate )
const override;
186 int FindOne(
const wxString& aCandidate )
const;
197 static const std::map<wxString, double>
m_units;
237 bool Find(
const wxString& aTerm,
int& aMatchersTriggered,
int& aPosition );
239 bool Find(
const wxString& aTerm );
241 bool StartsWith(
const wxString& aTerm );
243 const wxString& GetPattern()
const;
245 int ScoreTerms( std::vector<SEARCH_TERM>& aWeightedTerms );
249 void AddMatcher(
const wxString& aPattern, std::unique_ptr<EDA_PATTERN_MATCH> aMatcher );
std::vector< std::unique_ptr< EDA_PATTERN_MATCH > > m_matchers
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 ...
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 ...
Match regular expression.
static const std::map< wxString, double > m_units
wxString m_wildcard_pattern
Interface for a pattern matcher for which there are several implementations.
virtual bool SetPattern(const wxString &aPattern)=0
Set the pattern against which candidates will be matched.
virtual wxString const & GetPattern() const =0
Return the pattern passed to SetPattern().
virtual FIND_RESULT Find(const wxString &aCandidate) const =0
Return the location and possibly length of a match if a given candidate string matches the set patter...
virtual ~EDA_PATTERN_MATCH()
static const int EDA_PATTERN_NOT_FOUND
A structure for storing weighted search terms.
SEARCH_TERM(const wxString &aText, int aScore)