KiCad PCB EDA Suite
PARAM_CFG_LIBNAME_LIST Class Reference

#include <config_params.h>

Inheritance diagram for PARAM_CFG_LIBNAME_LIST:
PARAM_CFG

Public Member Functions

 PARAM_CFG_LIBNAME_LIST (const wxChar *ident, wxArrayString *ptparam, const wxChar *group=NULL)
 
virtual void ReadParam (wxConfigBase *aConfig) const override
 Function ReadParam reads the value of the parameter stored in aConfig. More...
 
virtual void SaveParam (wxConfigBase *aConfig) const override
 Function SaveParam saves the value of the parameter stored in aConfig. More...
 

Public Attributes

wxArrayString * m_Pt_param
 Pointer to the parameter value. More...
 
wxString m_Ident
 Keyword in config data. More...
 
paramcfg_id m_Type
 Type of parameter. More...
 
wxString m_Group
 Group name (this is like a path in the config data) More...
 
bool m_Setup
 Install or Project based parameter, true == install. More...
 
wxString m_Ident_legacy
 

Detailed Description

Definition at line 322 of file config_params.h.

Constructor & Destructor Documentation

◆ PARAM_CFG_LIBNAME_LIST()

PARAM_CFG_LIBNAME_LIST::PARAM_CFG_LIBNAME_LIST ( const wxChar *  ident,
wxArrayString *  ptparam,
const wxChar *  group = NULL 
)

Definition at line 542 of file config_params.cpp.

544  :
545  PARAM_CFG( ident, PARAM_LIBNAME_LIST, group )
546 {
547  m_Pt_param = ptparam;
548 }
wxArrayString * m_Pt_param
Pointer to the parameter value.
PARAM_CFG(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)

References m_Pt_param.

Member Function Documentation

◆ ReadParam()

void PARAM_CFG_LIBNAME_LIST::ReadParam ( wxConfigBase *  aConfig) const
overridevirtual

Function ReadParam reads the value of the parameter stored in aConfig.

Parameters
aConfig= the wxConfigBase that holds the parameter

Reimplemented from PARAM_CFG.

Definition at line 551 of file config_params.cpp.

552 {
553  if( !m_Pt_param || !aConfig )
554  return;
555 
556  int indexlib = 1; // We start indexlib to 1 because first
557  // lib name is LibName1
558  wxString libname, id_lib;
559  wxArrayString* libname_list = m_Pt_param;
560 
561  while( 1 )
562  {
563  id_lib = m_Ident;
564  id_lib << indexlib;
565  indexlib++;
566  libname = aConfig->Read( id_lib, wxT( "" ) );
567 
568  if( libname.IsEmpty() )
569  break;
570  // file names are stored using Unix notation
571  // under Window we must use \ instead of /
572  // mainly if there is a server name in path (something like \\server\kicad)
573 #ifdef __WINDOWS__
574  libname.Replace(wxT("/"), wxT("\\"));
575 #endif
576  libname_list->Add( libname );
577  }
578 }
wxString m_Ident
Keyword in config data.
wxArrayString * m_Pt_param
Pointer to the parameter value.

References PARAM_CFG::m_Ident, and m_Pt_param.

◆ SaveParam()

void PARAM_CFG_LIBNAME_LIST::SaveParam ( wxConfigBase *  aConfig) const
overridevirtual

Function SaveParam saves the value of the parameter stored in aConfig.

Parameters
aConfig= the wxConfigBase that can store the parameter

Reimplemented from PARAM_CFG.

Definition at line 581 of file config_params.cpp.

582 {
583  if( !m_Pt_param || !aConfig )
584  return;
585 
586  wxArrayString* libname_list = m_Pt_param;
587 
588  wxString configkey;
589  wxString libname;
590 
591  for( unsigned indexlib = 0; indexlib < libname_list->GetCount(); indexlib++ )
592  {
593  configkey = m_Ident;
594 
595  // We use indexlib+1 because first lib name is LibName1
596  configkey << (indexlib + 1);
597  libname = libname_list->Item( indexlib );
598 
599  // filenames are stored using Unix notation
600  libname.Replace(wxT("\\"), wxT("/") );
601  aConfig->Write( configkey, libname );
602  }
603 }
wxString m_Ident
Keyword in config data.
wxArrayString * m_Pt_param
Pointer to the parameter value.

References PARAM_CFG::m_Ident, and m_Pt_param.

Member Data Documentation

◆ m_Group

wxString PARAM_CFG::m_Group
inherited

Group name (this is like a path in the config data)

Definition at line 104 of file config_params.h.

Referenced by PARAM_CFG::PARAM_CFG().

◆ m_Ident

◆ m_Ident_legacy

wxString PARAM_CFG::m_Ident_legacy
inherited

◆ m_Pt_param

wxArrayString* PARAM_CFG_LIBNAME_LIST::m_Pt_param

Pointer to the parameter value.

Definition at line 325 of file config_params.h.

Referenced by PARAM_CFG_LIBNAME_LIST(), ReadParam(), and SaveParam().

◆ m_Setup

◆ m_Type

paramcfg_id PARAM_CFG::m_Type
inherited

Type of parameter.

Definition at line 103 of file config_params.h.

Referenced by dumpParamCfg(), PARAM_CFG::PARAM_CFG(), and PARAM_CFG_INT_WITH_SCALE::PARAM_CFG_INT_WITH_SCALE().


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