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_BASE

Public Member Functions

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

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

Detailed Description

Configuration parameter - Boolean Class.

Definition at line 230 of file config_params.h.

Constructor & Destructor Documentation

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

Definition at line 359 of file config_params.cpp.

References m_Default, and m_Pt_param.

360  :
361  PARAM_CFG_BASE( ident, PARAM_BOOL, group )
362 {
363  m_Pt_param = ptparam;
364  m_Default = default_val ? true : false;
365 }
int m_Default
The default value of the parameter.
bool * m_Pt_param
Pointer to the parameter value.
PARAM_CFG_BASE(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL)
PARAM_CFG_BOOL::PARAM_CFG_BOOL ( bool  Insetup,
const wxString &  ident,
bool *  ptparam,
int  default_val = false,
const wxChar *  group = NULL 
)

Definition at line 368 of file config_params.cpp.

References m_Default, m_Pt_param, and PARAM_CFG_BASE::m_Setup.

372  :
373  PARAM_CFG_BASE( ident, PARAM_BOOL, group )
374 {
375  m_Pt_param = ptparam;
376  m_Default = default_val ? true : false;
377  m_Setup = Insetup;
378 }
int m_Default
The default value of the parameter.
bool m_Setup
Install or Project based parameter, true == install.
bool * m_Pt_param
Pointer to the parameter value.
PARAM_CFG_BASE(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL)

Member Function Documentation

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

Definition at line 381 of file config_params.cpp.

References m_Default, PARAM_CFG_BASE::m_Ident, and m_Pt_param.

382 {
383  if( !m_Pt_param || !aConfig )
384  return;
385 
386  int itmp = aConfig->Read( m_Ident, (int) m_Default );
387 
388  *m_Pt_param = itmp ? true : false;
389 }
int m_Default
The default value of the parameter.
bool * m_Pt_param
Pointer to the parameter value.
wxString m_Ident
Keyword in config data.
Definition: config_params.h:97
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_BASE.

Definition at line 392 of file config_params.cpp.

References PARAM_CFG_BASE::m_Ident, and m_Pt_param.

393 {
394  if( !m_Pt_param || !aConfig )
395  return;
396 
397  aConfig->Write( m_Ident, *m_Pt_param );
398 }
bool * m_Pt_param
Pointer to the parameter value.
wxString m_Ident
Keyword in config data.
Definition: config_params.h:97

Member Data Documentation

int PARAM_CFG_BOOL::m_Default

The default value of the parameter.

Definition at line 234 of file config_params.h.

Referenced by PARAM_CFG_BOOL(), and ReadParam().

wxString PARAM_CFG_BASE::m_Group
inherited

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

Definition at line 99 of file config_params.h.

Referenced by PARAM_CFG_BASE::PARAM_CFG_BASE().

bool* PARAM_CFG_BOOL::m_Pt_param

Pointer to the parameter value.

Definition at line 233 of file config_params.h.

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

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

Type of parameter.

Definition at line 98 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: