mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
Refactored the Config XS bindings
This commit is contained in:
@@ -150,6 +150,16 @@ ConfigBase::setenv_()
|
||||
#endif
|
||||
}
|
||||
|
||||
const ConfigOption*
|
||||
ConfigBase::option(const t_config_option_key &opt_key) const {
|
||||
return const_cast<ConfigBase*>(this)->option(opt_key, false);
|
||||
}
|
||||
|
||||
ConfigOption*
|
||||
ConfigBase::option(const t_config_option_key &opt_key, bool create) {
|
||||
return this->optptr(opt_key, create);
|
||||
}
|
||||
|
||||
DynamicConfig& DynamicConfig::operator= (DynamicConfig other)
|
||||
{
|
||||
this->swap(other);
|
||||
@@ -175,7 +185,7 @@ DynamicConfig::DynamicConfig (const DynamicConfig& other) {
|
||||
}
|
||||
|
||||
ConfigOption*
|
||||
DynamicConfig::option(const t_config_option_key &opt_key, bool create) {
|
||||
DynamicConfig::optptr(const t_config_option_key &opt_key, bool create) {
|
||||
if (this->options.count(opt_key) == 0) {
|
||||
if (create) {
|
||||
const ConfigOptionDef* optdef = this->def->get(opt_key);
|
||||
@@ -231,11 +241,6 @@ template ConfigOptionBool* DynamicConfig::opt<ConfigOptionBool>(const t_config_o
|
||||
template ConfigOptionBools* DynamicConfig::opt<ConfigOptionBools>(const t_config_option_key &opt_key, bool create);
|
||||
template ConfigOptionPercent* DynamicConfig::opt<ConfigOptionPercent>(const t_config_option_key &opt_key, bool create);
|
||||
|
||||
const ConfigOption*
|
||||
DynamicConfig::option(const t_config_option_key &opt_key) const {
|
||||
return const_cast<DynamicConfig*>(this)->option(opt_key, false);
|
||||
}
|
||||
|
||||
t_config_option_keys
|
||||
DynamicConfig::keys() const {
|
||||
t_config_option_keys keys;
|
||||
@@ -273,10 +278,4 @@ StaticConfig::keys() const {
|
||||
return keys;
|
||||
}
|
||||
|
||||
const ConfigOption*
|
||||
StaticConfig::option(const t_config_option_key &opt_key) const
|
||||
{
|
||||
return const_cast<StaticConfig*>(this)->option(opt_key, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user