31#include <netlist_reader/netlist_reader.h> 
   47    wxRegEx reOrcad( wxT( 
"(?i)[ ]*\\([ \t]+{+" ), wxRE_ADVANCED );
 
   48    wxASSERT( reOrcad.IsValid() );
 
   51    wxRegEx reLegacy( wxT( 
"(?i)#[ \t]+EESchema[ \t]+Netlist[ \t]+" ), wxRE_ADVANCED );
 
   52    wxASSERT( reLegacy.IsValid() );
 
   55    wxRegEx reKicad( wxT( 
"[ ]*\\(export(\\s+\\(version)?" ), wxRE_ADVANCED );
 
   56    wxASSERT( reKicad.IsValid() );
 
   64        if( reLegacy.Matches( line ) )
 
   66        else if( reKicad.Matches( line ) )
 
   68        else if( reOrcad.Matches( line ) )
 
 
   77                                                  const wxString& aNetlistFileName,
 
   78                                                  const wxString& aCompFootprintFileName )
 
   80    wxASSERT( aNetlist != 
nullptr );
 
   82    std::unique_ptr<FILE_LINE_READER> file_rdr =
 
   83            std::make_unique<FILE_LINE_READER>( aNetlistFileName );
 
   89    std::unique_ptr<CMP_READER>  cmp_rdr( aCompFootprintFileName.IsEmpty() ?
 
 
  122    wxCHECK_MSG( aNetlist != 
nullptr, 
true, wxT( 
"No netlist passed to CMP_READER::Load()" ) );
 
  136        if( !buffer.StartsWith( wxT( 
"BeginCmp" ) ) )
 
  148            if( buffer.StartsWith( wxT( 
"EndCmp" ) ) )
 
  152            value = buffer.AfterFirst( 
'=' );
 
  153            value = value.BeforeLast( 
';' );
 
  157            if( buffer.StartsWith( wxT( 
"Reference" ) ) )
 
  163            if( buffer.StartsWith( wxT( 
"IdModule  =" ) ) )
 
  169            if( buffer.StartsWith( wxT( 
"TimeStamp =" ) ) )
 
  186            if( !footprint.IsEmpty() && fpid.
Parse( footprint, 
true ) >= 0 )
 
  189                error.Printf( 
_( 
"Invalid footprint ID in\nfile: '%s'\nline: %d" ),
 
 
Read a component footprint link file (*.cmp) format.
 
LINE_READER * m_lineReader
The line reader to read.
 
bool Load(NETLIST *aNetlist)
Read the *.cmp file format contains the component footprint assignments created by CvPcb into aNetlis...
 
Store all of the related component information found in a netlist.
 
void SetAltFPID(const LIB_ID &aFPID)
 
void SetFPID(const LIB_ID &aFPID)
 
const LIB_ID & GetFPID() const
 
A LINE_READER that reads from an open file.
 
Read the new s-expression based KiCad netlist format.
 
Read the KiCad legacy and the old Orcad netlist formats.
 
A logical library item identifier and consists of various portions much like a URI.
 
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
 
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
 
virtual char * ReadLine()=0
Read a line of text into the buffer and increments the line number counter.
 
char * Line() const
Return a pointer to the last line that was read in.
 
static NETLIST_READER * GetNetlistReader(NETLIST *aNetlist, const wxString &aNetlistFileName, const wxString &aCompFootprintFileName=wxEmptyString)
Attempt to determine the net list file type of aNetlistFileName and return the appropriate NETLIST_RE...
 
static NETLIST_FILE_T GuessNetlistFileType(LINE_READER *aLineReader)
Look at aFileHeaderLine to see if it matches any of the netlist file types it knows about.
 
CMP_READER * m_footprintReader
The reader used to load the footprint links. If NULL, footprint links are not read.
 
LINE_READER * m_lineReader
The line reader of the netlist.
 
NETLIST_READER(LINE_READER *aLineReader, NETLIST *aNetlist, CMP_READER *aFootprintLinkReader=nullptr)
 
virtual ~NETLIST_READER()
 
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
 
COMPONENT * GetComponentByReference(const wxString &aReference)
Return a COMPONENT by aReference.
 
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
 
wxString From_UTF8(const char *cstring)