29#ifndef EDA_PATTERN_MATCH_H
30#define EDA_PATTERN_MATCH_H
76 explicit operator bool()
const
110 virtual bool SetPattern(
const wxString& aPattern )
override;
111 virtual wxString
const&
GetPattern()
const override;
125 virtual bool SetPattern(
const wxString& aPattern )
override;
126 virtual wxString
const&
GetPattern()
const override;
138 virtual bool SetPattern(
const wxString& aPattern )
override;
145 virtual bool SetPattern(
const wxString& aPattern )
override;
146 virtual wxString
const&
GetPattern()
const override;
157 virtual bool SetPattern(
const wxString& aPattern )
override;
177 virtual bool SetPattern(
const wxString& aPattern )
override;
178 virtual wxString
const&
GetPattern()
const override;
180 int FindOne(
const wxString& aCandidate )
const;
193 static const std::map<wxString, double>
m_units;
221 bool Find(
const wxString& aTerm,
int& aMatchersTriggered,
int& aPosition );
223 bool Find(
const wxString& aTerm );
229 int ScoreTerms( std::vector<SEARCH_TERM>& aWeightedTerms );
233 void AddMatcher(
const wxString& aPattern, std::unique_ptr<EDA_PATTERN_MATCH> aMatcher );
int ScoreTerms(std::vector< SEARCH_TERM > &aWeightedTerms)
std::vector< std::unique_ptr< EDA_PATTERN_MATCH > > m_matchers
void AddMatcher(const wxString &aPattern, std::unique_ptr< EDA_PATTERN_MATCH > aMatcher)
bool Find(const wxString &aTerm, int &aMatchersTriggered, int &aPosition)
const wxString & GetPattern() const
bool StartsWith(const wxString &aTerm)
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 patte...
virtual bool SetPattern(const wxString &aPattern) override
Set the pattern against which candidates will be matched.
virtual bool SetPattern(const wxString &aPattern) override
Set the pattern against which candidates will be matched.
static wxRegEx m_regex_search
int FindOne(const wxString &aCandidate) const
static wxRegEx m_regex_description
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 patte...
virtual wxString const & GetPattern() const override
Return the pattern passed to SetPattern().
static const std::map< wxString, double > m_units
virtual wxString const & GetPattern() const override
Return the pattern passed to SetPattern().
virtual bool SetPattern(const wxString &aPattern) override
Set the pattern against which candidates will be matched.
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 patte...
virtual bool SetPattern(const wxString &aPattern) override
Set the pattern against which candidates will be matched.
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 patte...
wxString m_wildcard_pattern
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 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 iff a given candidate string matches the set patte...
virtual ~EDA_PATTERN_MATCH()
static const int EDA_PATTERN_NOT_FOUND
SEARCH_TERM(const wxString &aText, int aScore)