%module{Slic3r::XS}; %{ #include #include #include "libslic3r/PlaceholderParser.hpp" %} %name{Slic3r::GCode::PlaceholderParser} class PlaceholderParser { PlaceholderParser(); ~PlaceholderParser(); void apply_config(DynamicPrintConfig *config) %code%{ THIS->apply_config(*config); %}; void set(std::string key, int value); std::string process(std::string str) const %code%{ try { RETVAL = THIS->process(str, 0); } catch (std::exception& e) { croak(e.what()); } %}; };