35 const wxString& aGroup )
41 if( !!param->m_Group )
42 aCfg->SetPath( param->m_Group );
44 aCfg->SetPath( aGroup );
49 param->ReadParam( aCfg );
63 param->ReadParam( aCfg );
69 const wxString& aGroup )
75 if( !!param->m_Group )
76 aCfg->SetPath( param->m_Group );
78 aCfg->SetPath( aGroup );
85 if( !!param->m_Ident )
86 aCfg->DeleteGroup( param->m_Ident );
90 param->SaveParam( aCfg );
102 if( !param->m_Setup )
107 if( !!param->m_Ident )
108 aCfg->DeleteGroup( param->m_Ident );
112 param->SaveParam( aCfg );
126 aConfig->Write( aKey, tnumber );
131 const wxChar* group,
const wxString& legacy )
143 int min,
int max,
const wxChar* group,
const wxString& legacy ) :
154 int min,
int max,
const wxChar* group,
const wxString& legacy ) :
192 int default_val,
int min,
int max,
193 const wxChar* group,
double aBiu2cfgunit,
194 const wxString& legacy_ident ) :
203 int default_val,
int min,
int max,
204 const wxChar* group,
double aBiu2cfgunit,
205 const wxString& legacy_ident ) :
245 double default_val,
double min,
double max,
246 const wxChar* group ) :
257 const wxString& ident,
262 const wxChar* group ) :
279 aConfig->Read(
m_Ident, &dtmp );
302 const wxChar* group,
const wxString& legacy ) :
311 int default_val,
const wxChar* group,
const wxString& legacy ) :
344 const wxChar* group ) :
352 const wxString& default_val,
const wxChar* group ) :
380 const wxChar* group ) :
388 std::set<wxString>* ptparam,
const wxChar* group ) :
401 for(
int i = 1;
true; ++i )
407 data = aConfig->Read( key, wxT(
"" ) );
431 aConfig->Write( key, str );
438 const wxChar* group ) :
450 wxString prm = aConfig->Read(
m_Ident );
455 prm.Replace(wxT(
"/"), wxT(
"\\"));
468 prm.Replace(wxT(
"\\"), wxT(
"/") );
469 aConfig->Write(
m_Ident, prm );
474 wxArrayString* ptparam,
475 const wxChar* group ) :
489 wxString libname, id_lib;
497 libname = aConfig->Read( id_lib, wxT(
"" ) );
499 if( libname.IsEmpty() )
505 libname.Replace(wxT(
"/"), wxT(
"\\"));
507 libname_list->Add( libname );
522 for(
unsigned indexlib = 0; indexlib < libname_list->GetCount(); indexlib++ )
527 configkey << (indexlib + 1);
528 libname = libname_list->Item( indexlib );
531 libname.Replace(wxT(
"\\"), wxT(
"/") );
532 aConfig->Write( configkey, libname );
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
bool * m_Pt_param
Pointer to the parameter value.
PARAM_CFG_BOOL(const wxString &ident, bool *ptparam, int default_val=false, const wxChar *group=nullptr, const wxString &legacy_ident=wxEmptyString)
int m_Default
The default value of the parameter.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
double m_Max
Minimum and maximum values of the param type.
PARAM_CFG_DOUBLE(const wxString &ident, double *ptparam, double default_val=0.0, double min=0.0, double max=10000.0, const wxChar *group=nullptr)
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
double * m_Pt_param
Pointer to the parameter value.
double m_Default
The default value of the parameter.
wxString * m_Pt_param
Pointer to the parameter value.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
PARAM_CFG_FILENAME(const wxString &ident, wxString *ptparam, const wxChar *group=nullptr)
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
PARAM_CFG_INT_WITH_SCALE(const wxString &ident, int *ptparam, int default_val=0, int min=std::numeric_limits< int >::min(), int max=std::numeric_limits< int >::max(), const wxChar *group=nullptr, double aBiu2cfgunit=1.0, const wxString &legacy_ident=wxEmptyString)
double m_BIU_to_cfgunit
the factor to convert the saved value in internal value
Configuration object for integers.
int m_Max
Minimum and maximum values of the param type.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
PARAM_CFG_INT(const wxString &ident, int *ptparam, int default_val=0, int min=std::numeric_limits< int >::min(), int max=std::numeric_limits< int >::max(), const wxChar *group=nullptr, const wxString &legacy_ident=wxEmptyString)
int m_Default
The default value of the parameter.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
int * m_Pt_param
Pointer to the parameter value.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
wxArrayString * m_Pt_param
Pointer to the parameter value.
PARAM_CFG_LIBNAME_LIST(const wxChar *ident, wxArrayString *ptparam, const wxChar *group=nullptr)
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
std::set< wxString > * m_Pt_param
Pointer to the parameter value.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
PARAM_CFG_WXSTRING_SET(const wxString &ident, std::set< wxString > *ptparam, const wxChar *group=nullptr)
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
wxString * m_Pt_param
Pointer to the parameter value.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
PARAM_CFG_WXSTRING(const wxString &ident, wxString *ptparam, const wxChar *group=nullptr)
wxString m_default
The default value of the parameter.
A base class which establishes the interface functions ReadParam and SaveParam, which are implemented...
paramcfg_id m_Type
Type of parameter.
wxString m_Ident
Keyword in config data.
wxString m_Group
Group name (this is like a path in the config data)
PARAM_CFG(const wxString &ident, const paramcfg_id type, const wxChar *group=nullptr, const wxString &legacy_ident=wxEmptyString)
bool m_Setup
Install or Project based parameter, true == install.
void wxConfigSaveSetups(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
Writes aList of PARAM_CFG objects to aCfg.
void wxConfigSaveParams(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList, const wxString &aGroup)
Write aList of PARAM_CFG objects aCfg.
void wxConfigLoadParams(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList, const wxString &aGroup)
Use aList of PARAM_CFG objects to load configuration values from aCfg.
void wxConfigLoadSetups(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
Use aList of PARAM_CFG object to load configuration values from aCfg.
void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
A helper function to write doubles in configuration file.
paramcfg_id
Type of parameter in the configuration file.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".