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 287 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 474 of file config_params.cpp.

476  :
477  PARAM_CFG( ident, PARAM_LIBNAME_LIST, group )
478 {
479  m_Pt_param = ptparam;
480 }
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 483 of file config_params.cpp.

484 {
485  if( !m_Pt_param || !aConfig )
486  return;
487 
488  int indexlib = 1; // We start indexlib to 1 because first
489  // lib name is LibName1
490  wxString libname, id_lib;
491  wxArrayString* libname_list = m_Pt_param;
492 
493  while( 1 )
494  {
495  id_lib = m_Ident;
496  id_lib << indexlib;
497  indexlib++;
498  libname = aConfig->Read( id_lib, wxT( "" ) );
499 
500  if( libname.IsEmpty() )
501  break;
502  // file names are stored using Unix notation
503  // under Window we must use \ instead of /
504  // mainly if there is a server name in path (something like \\server\kicad)
505 #ifdef __WINDOWS__
506  libname.Replace(wxT("/"), wxT("\\"));
507 #endif
508  libname_list->Add( libname );
509  }
510 }
wxString m_Ident
Keyword in config data.
Definition: config_params.h:88
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 513 of file config_params.cpp.

514 {
515  if( !m_Pt_param || !aConfig )
516  return;
517 
518  wxArrayString* libname_list = m_Pt_param;
519 
520  wxString configkey;
521  wxString libname;
522 
523  for( unsigned indexlib = 0; indexlib < libname_list->GetCount(); indexlib++ )
524  {
525  configkey = m_Ident;
526 
527  // We use indexlib+1 because first lib name is LibName1
528  configkey << (indexlib + 1);
529  libname = libname_list->Item( indexlib );
530 
531  // filenames are stored using Unix notation
532  libname.Replace(wxT("\\"), wxT("/") );
533  aConfig->Write( configkey, libname );
534  }
535 }
wxString m_Ident
Keyword in config data.
Definition: config_params.h:88
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 90 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 290 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 89 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: