33void wxConfigLoadParams( wxConfigBase* aCfg, 
const std::vector<std::unique_ptr<PARAM_CFG>>& aList,
 
   34                         const wxString& aGroup )
 
   38    for( 
const auto& param : aList )
 
   40        if( !!param->m_Group )
 
   41            aCfg->SetPath( param->m_Group );
 
   43            aCfg->SetPath( aGroup );
 
   48        param->ReadParam( aCfg );
 
 
   53void wxConfigLoadSetups( wxConfigBase* aCfg, 
const std::vector<std::unique_ptr<PARAM_CFG>>& aList )
 
   57    for( 
const auto& param : aList )
 
   62        param->ReadParam( aCfg );
 
 
   67void wxConfigSaveParams( wxConfigBase* aCfg, 
const std::vector<std::unique_ptr<PARAM_CFG>>& aList,
 
   68                         const wxString& aGroup )
 
   72    for( 
const auto& param : aList )
 
   74        if( !!param->m_Group )
 
   75            aCfg->SetPath( param->m_Group );
 
   77            aCfg->SetPath( aGroup );
 
   84            if( !!param->m_Ident )
 
   85                aCfg->DeleteGroup( param->m_Ident );
 
   89            param->SaveParam( aCfg );
 
 
   95void wxConfigSaveSetups( wxConfigBase* aCfg, 
const std::vector<std::unique_ptr<PARAM_CFG>>& aList )
 
   99    for( 
const auto& param : aList )
 
  101        if( !param->m_Setup )
 
  106            if( !!param->m_Ident )
 
  107                aCfg->DeleteGroup( param->m_Ident );
 
  111            param->SaveParam( aCfg );
 
 
  123    wxString    tnumber = wxString::Format( wxT( 
"%.16g" ), aValue );
 
  125    aConfig->Write( aKey, tnumber );
 
 
  130                      const wxChar* 
group, 
const wxString& legacy )
 
 
  142                              int min, 
int max, 
const wxChar* 
group, 
const wxString& legacy ) :
 
 
  153                              int min, 
int max, 
const wxChar* 
group, 
const wxString& legacy ) :
 
 
  191                                                    int default_val, 
int min, 
int max,
 
  192                                                    const wxChar* 
group, 
double aBiu2cfgunit,
 
  193                                                    const wxString& legacy_ident ) :
 
 
  202                                                    int default_val, 
int min, 
int max,
 
  203                                                    const wxChar* 
group, 
double aBiu2cfgunit,
 
  204                                                    const wxString& legacy_ident ) :
 
 
  244                                    double default_val, 
double min, 
double max,
 
  245                                    const wxChar* 
group ) :
 
 
  256                                    const wxString& ident,
 
  261                                    const wxChar* 
group ) :
 
 
  278    aConfig->Read( 
m_Ident, &dtmp );
 
 
  301                                const wxChar* 
group, 
const wxString& legacy ) :
 
 
  310                                int default_val, 
const wxChar* 
group, 
const wxString& legacy ) :
 
 
  343                                        const wxChar* 
group ) :
 
 
  351                                        const wxString& default_val, 
const wxChar* 
group ) :
 
 
  379                                                const wxChar* 
group ) :
 
 
  387                                                std::set<wxString>* ptparam, 
const wxChar* 
group ) :
 
 
  400    for( 
int i = 1; 
true; ++i )
 
  406        data = aConfig->Read( key, wxT( 
"" ) );
 
 
  430        aConfig->Write( key, str );
 
 
  437                                        const wxChar* 
group ) :
 
 
  449    wxString prm = aConfig->Read( 
m_Ident );
 
  454    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() )
 
  506        libname.Replace( wxT( 
"/" ), wxT( 
"\\" ) );
 
  508        libname_list->Add( libname );
 
 
  523    for( 
unsigned indexlib = 0;  indexlib < libname_list->GetCount();  indexlib++ )
 
  528        configkey << ( indexlib + 1 );
 
  529        libname = libname_list->Item( indexlib );
 
  532        libname.Replace( wxT( 
"\\" ), wxT( 
"/" ) );
 
  533        aConfig->Write( configkey, libname );
 
 
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
 
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
 
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.
 
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 wxConfigLoadSetups(wxConfigBase *aCfg, const std::vector< std::unique_ptr< PARAM_CFG > > &aList)
Use aList of PARAM_CFG object to load configuration values from aCfg.
 
void wxConfigSaveParams(wxConfigBase *aCfg, const std::vector< std::unique_ptr< PARAM_CFG > > &aList, const wxString &aGroup)
Write aList of PARAM_CFG objects aCfg.
 
void wxConfigSaveSetups(wxConfigBase *aCfg, const std::vector< std::unique_ptr< PARAM_CFG > > &aList)
Writes aList of PARAM_CFG objects to aCfg.
 
void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
A helper function to write doubles in configuration file.
 
void wxConfigLoadParams(wxConfigBase *aCfg, const std::vector< std::unique_ptr< PARAM_CFG > > &aList, const wxString &aGroup)
Use aList of PARAM_CFG objects to load configuration values from aCfg.
 
KICOMMON_API 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.