53    wxRegEx reOrcad( wxT( 
"(?i)[ ]*\\([ \t]+{+" ), wxRE_ADVANCED );
 
   54    wxASSERT( reOrcad.IsValid() );
 
   57    wxRegEx reLegacy( wxT( 
"(?i)#[ \t]+EESchema[ \t]+Netlist[ \t]+" ), wxRE_ADVANCED );
 
   58    wxASSERT( reLegacy.IsValid() );
 
   61    wxRegEx reKicad( wxT( 
"[ ]*\\(export(\\s+\\(version)?" ), wxRE_ADVANCED );
 
   62    wxASSERT( reKicad.IsValid() );
 
   70        if( reLegacy.Matches( line ) )
 
   72        else if( reKicad.Matches( line ) )
 
   74        else if( reOrcad.Matches( line ) )
 
   83                                                  const wxString& aNetlistFileName,
 
   84                                                  const wxString& aCompFootprintFileName )
 
   86    wxASSERT( aNetlist != 
nullptr );
 
   88    std::unique_ptr<FILE_LINE_READER> file_rdr =
 
   89            std::make_unique<FILE_LINE_READER>( aNetlistFileName );
 
   95    std::unique_ptr<CMP_READER>  cmp_rdr( aCompFootprintFileName.IsEmpty() ?
 
   97            new CMP_READER( 
new FILE_LINE_READER( aCompFootprintFileName ) ) );
 
  103        return new LEGACY_NETLIST_READER( file_rdr.release(), aNetlist, cmp_rdr.release() );
 
  106        return new KICAD_NETLIST_READER( file_rdr.release(), aNetlist, cmp_rdr.release() );
 
  128    wxCHECK_MSG( aNetlist != 
nullptr, 
true, wxT( 
"No netlist passed to CMP_READER::Load()" ) );
 
  142        if( !buffer.StartsWith( wxT( 
"BeginCmp" ) ) )
 
  154            if( buffer.StartsWith( wxT( 
"EndCmp" ) ) )
 
  158            value = buffer.AfterFirst( 
'=' );
 
  159            value = value.BeforeLast( 
';' );
 
  163            if( buffer.StartsWith( wxT( 
"Reference" ) ) )
 
  169            if( buffer.StartsWith( wxT( 
"IdModule  =" ) ) )
 
  175            if( buffer.StartsWith( wxT( 
"TimeStamp =" ) ) )
 
  192            if( !footprint.IsEmpty() && fpid.
Parse( footprint, 
true ) >= 0 )
 
  195                error.Printf( 
_( 
"Invalid footprint ID in\nfile: '%s'\nline: %d" ),
 
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...
 
void SetAltFPID(const LIB_ID &aFPID)
 
void SetFPID(const LIB_ID &aFPID)
 
const LIB_ID & GetFPID() const
 
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.
 
Base class to derive netlist readers from.
 
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.
 
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)