KiCad PCB EDA Suite
EDA_PATTERN_MATCH_SUBSTR Class Reference

#include <eda_pattern_match.h>

Inheritance diagram for EDA_PATTERN_MATCH_SUBSTR:
EDA_PATTERN_MATCH

Public Member Functions

virtual bool SetPattern (const wxString &aPattern) override
 Set the pattern against which candidates will be matched. More...
 
virtual int Find (const wxString &aCandidate) const override
 Return the location of a match iff a given candidate string matches the set pattern. More...
 

Protected Attributes

wxString m_pattern
 

Detailed Description

Definition at line 66 of file eda_pattern_match.h.

Member Function Documentation

int EDA_PATTERN_MATCH_SUBSTR::Find ( const wxString &  aCandidate) const
overridevirtual

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

Otherwise, return EDA_PATTERN_NOT_FOUND.

Implements EDA_PATTERN_MATCH.

Definition at line 37 of file eda_pattern_match.cpp.

References EDA_PATTERN_NOT_FOUND, and m_pattern.

38 {
39  int loc = aCandidate.Find( m_pattern );
40 
41  return ( loc == wxNOT_FOUND ) ? EDA_PATTERN_NOT_FOUND : loc;
42 }
static const int EDA_PATTERN_NOT_FOUND
bool EDA_PATTERN_MATCH_SUBSTR::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.

Definition at line 30 of file eda_pattern_match.cpp.

References m_pattern.

31 {
32  m_pattern = aPattern;
33  return true;
34 }

Member Data Documentation

wxString EDA_PATTERN_MATCH_SUBSTR::m_pattern
protected

Definition at line 73 of file eda_pattern_match.h.

Referenced by Find(), and SetPattern().


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