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 642 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 737 of file eeschema_settings.cpp.

738  :
739  DIALOG_BOM_CFG_LEXER( aLine, aSource )
740 {
741  wxASSERT( aPluginList );
742  m_pluginList = aPluginList;
743 }
std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > * m_pluginList

References m_pluginList.

Member Function Documentation

◆ Parse()

void BOM_CFG_PARSER::Parse ( )

Definition at line 746 of file eeschema_settings.cpp.

747 {
748  T token;
749 
750  while( ( token = NextTok() ) != T_RIGHT )
751  {
752  if( token == T_EOF)
753  break;
754 
755  if( token == T_LEFT )
756  token = NextTok();
757 
758  if( token == T_plugins )
759  continue;
760 
761  switch( token )
762  {
763  case T_plugin: // Defines a new plugin
764  parseGenerator();
765  break;
766 
767  default:
768 // Unexpected( CurText() );
769  break;
770  }
771  }
772 }

References parseGenerator().

◆ parseGenerator()

void BOM_CFG_PARSER::parseGenerator ( )
private

Definition at line 775 of file eeschema_settings.cpp.

776 {
777  wxString str;
779 
780  NeedSYMBOLorNUMBER();
781  settings.path = FromUTF8();
782 
783  T token;
784 
785  while( ( token = NextTok() ) != T_RIGHT )
786  {
787  if( token == T_EOF)
788  break;
789 
790  switch( token )
791  {
792  case T_LEFT:
793  break;
794 
795  case T_cmd:
796  NeedSYMBOLorNUMBER();
797 
798  settings.command = FromUTF8();
799 
800  NeedRIGHT();
801  break;
802 
803  case T_opts:
804  {
805  NeedSYMBOLorNUMBER();
806 
807  wxString option = FromUTF8();
808 
809  if( option.StartsWith( "nickname=", &str ) )
810  settings.name = str;
811 
812  NeedRIGHT();
813  break;
814  }
815 
816  default:
817  Unexpected( CurText() );
818  break;
819  }
820  }
821 
822  m_pluginList->emplace_back( settings );
823 }
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 644 of file eeschema_settings.cpp.

Referenced by BOM_CFG_PARSER(), and parseGenerator().


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