KiCad PCB EDA Suite
Loading...
Searching...
No Matches
corpus.cpp File Reference
#include "corpus.h"
#include <fstream>
#include <sstream>
#include <wx/filename.h>
#include <wx/utils.h>
#include <json_common.h>

Go to the source code of this file.

Functions

static wxString resolveAgainstRoot (const wxString &aRoot, const wxString &aRelative)
 Resolve a manifest-relative path against the corpus root and return an absolute path.
 
const char * ConstraintTypeName (DRC_CONSTRAINT_T aType)
 Human-readable token for a DRC_CONSTRAINT_T, matching the .kicad_dru keyword where one exists.
 
const std::vector< DRC_CONSTRAINT_T > & AllConstraintTypes ()
 Every DRC_CONSTRAINT_T the engine can carry rules for, in enum order, excluding NULL_CONSTRAINT.
 
const std::vector< wxString > & AllPredicateNames ()
 Every pcbexpr predicate registered in pcbexpr_functions.cpp, used for textual coverage scans.
 
std::vector< wxString > ScanPredicatesInRules (const wxString &aRulesText)
 Scan raw .kicad_dru text for occurrences of each registered predicate name.
 

Function Documentation

◆ AllConstraintTypes()

◆ AllPredicateNames()

const std::vector< wxString > & AllPredicateNames ( )

Every pcbexpr predicate registered in pcbexpr_functions.cpp, used for textual coverage scans.

Definition at line 230 of file corpus.cpp.

Referenced by ScanPredicatesInRules().

◆ ConstraintTypeName()

◆ resolveAgainstRoot()

static wxString resolveAgainstRoot ( const wxString & aRoot,
const wxString & aRelative )
static

Resolve a manifest-relative path against the corpus root and return an absolute path.

Definition at line 54 of file corpus.cpp.

Referenced by CORPUS::Load().

◆ ScanPredicatesInRules()

std::vector< wxString > ScanPredicatesInRules ( const wxString & aRulesText)

Scan raw .kicad_dru text for occurrences of each registered predicate name.

A predicate is counted present when its name appears followed by an open paren, which is how the expression grammar invokes it. Returns the set of predicate names found.

Definition at line 257 of file corpus.cpp.

References AllPredicateNames(), and name.