KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
TEMPLATES Class Reference

#include <template_fieldnames.h>

Public Member Functions

 TEMPLATES ()
 
void Format (OUTPUTFORMATTER *out, bool aGlobal) const
 Serialize this object out as text into the given OUTPUTFORMATTER.
 
void AddTemplateFieldName (const TEMPLATE_FIELDNAME &aFieldName, bool aGlobal)
 Insert or append a wanted symbol field name into the field names template.
 
void AddTemplateFieldNames (const wxString &aSerializedFieldNames)
 Add a serialized list of template field names.
 
void DeleteAllFieldNameTemplates (bool aGlobal)
 Delete the entire contents.
 
const std::vector< TEMPLATE_FIELDNAME > & GetTemplateFieldNames ()
 Return a template field name list for read only access.
 
const std::vector< TEMPLATE_FIELDNAME > & GetTemplateFieldNames (bool aGlobal)
 Return a specific list (global or project) for read only access.
 
const TEMPLATE_FIELDNAMEGetFieldName (const wxString &aName)
 Search for aName in the template field name list.
 

Protected Member Functions

void resolveTemplates ()
 Flatten project and global templates into a single list.
 
void parse (TEMPLATE_FIELDNAMES_LEXER *in, bool aGlobal)
 

Private Attributes

std::vector< TEMPLATE_FIELDNAMEm_globals
 
std::vector< TEMPLATE_FIELDNAMEm_project
 
std::vector< TEMPLATE_FIELDNAMEm_resolved
 
bool m_resolvedDirty
 

Detailed Description

Definition at line 143 of file template_fieldnames.h.

Constructor & Destructor Documentation

◆ TEMPLATES()

TEMPLATES::TEMPLATES ( )
inline

Definition at line 146 of file template_fieldnames.h.

Member Function Documentation

◆ AddTemplateFieldName()

void TEMPLATES::AddTemplateFieldName ( const TEMPLATE_FIELDNAME aFieldName,
bool  aGlobal 
)

Insert or append a wanted symbol field name into the field names template.

Should be used for any symbol property editor. If the name already exists, it overwrites the same name.

Parameters
aFieldNameis a full description of the wanted field, and it must not match any of the default field names.
aGlobalindicates whether to add to the global or project table.

Definition at line 248 of file template_fieldnames.cpp.

References GetCanonicalFieldName(), m_globals, TEMPLATE_FIELDNAME::m_Name, m_project, m_resolvedDirty, and MANDATORY_FIELDS.

Referenced by parse(), SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS(), and PANEL_TEMPLATE_FIELDNAMES::TransferDataFromWindow().

◆ AddTemplateFieldNames()

void TEMPLATES::AddTemplateFieldNames ( const wxString &  aSerializedFieldNames)

◆ DeleteAllFieldNameTemplates()

void TEMPLATES::DeleteAllFieldNameTemplates ( bool  aGlobal)

◆ Format()

void TEMPLATES::Format ( OUTPUTFORMATTER out,
bool  aGlobal 
) const

Serialize this object out as text into the given OUTPUTFORMATTER.

Definition at line 158 of file template_fieldnames.cpp.

References m_globals, m_project, and OUTPUTFORMATTER::Print().

Referenced by PANEL_TEMPLATE_FIELDNAMES::TransferDataFromWindow().

◆ GetFieldName()

const TEMPLATE_FIELDNAME * TEMPLATES::GetFieldName ( const wxString &  aName)

Search for aName in the template field name list.

Parameters
aNameA wxString object containing the field name to search for.
Returns
the template field name if found; NULL otherwise.

Definition at line 326 of file template_fieldnames.cpp.

References m_resolved, m_resolvedDirty, and resolveTemplates().

Referenced by FIELDS_GRID_TABLE::GetAttr().

◆ GetTemplateFieldNames() [1/2]

◆ GetTemplateFieldNames() [2/2]

const std::vector< TEMPLATE_FIELDNAME > & TEMPLATES::GetTemplateFieldNames ( bool  aGlobal)

Return a specific list (global or project) for read only access.

Definition at line 317 of file template_fieldnames.cpp.

References m_globals, and m_project.

◆ parse()

void TEMPLATES::parse ( TEMPLATE_FIELDNAMES_LEXER *  in,
bool  aGlobal 
)
protected

◆ resolveTemplates()

void TEMPLATES::resolveTemplates ( )
protected

Flatten project and global templates into a single list.

(Project templates take precedence.)

Definition at line 220 of file template_fieldnames.cpp.

References m_globals, m_project, m_resolved, m_resolvedDirty, and project.

Referenced by GetFieldName(), and GetTemplateFieldNames().

Member Data Documentation

◆ m_globals

std::vector<TEMPLATE_FIELDNAME> TEMPLATES::m_globals
private

◆ m_project

std::vector<TEMPLATE_FIELDNAME> TEMPLATES::m_project
private

◆ m_resolved

std::vector<TEMPLATE_FIELDNAME> TEMPLATES::m_resolved
private

◆ m_resolvedDirty

bool TEMPLATES::m_resolvedDirty
private

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