Ported PrintConfigBase::_handle_legacy from Perl to C++,

merged from upstream Slic3r, thanks to @alexrj.
This commit is contained in:
bubnikv 2017-09-18 09:56:48 +02:00
parent cd084a33c6
commit e16f827223
6 changed files with 116 additions and 95 deletions

View file

@ -646,6 +646,7 @@ public:
opt->type = type;
return opt;
}
bool has(const t_config_option_key &opt_key) const { return this->options.count(opt_key) > 0; }
const ConfigOptionDef* get(const t_config_option_key &opt_key) const {
t_optiondef_map::iterator it = const_cast<ConfigDef*>(this)->options.find(opt_key);
return (it == this->options.end()) ? nullptr : &it->second;