KiCad PCB EDA Suite
Loading...
Searching...
No Matches
CORPUS Class Reference

Read and resolve the corpus manifest pointed at by KICAD_DRC_BENCH_CORPUS. More...

#include <corpus.h>

Static Public Member Functions

static bool IsConfigured ()
 True when KICAD_DRC_BENCH_CORPUS is set and names an existing directory.
 
static wxString Root ()
 The resolved corpus root, or an empty string when unconfigured.
 
static bool Load (std::vector< CORPUS_ENTRY > &aEntries, wxString &aError)
 Parse <root>/corpus.json into resolved entries.
 

Detailed Description

Read and resolve the corpus manifest pointed at by KICAD_DRC_BENCH_CORPUS.

The env var names a directory containing corpus.json, an array of objects with board/rules/tier/source/notes keys whose board and rules paths are relative to that directory. A missing or unset env var is not an error; the loader simply reports an empty result so the tool can print a skip and exit cleanly, matching the QA rule that absent local corpora must never hard-fail.

Definition at line 55 of file corpus.h.

Member Function Documentation

◆ IsConfigured()

bool CORPUS::IsConfigured ( )
static

True when KICAD_DRC_BENCH_CORPUS is set and names an existing directory.

Definition at line 31 of file corpus.cpp.

Referenced by Load(), and main().

◆ Load()

bool CORPUS::Load ( std::vector< CORPUS_ENTRY > & aEntries,
wxString & aError )
static

Parse <root>/corpus.json into resolved entries.

Returns false and fills aError on a malformed or missing manifest. An unconfigured corpus returns true with no entries so callers can treat it as a graceful skip.

Definition at line 74 of file corpus.cpp.

References CORPUS_ENTRY::board, IsConfigured(), CORPUS_ENTRY::notes, CORPUS_ENTRY::quick, resolveAgainstRoot(), Root(), CORPUS_ENTRY::rules, CORPUS_ENTRY::source, and CORPUS_ENTRY::tier.

Referenced by main().

◆ Root()

wxString CORPUS::Root ( )
static

The resolved corpus root, or an empty string when unconfigured.

Definition at line 42 of file corpus.cpp.

Referenced by Load(), and main().


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