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=nullptr)
 
virtual void ReadParam (wxConfigBase *aConfig) const override
 Read the value of the parameter stored in aConfig. More...
 
virtual void SaveParam (wxConfigBase *aConfig) const override
 Save 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 271 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 = nullptr 
)

Definition at line 473 of file config_params.cpp.

475  :
477 {
478  m_Pt_param = ptparam;
479 }
PARAM_CFG(const wxString &ident, const paramcfg_id type, const wxChar *group=nullptr, const wxString &legacy_ident=wxEmptyString)
wxArrayString * m_Pt_param
Pointer to the parameter value.

References group, and m_Pt_param.

Member Function Documentation

◆ ReadParam()

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

Read the value of the parameter stored in aConfig.

Parameters
aConfigthe wxConfigBase that holds the parameter.

Reimplemented from PARAM_CFG.

Definition at line 482 of file config_params.cpp.

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

Save the value of the parameter stored in aConfig.

Parameters
aConfigthe wxConfigBase that can store the parameter.

Reimplemented from PARAM_CFG.

Definition at line 512 of file config_params.cpp.

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