KiCad PCB EDA Suite
BOM_CFG_PARSER Class Reference

Used for parsing legacy-format bom plugin configurations. More...

Inheritance diagram for BOM_CFG_PARSER:

Public Member Functions

 BOM_CFG_PARSER (std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > *aPluginList, const char *aData, const wxString &aSource)
 
void Parse ()
 

Private Member Functions

void parseGenerator ()
 

Private Attributes

std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > * m_pluginList
 

Detailed Description

Used for parsing legacy-format bom plugin configurations.

Only used for migrating into EESCHEMA_SETTINGS JSON format.

Definition at line 652 of file eeschema_settings.cpp.

Constructor & Destructor Documentation

◆ BOM_CFG_PARSER()

BOM_CFG_PARSER::BOM_CFG_PARSER ( std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > *  aPluginList,
const char *  aData,
const wxString &  aSource 
)

Definition at line 745 of file eeschema_settings.cpp.

746  :
747  DIALOG_BOM_CFG_LEXER( aLine, aSource )
748 {
749  wxASSERT( aPluginList );
750  m_pluginList = aPluginList;
751 }
std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > * m_pluginList

References m_pluginList.

Member Function Documentation

◆ Parse()

void BOM_CFG_PARSER::Parse ( )

Definition at line 754 of file eeschema_settings.cpp.

755 {
756  T token;
757 
758  while( ( token = NextTok() ) != T_RIGHT )
759  {
760  if( token == T_EOF)
761  break;
762 
763  if( token == T_LEFT )
764  token = NextTok();
765 
766  if( token == T_plugins )
767  continue;
768 
769  switch( token )
770  {
771  case T_plugin: // Defines a new plugin
772  parseGenerator();
773  break;
774 
775  default:
776 // Unexpected( CurText() );
777  break;
778  }
779  }
780 }

References parseGenerator().

Referenced by EESCHEMA_SETTINGS::migrateBomSettings().

◆ parseGenerator()

void BOM_CFG_PARSER::parseGenerator ( )
private

Definition at line 783 of file eeschema_settings.cpp.

784 {
785  wxString str;
787 
788  NeedSYMBOLorNUMBER();
789  settings.path = FromUTF8();
790 
791  T token;
792 
793  while( ( token = NextTok() ) != T_RIGHT )
794  {
795  if( token == T_EOF)
796  break;
797 
798  switch( token )
799  {
800  case T_LEFT:
801  break;
802 
803  case T_cmd:
804  NeedSYMBOLorNUMBER();
805 
806  settings.command = FromUTF8();
807 
808  NeedRIGHT();
809  break;
810 
811  case T_opts:
812  {
813  NeedSYMBOLorNUMBER();
814 
815  wxString option = FromUTF8();
816 
817  if( option.StartsWith( "nickname=", &str ) )
818  settings.name = str;
819 
820  NeedRIGHT();
821  break;
822  }
823 
824  default:
825  Unexpected( CurText() );
826  break;
827  }
828  }
829 
830  m_pluginList->emplace_back( settings );
831 }
std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > * m_pluginList

References EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS::command, m_pluginList, EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS::name, and EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS::path.

Referenced by Parse().

Member Data Documentation

◆ m_pluginList

std::vector<EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS>* BOM_CFG_PARSER::m_pluginList
private

Definition at line 654 of file eeschema_settings.cpp.

Referenced by BOM_CFG_PARSER(), and parseGenerator().


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