diff --git a/xs/src/Config.hpp b/xs/src/Config.hpp index a59bcf405..f53682d43 100644 --- a/xs/src/Config.hpp +++ b/xs/src/Config.hpp @@ -266,26 +266,24 @@ class ConfigOptionEnum : public ConfigOption operator T() const { return this->value; }; - std::string serialize(); - void deserialize(std::string str); + std::string serialize() { + typename std::map enum_keys_map = ConfigOptionEnum::get_enum_values(); + for (typename std::map::iterator it = enum_keys_map.begin(); it != enum_keys_map.end(); ++it) { + if (it->second == this->value) return it->first; + } + return ""; + }; + + void deserialize(std::string str) { + typename std::map enum_keys_map = ConfigOptionEnum::get_enum_values(); + assert(enum_keys_map.count(str) > 0); + this->value = enum_keys_map[str]; + }; + static std::map get_enum_values(); }; -template -std::string ConfigOptionEnum::serialize() { - typename std::map enum_keys_map = ConfigOptionEnum::get_enum_values(); - for (typename std::map::iterator it = enum_keys_map.begin(); it != enum_keys_map.end(); ++it) { - if (it->second == this->value) return it->first; - } - return ""; -}; -template -void ConfigOptionEnum::deserialize(std::string str) { - typename std::map enum_keys_map = ConfigOptionEnum::get_enum_values(); - assert(enum_keys_map.count(str) > 0); - this->value = enum_keys_map[str]; -}; enum GCodeFlavor { gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfNoExtrusion,