KiCad PCB EDA Suite
PARAM_CFG_LIBNAME_LIST Class Reference

#include <config_params.h>

Inheritance diagram for PARAM_CFG_LIBNAME_LIST:
PARAM_CFG_BASE

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 298 of file config_params.h.

Constructor & Destructor Documentation

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

Definition at line 493 of file config_params.cpp.

References m_Pt_param.

495  :
496  PARAM_CFG_BASE( ident, PARAM_LIBNAME_LIST, group )
497 {
498  m_Pt_param = ptparam;
499 }
PARAM_CFG_BASE(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)
wxArrayString * m_Pt_param
Pointer to the parameter value.

Member Function Documentation

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_BASE.

Definition at line 502 of file config_params.cpp.

References PARAM_CFG_BASE::m_Ident, and m_Pt_param.

503 {
504  if( !m_Pt_param || !aConfig )
505  return;
506 
507  int indexlib = 1; // We start indexlib to 1 because first
508  // lib name is LibName1
509  wxString libname, id_lib;
510  wxArrayString* libname_list = m_Pt_param;
511 
512  while( 1 )
513  {
514  id_lib = m_Ident;
515  id_lib << indexlib;
516  indexlib++;
517  libname = aConfig->Read( id_lib, wxT( "" ) );
518 
519  if( libname.IsEmpty() )
520  break;
521  // file names are stored using Unix notation
522  // under Window we must use \ instead of /
523  // mainly if there is a server name in path (something like \\server\kicad)
524 #ifdef __WINDOWS__
525  libname.Replace(wxT("/"), wxT("\\"));
526 #endif
527  libname_list->Add( libname );
528  }
529 }
wxArrayString * m_Pt_param
Pointer to the parameter value.
wxString m_Ident
Keyword in config data.
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_BASE.

Definition at line 532 of file config_params.cpp.

References PARAM_CFG_BASE::m_Ident, and m_Pt_param.

533 {
534  if( !m_Pt_param || !aConfig )
535  return;
536 
537  wxArrayString* libname_list = m_Pt_param;
538 
539  wxString configkey;
540  wxString libname;
541 
542  for( unsigned indexlib = 0; indexlib < libname_list->GetCount(); indexlib++ )
543  {
544  configkey = m_Ident;
545 
546  // We use indexlib+1 because first lib name is LibName1
547  configkey << (indexlib + 1);
548  libname = libname_list->Item( indexlib );
549 
550  // filenames are stored using Unix notation
551  libname.Replace(wxT("\\"), wxT("/") );
552  aConfig->Write( configkey, libname );
553  }
554 }
wxArrayString * m_Pt_param
Pointer to the parameter value.
wxString m_Ident
Keyword in config data.

Member Data Documentation

wxString PARAM_CFG_BASE::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_BASE::PARAM_CFG_BASE().

wxString PARAM_CFG_BASE::m_Ident_legacy
inherited
wxArrayString* PARAM_CFG_LIBNAME_LIST::m_Pt_param

Pointer to the parameter value.

Definition at line 301 of file config_params.h.

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

bool PARAM_CFG_BASE::m_Setup
inherited
paramcfg_id PARAM_CFG_BASE::m_Type
inherited

Type of parameter.

Definition at line 103 of file config_params.h.

Referenced by PARAM_CFG_BASE::PARAM_CFG_BASE(), and PARAM_CFG_INT_WITH_SCALE::PARAM_CFG_INT_WITH_SCALE().


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