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 667 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 807 of file eeschema_settings.cpp.

808  :
809  DIALOG_BOM_CFG_LEXER( aLine, aSource )
810 {
811  wxASSERT( aPluginList );
812  m_pluginList = aPluginList;
813 }
std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > * m_pluginList

References m_pluginList.

Member Function Documentation

◆ Parse()

void BOM_CFG_PARSER::Parse ( )

Definition at line 816 of file eeschema_settings.cpp.

817 {
818  T token;
819 
820  while( ( token = NextTok() ) != T_RIGHT )
821  {
822  if( token == T_EOF)
823  break;
824 
825  if( token == T_LEFT )
826  token = NextTok();
827 
828  if( token == T_plugins )
829  continue;
830 
831  switch( token )
832  {
833  case T_plugin: // Defines a new plugin
834  parseGenerator();
835  break;
836 
837  default:
838 // Unexpected( CurText() );
839  break;
840  }
841  }
842 }

References parseGenerator().

Referenced by EESCHEMA_SETTINGS::migrateBomSettings().

◆ parseGenerator()

void BOM_CFG_PARSER::parseGenerator ( )
private

Definition at line 845 of file eeschema_settings.cpp.

846 {
847  wxString str;
849 
850  NeedSYMBOLorNUMBER();
851  settings.path = FromUTF8();
852 
853  T token;
854 
855  while( ( token = NextTok() ) != T_RIGHT )
856  {
857  if( token == T_EOF)
858  break;
859 
860  switch( token )
861  {
862  case T_LEFT:
863  break;
864 
865  case T_cmd:
866  NeedSYMBOLorNUMBER();
867 
868  settings.command = FromUTF8();
869 
870  NeedRIGHT();
871  break;
872 
873  case T_opts:
874  {
875  NeedSYMBOLorNUMBER();
876 
877  wxString option = FromUTF8();
878 
879  if( option.StartsWith( "nickname=", &str ) )
880  settings.name = str;
881 
882  NeedRIGHT();
883  break;
884  }
885 
886  default:
887  Unexpected( CurText() );
888  break;
889  }
890  }
891 
892  m_pluginList->emplace_back( settings );
893 }
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 669 of file eeschema_settings.cpp.

Referenced by BOM_CFG_PARSER(), and parseGenerator().


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