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 780 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 920 of file eeschema_settings.cpp.

921 :
922 DIALOG_BOM_CFG_LEXER( aLine, aSource )
923{
924 wxASSERT( aPluginList );
925 m_pluginList = aPluginList;
926}
std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > * m_pluginList

References m_pluginList.

Member Function Documentation

◆ Parse()

void BOM_CFG_PARSER::Parse ( )

Definition at line 929 of file eeschema_settings.cpp.

930{
931 T token;
932
933 while( ( token = NextTok() ) != T_RIGHT )
934 {
935 if( token == T_EOF)
936 break;
937
938 if( token == T_LEFT )
939 token = NextTok();
940
941 if( token == T_plugins )
942 continue;
943
944 switch( token )
945 {
946 case T_plugin: // Defines a new plugin
948 break;
949
950 default:
951// Unexpected( CurText() );
952 break;
953 }
954 }
955}

References parseGenerator().

Referenced by EESCHEMA_SETTINGS::migrateBomSettings().

◆ parseGenerator()

void BOM_CFG_PARSER::parseGenerator ( )
private

Definition at line 958 of file eeschema_settings.cpp.

959{
960 wxString str;
962
963 NeedSYMBOLorNUMBER();
964 settings.path = FromUTF8();
965
966 T token;
967
968 while( ( token = NextTok() ) != T_RIGHT )
969 {
970 if( token == T_EOF)
971 break;
972
973 switch( token )
974 {
975 case T_LEFT:
976 break;
977
978 case T_cmd:
979 NeedSYMBOLorNUMBER();
980
981 settings.command = FromUTF8();
982
983 NeedRIGHT();
984 break;
985
986 case T_opts:
987 {
988 NeedSYMBOLorNUMBER();
989
990 wxString option = FromUTF8();
991
992 if( option.StartsWith( wxS( "nickname=" ), &str ) )
993 settings.name = str;
994
995 NeedRIGHT();
996 break;
997 }
998
999 default:
1000 Unexpected( CurText() );
1001 break;
1002 }
1003 }
1004
1005 m_pluginList->emplace_back( settings );
1006}

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

Referenced by BOM_CFG_PARSER(), and parseGenerator().


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