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

Read a component footprint link file (*.cmp) format. More...

#include <netlist_reader.h>

Public Member Functions

 CMP_READER (LINE_READER *aLineReader)
 
 ~CMP_READER ()
 
bool Load (NETLIST *aNetlist)
 Read the *.cmp file format contains the component footprint assignments created by CvPcb into aNetlist.
 

Private Attributes

LINE_READERm_lineReader
 The line reader to read.
 

Detailed Description

Read a component footprint link file (*.cmp) format.

Definition at line 44 of file netlist_reader.h.

Constructor & Destructor Documentation

◆ CMP_READER()

CMP_READER::CMP_READER ( LINE_READER aLineReader)
inline
Parameters
aLineReaderis a LINE_READER (in fact a FILE_LINE_READER) which is owned by me ( and deleted by me) to read the component footprint link file.

Definition at line 52 of file netlist_reader.h.

References m_lineReader.

◆ ~CMP_READER()

CMP_READER::~CMP_READER ( )
inline

Definition at line 57 of file netlist_reader.h.

References m_lineReader.

Member Function Documentation

◆ Load()

bool CMP_READER::Load ( NETLIST aNetlist)

Read the *.cmp file format contains the component footprint assignments created by CvPcb into aNetlist.

Sample file footprint assignment entry:

Cmp-Mod V01 Genere by CvPcb 29/10/2003-13: 11:6 * BeginCmp TimeStamp = /32307DE2/AA450F67; Reference = C1; ValeurCmp = 47uF; IdModule = CP6; EndCmp

Todo:
At some point in the future, use the footprint field in the new s-expression netlist file to assign a footprint to a component instead of using a secondary (*.cmp) file.
Parameters
aNetlistis the NETLIST to read into.
Exceptions
IO_ERRORif a the LINE_READER IO error occurs.
PARSE_ERRORif an error occurs while parsing the file.
Returns
true if OK, false if a component reference found in the .cmp file is not found in netlist, which means the .cmp file is not updated. This is an usual case, in CvPcb, but can be used to print a warning in Pcbnew.

Definition at line 115 of file netlist_reader.cpp.

References _, LIB_ID::empty(), From_UTF8(), NETLIST::GetComponentByReference(), COMPONENT::GetFPID(), LINE_READER::GetSource(), LINE_READER::Line(), LINE_READER::LineNumber(), m_lineReader, LIB_ID::Parse(), LINE_READER::ReadLine(), COMPONENT::SetAltFPID(), COMPONENT::SetFPID(), and THROW_IO_ERROR.

Referenced by LEGACY_NETLIST_READER::LoadNetlist(), and KICAD_NETLIST_READER::LoadNetlist().

Member Data Documentation

◆ m_lineReader

LINE_READER* CMP_READER::m_lineReader
private

The line reader to read.

Definition at line 95 of file netlist_reader.h.

Referenced by CMP_READER(), Load(), and ~CMP_READER().


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