KiCad PCB EDA Suite
Loading...
Searching...
No Matches
design_block.cpp
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation, either version 3 of the License, or (at your
9
* option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#include <
design_block.h
>
21
22
#include <wx/tokenzr.h>
23
24
25
std::vector<SEARCH_TERM>
DESIGN_BLOCK::GetSearchTerms
()
26
{
27
std::vector<SEARCH_TERM> terms;
28
29
terms.emplace_back(
SEARCH_TERM
(
GetLibNickname
(), 4 ) );
30
terms.emplace_back(
SEARCH_TERM
(
GetName
(), 8 ) );
31
terms.emplace_back(
SEARCH_TERM
(
GetLIB_ID
().
Format
(), 16 ) );
32
33
wxStringTokenizer keywordTokenizer(
GetKeywords
(), wxS(
" "
), wxTOKEN_STRTOK );
34
35
while
( keywordTokenizer.HasMoreTokens() )
36
terms.emplace_back(
SEARCH_TERM
( keywordTokenizer.GetNextToken(), 4 ) );
37
38
// Also include keywords as one long string, just in case
39
terms.emplace_back(
SEARCH_TERM
(
GetKeywords
(), 1 ) );
40
terms.emplace_back(
SEARCH_TERM
(
GetDesc
(), 1 ) );
41
42
return
terms;
43
}
DESIGN_BLOCK::GetLibNickname
wxString GetLibNickname() const override
Definition
design_block.h:40
DESIGN_BLOCK::GetDesc
wxString GetDesc() override
Definition
design_block.h:41
DESIGN_BLOCK::GetLIB_ID
LIB_ID GetLIB_ID() const override
Definition
design_block.h:38
DESIGN_BLOCK::GetSearchTerms
std::vector< SEARCH_TERM > GetSearchTerms() override
Definition
design_block.cpp:25
DESIGN_BLOCK::GetKeywords
const wxString & GetKeywords() const
Definition
design_block.h:51
DESIGN_BLOCK::GetName
wxString GetName() const override
Definition
design_block.h:39
design_block.h
Format
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition
ptree.cpp:198
SEARCH_TERM
A structure for storing weighted search terms.
Definition
eda_pattern_match.h:48
src
common
design_block.cpp
Generated on Tue Oct 28 2025 00:06:12 for KiCad PCB EDA Suite by
1.13.2