KiCad PCB EDA Suite
|
Relational match. More...
#include <eda_pattern_match.h>
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. | |
int | FindOne (const wxString &aCandidate) const |
Protected Types | |
enum | RELATION { LT , LE , EQ , GE , GT , ANY } |
Protected Attributes | |
wxString | m_pattern |
wxString | m_key |
RELATION | m_relation |
double | m_value |
Static Protected Attributes | |
static const std::map< wxString, double > | m_units |
Relational match.
Matches tokens of the format:
key:value or key=value
with search patterns of the format:
key<value, key<=value, key=value, key>=value, key>value
by parsing the value numerically and comparing.
Definition at line 178 of file eda_pattern_match.h.
|
protected |
Enumerator | |
---|---|
LT | |
LE | |
EQ | |
GE | |
GT | |
ANY |
Definition at line 188 of file eda_pattern_match.h.
|
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.
Definition at line 306 of file eda_pattern_match.cpp.
References CLAMPED_VAL_INT_MAX, EDA_PATTERN_NOT_FOUND, and FindOne().
int EDA_PATTERN_MATCH_RELATIONAL::FindOne | ( | const wxString & | aCandidate | ) | const |
Definition at line 329 of file eda_pattern_match.cpp.
References ANY, CLAMPED_VAL_INT_MAX, EDA_PATTERN_NOT_FOUND, EQ, GE, GT, LE, LT, m_key, m_relation, m_units, and m_value.
Referenced by Find().
|
overridevirtual |
Return the pattern passed to SetPattern().
Implements EDA_PATTERN_MATCH.
Definition at line 300 of file eda_pattern_match.cpp.
References m_pattern.
|
overridevirtual |
Set the pattern against which candidates will be matched.
If the pattern can not be processed, returns false.
Implements EDA_PATTERN_MATCH.
Definition at line 246 of file eda_pattern_match.cpp.
References ANY, EQ, GE, GT, LE, LT, m_key, m_pattern, m_relation, m_units, and m_value.
|
protected |
Definition at line 191 of file eda_pattern_match.h.
Referenced by FindOne(), and SetPattern().
|
protected |
Definition at line 190 of file eda_pattern_match.h.
Referenced by GetPattern(), and SetPattern().
|
protected |
Definition at line 192 of file eda_pattern_match.h.
Referenced by FindOne(), and SetPattern().
|
staticprotected |
Definition at line 195 of file eda_pattern_match.h.
Referenced by FindOne(), and SetPattern().
|
protected |
Definition at line 193 of file eda_pattern_match.h.
Referenced by FindOne(), and SetPattern().