KiCad PCB EDA Suite
PARAM_CFG_BOOL Class Reference

Configuration parameter - Boolean Class. More...

#include <config_params.h>

Inheritance diagram for PARAM_CFG_BOOL:
PARAM_CFG

Public Member Functions

 PARAM_CFG_BOOL (const wxString &ident, bool *ptparam, int default_val=false, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)
 
 PARAM_CFG_BOOL (bool Insetup, const wxString &ident, bool *ptparam, int default_val=false, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)
 
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

bool * m_Pt_param
 Pointer to the parameter value. More...
 
int m_Default
 The default value of the parameter. 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

Configuration parameter - Boolean Class.

Definition at line 238 of file config_params.h.

Constructor & Destructor Documentation

◆ PARAM_CFG_BOOL() [1/2]

PARAM_CFG_BOOL::PARAM_CFG_BOOL ( const wxString &  ident,
bool *  ptparam,
int  default_val = false,
const wxChar *  group = NULL,
const wxString &  legacy_ident = wxEmptyString 
)

Definition at line 371 of file config_params.cpp.

372  :
373  PARAM_CFG( ident, PARAM_BOOL, group, legacy )
374 {
375  m_Pt_param = ptparam;
376  m_Default = default_val ? true : false;
377 }
int m_Default
The default value of the parameter.
PARAM_CFG(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)
bool * m_Pt_param
Pointer to the parameter value.

References m_Default, and m_Pt_param.

◆ PARAM_CFG_BOOL() [2/2]

PARAM_CFG_BOOL::PARAM_CFG_BOOL ( bool  Insetup,
const wxString &  ident,
bool *  ptparam,
int  default_val = false,
const wxChar *  group = NULL,
const wxString &  legacy_ident = wxEmptyString 
)

Definition at line 380 of file config_params.cpp.

381  :
382  PARAM_CFG( ident, PARAM_BOOL, group, legacy )
383 {
384  m_Pt_param = ptparam;
385  m_Default = default_val ? true : false;
386  m_Setup = Insetup;
387 }
bool m_Setup
Install or Project based parameter, true == install.
int m_Default
The default value of the parameter.
PARAM_CFG(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)
bool * m_Pt_param
Pointer to the parameter value.

References m_Default, m_Pt_param, and PARAM_CFG::m_Setup.

Member Function Documentation

◆ ReadParam()

void PARAM_CFG_BOOL::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 390 of file config_params.cpp.

391 {
392  if( !m_Pt_param || !aConfig )
393  return;
394 
395  int itmp = (int) m_Default;
396 
397  if( !aConfig->Read( m_Ident, &itmp ) && m_Ident_legacy != wxEmptyString )
398  aConfig->Read( m_Ident_legacy, &itmp );
399 
400  *m_Pt_param = itmp ? true : false;
401 }
int m_Default
The default value of the parameter.
wxString m_Ident
Keyword in config data.
wxString m_Ident_legacy
bool * m_Pt_param
Pointer to the parameter value.

References m_Default, PARAM_CFG::m_Ident, PARAM_CFG::m_Ident_legacy, and m_Pt_param.

◆ SaveParam()

void PARAM_CFG_BOOL::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 404 of file config_params.cpp.

405 {
406  if( !m_Pt_param || !aConfig )
407  return;
408 
409  aConfig->Write( m_Ident, *m_Pt_param );
410 }
wxString m_Ident
Keyword in config data.
bool * m_Pt_param
Pointer to the parameter value.

References PARAM_CFG::m_Ident, and m_Pt_param.

Member Data Documentation

◆ m_Default

int PARAM_CFG_BOOL::m_Default

The default value of the parameter.

Definition at line 242 of file config_params.h.

Referenced by PARAM_CFG_BOOL(), and ReadParam().

◆ 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

bool* PARAM_CFG_BOOL::m_Pt_param

Pointer to the parameter value.

Definition at line 241 of file config_params.h.

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

◆ m_Setup

bool PARAM_CFG::m_Setup
inherited

◆ 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: