23#include <wx/tokenzr.h>
34 : m_pos( aOther.m_pos ), m_filter( aOther.m_filter )
40 : m_pos( (size_t) -1 ), m_filter( &aFilter )
48 if( !m_filter || !m_filter->m_list || m_filter->m_list->GetCount() == 0 )
54 int filter_type = m_filter->m_filter_type;
56 wxString& lib_name = m_filter->m_lib_name;
58 for( ++m_pos; m_pos < list->
GetCount(); ++m_pos )
67 if( !PinCountMatch( candidate ) )
73 if( !lib_name.IsEmpty() && !candidate.
InLibrary( lib_name ) )
79 if( !FootprintFilterMatch( candidate ) )
89 int matches, position;
92 for( std::unique_ptr<EDA_COMBINED_MATCHER>& matcher : m_filter->m_pattern_filters )
94 if( !matcher->Find( searchStr.Lower(), matches, position ) )
114 return ( m_pos == aOther.
m_pos ) && ( m_filter == aOther.
m_filter || m_pos == (size_t) -1 );
120 if( m_filter && m_filter->m_list && m_pos < m_filter->
m_list->
GetCount() )
121 return m_filter->m_list->GetItem( m_pos );
123 throw std::out_of_range(
"Attempt to dereference past FOOTPRINT_FILTER::end()" );
129 if( m_filter->m_footprint_filters.empty() )
135 for(
const std::unique_ptr<EDA_PATTERN_MATCH>& each_filter : m_filter->m_footprint_filters )
140 if( each_filter->GetPattern().Contains( wxS(
":" ) ) )
147 if( each_filter->Find(
name ) )
159 return m_filter->m_pin_count >= 0 &&
171 : m_list( nullptr ), m_pin_count( -1 ), m_filter_type( UNFILTERED_FP_LIST )
206 for(
const wxString& each_pattern : aFilters )
220 wxStringTokenizer tokenizer( aPattern.Lower() );
222 while( tokenizer.HasMoreTokens() )
224 const wxString term = tokenizer.GetNextToken().Lower();
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.