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 wxString const & GetPattern () const override
 Return the pattern passed to SetPattern(). 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 71 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 44 of file eda_pattern_match.cpp.

References EDA_PATTERN_NOT_FOUND, and m_pattern.

45 {
46  int loc = aCandidate.Find( m_pattern );
47 
48  return ( loc == wxNOT_FOUND ) ? EDA_PATTERN_NOT_FOUND : loc;
49 }
static const int EDA_PATTERN_NOT_FOUND
wxString const & EDA_PATTERN_MATCH_SUBSTR::GetPattern ( ) const
overridevirtual

Return the pattern passed to SetPattern().

Implements EDA_PATTERN_MATCH.

Definition at line 38 of file eda_pattern_match.cpp.

References m_pattern.

39 {
40  return m_pattern;
41 }
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 31 of file eda_pattern_match.cpp.

References m_pattern.

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

Member Data Documentation

wxString EDA_PATTERN_MATCH_SUBSTR::m_pattern
protected

Definition at line 79 of file eda_pattern_match.h.

Referenced by Find(), GetPattern(), and SetPattern().


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