KiCad PCB EDA Suite
PARAM_CFG_FILENAME Class Reference

Configuration parameter - PARAM_CFG_FILENAME Class Same as PARAM_CFG_WXSTRING, but stores "\" as "/". More...

#include <config_params.h>

Inheritance diagram for PARAM_CFG_FILENAME:
PARAM_CFG

Public Member Functions

 PARAM_CFG_FILENAME (const wxString &ident, wxString *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

wxString * 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

Configuration parameter - PARAM_CFG_FILENAME Class Same as PARAM_CFG_WXSTRING, but stores "\" as "/".

and replace "/" by "\" under Windows. Used to store paths and filenames in config files

Definition at line 274 of file config_params.h.

Constructor & Destructor Documentation

◆ PARAM_CFG_FILENAME()

PARAM_CFG_FILENAME::PARAM_CFG_FILENAME ( const wxString &  ident,
wxString *  ptparam,
const wxChar *  group = NULL 
)

Definition at line 437 of file config_params.cpp.

439  :
440  PARAM_CFG( ident, PARAM_FILENAME, group )
441 {
442  m_Pt_param = ptparam;
443 }
wxString * 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_FILENAME::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 446 of file config_params.cpp.

447 {
448  if( !m_Pt_param || !aConfig )
449  return;
450 
451  wxString prm = aConfig->Read( m_Ident );
452  // file names are stored using Unix notation
453  // under Window we must use \ instead of /
454  // mainly if there is a server name in path (something like \\server\kicad)
455 #ifdef __WINDOWS__
456  prm.Replace(wxT("/"), wxT("\\"));
457 #endif
458  *m_Pt_param = prm;
459 }
wxString * m_Pt_param
Pointer to the parameter value.
wxString m_Ident
Keyword in config data.
Definition: config_params.h:88

References PARAM_CFG::m_Ident, and m_Pt_param.

◆ SaveParam()

void PARAM_CFG_FILENAME::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 462 of file config_params.cpp.

463 {
464  if( !m_Pt_param || !aConfig )
465  return;
466 
467  wxString prm = *m_Pt_param;
468  // filenames are stored using Unix notation
469  prm.Replace(wxT("\\"), wxT("/") );
470  aConfig->Write( m_Ident, prm );
471 }
wxString * m_Pt_param
Pointer to the parameter value.
wxString m_Ident
Keyword in config data.
Definition: config_params.h:88

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

wxString* PARAM_CFG_FILENAME::m_Pt_param

Pointer to the parameter value.

Definition at line 277 of file config_params.h.

Referenced by PARAM_CFG_FILENAME(), 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: