|
KiCad PCB EDA Suite
|
The columns one generator (the drill chart, a stackup table, ...) can produce, and the units and precision it starts from. More...
#include <generated_table_schema.h>
Public Member Functions | |
| GENERATED_TABLE_SCHEMA (std::vector< GENERATED_TABLE_COLUMN_DEF > aDefs, GENERATED_TABLE_UNITS aDefaultUnits, int aDefaultPrecision) | |
| const std::vector< GENERATED_TABLE_COLUMN_DEF > & | Defs () const |
| const GENERATED_TABLE_COLUMN_DEF * | Find (int aId) const |
| const GENERATED_TABLE_COLUMN_DEF * | FindToken (const wxString &aToken) const |
| const char * | Token (int aId) const |
| The file token for a known id, or a stable placeholder for one the schema does not recognize, so a writer always has something parseable to put in "(id ...)". | |
| GENERATED_TABLE_COLUMN | DefaultColumn (int aId) const |
| std::vector< GENERATED_TABLE_COLUMN > | Defaults () const |
| bool | Validate (std::vector< GENERATED_TABLE_COLUMN > &aColumns) const |
| Drop a column whose id the schema does not know and a column that repeats an id already kept, then clamp every surviving width. | |
| GENERATED_TABLE_UNITS | DefaultUnits () const |
| int | DefaultPrecision () const |
Private Attributes | |
| std::vector< GENERATED_TABLE_COLUMN_DEF > | m_defs |
| GENERATED_TABLE_UNITS | m_defaultUnits |
| int | m_defaultPrecision |
The columns one generator (the drill chart, a stackup table, ...) can produce, and the units and precision it starts from.
A schema is immutable once built, so every consumer reading the same id sees the same heading, alignment and default. Stable ids and tokens let a saved file outlive a KiCad release that reorders or extends the column list.
Definition at line 101 of file generated_table_schema.h.
| GENERATED_TABLE_SCHEMA::GENERATED_TABLE_SCHEMA | ( | std::vector< GENERATED_TABLE_COLUMN_DEF > | aDefs, |
| GENERATED_TABLE_UNITS | aDefaultUnits, | ||
| int | aDefaultPrecision ) |
Definition at line 31 of file generated_table_schema.cpp.
References m_defaultPrecision, m_defaultUnits, m_defs, and move.
| GENERATED_TABLE_COLUMN GENERATED_TABLE_SCHEMA::DefaultColumn | ( | int | aId | ) | const |
Definition at line 73 of file generated_table_schema.cpp.
References Find(), GENERATED_TABLE_COLUMN::m_Align, GENERATED_TABLE_COLUMN::m_Heading, and GENERATED_TABLE_COLUMN::m_Id.
Referenced by Defaults().
|
inline |
Definition at line 130 of file generated_table_schema.h.
References m_defaultPrecision.
Referenced by PCB_IO_KICAD_SEXPR::format(), and PCB_IO_KICAD_SEXPR_PARSER::parseGeneratedTable().
| std::vector< GENERATED_TABLE_COLUMN > GENERATED_TABLE_SCHEMA::Defaults | ( | ) | const |
Definition at line 88 of file generated_table_schema.cpp.
References DefaultColumn(), and m_defs.
Referenced by DRILL_CHART_TEMPLATE::MakeDefault(), and PCB_IO_KICAD_SEXPR_PARSER::parseGeneratedTable().
|
inline |
Definition at line 129 of file generated_table_schema.h.
References m_defaultUnits.
Referenced by PCB_IO_KICAD_SEXPR::format(), and PCB_IO_KICAD_SEXPR_PARSER::parseGeneratedTable().
|
inline |
Definition at line 107 of file generated_table_schema.h.
References m_defs.
| const GENERATED_TABLE_COLUMN_DEF * GENERATED_TABLE_SCHEMA::Find | ( | int | aId | ) | const |
Definition at line 40 of file generated_table_schema.cpp.
References m_defs.
Referenced by DefaultColumn(), PCB_IO_KICAD_SEXPR::format(), Token(), UnpackGeneratedTable(), and Validate().
| const GENERATED_TABLE_COLUMN_DEF * GENERATED_TABLE_SCHEMA::FindToken | ( | const wxString & | aToken | ) | const |
Definition at line 52 of file generated_table_schema.cpp.
References m_defs.
Referenced by DRILL_CHART_TEMPLATE::LoadFromFile(), and PCB_IO_KICAD_SEXPR_PARSER::parseGeneratedTable().
| const char * GENERATED_TABLE_SCHEMA::Token | ( | int | aId | ) | const |
The file token for a known id, or a stable placeholder for one the schema does not recognize, so a writer always has something parseable to put in "(id ...)".
Definition at line 64 of file generated_table_schema.cpp.
References Find(), m_defs, and GENERATED_TABLE_COLUMN_DEF::m_Token.
Referenced by PCB_IO_KICAD_SEXPR::format(), and DRILL_CHART_TEMPLATE::SaveToFile().
| bool GENERATED_TABLE_SCHEMA::Validate | ( | std::vector< GENERATED_TABLE_COLUMN > & | aColumns | ) | const |
Drop a column whose id the schema does not know and a column that repeats an id already kept, then clamp every surviving width.
False when nothing usable is left or the clamped total is implausibly wide, so a hostile or truncated file cannot hand a caller an empty table to divide by or push its geometry past int range.
Definition at line 102 of file generated_table_schema.cpp.
References Find(), GENERATED_TABLE_MAX_COLUMN_WIDTH, and GENERATED_TABLE_MAX_TOTAL_WIDTH.
Referenced by PCB_IO_KICAD_SEXPR_PARSER::parseGeneratedTable(), and UnpackGeneratedTable().
|
private |
Definition at line 135 of file generated_table_schema.h.
Referenced by DefaultPrecision(), and GENERATED_TABLE_SCHEMA().
|
private |
Definition at line 134 of file generated_table_schema.h.
Referenced by DefaultUnits(), and GENERATED_TABLE_SCHEMA().
|
private |
Definition at line 133 of file generated_table_schema.h.
Referenced by Defaults(), Defs(), Find(), FindToken(), GENERATED_TABLE_SCHEMA(), and Token().