2014-05-06 08:07:18 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2014-05-06 08:07:18 +00:00
|
|
|
#include <vector>
|
2014-08-03 17:42:29 +00:00
|
|
|
#include "libslic3r/PlaceholderParser.hpp"
|
2014-05-06 08:07:18 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::GCode::PlaceholderParser} class PlaceholderParser {
|
2015-07-01 15:56:38 +00:00
|
|
|
PlaceholderParser();
|
2014-05-06 08:07:18 +00:00
|
|
|
~PlaceholderParser();
|
2014-11-09 19:41:27 +00:00
|
|
|
|
2014-06-13 13:32:11 +00:00
|
|
|
void apply_config(DynamicPrintConfig *config)
|
2014-11-09 19:41:27 +00:00
|
|
|
%code%{ THIS->apply_config(*config); %};
|
2017-11-17 10:15:46 +00:00
|
|
|
void set(std::string key, int value);
|
2017-07-31 13:42:55 +00:00
|
|
|
std::string process(std::string str) const
|
2017-12-05 14:54:24 +00:00
|
|
|
%code%{
|
|
|
|
try {
|
|
|
|
RETVAL = THIS->process(str, 0);
|
|
|
|
} catch (std::exception& e) {
|
2018-03-21 07:38:33 +00:00
|
|
|
croak("%s\n", e.what());
|
2017-12-05 14:54:24 +00:00
|
|
|
}
|
|
|
|
%};
|
2017-12-18 11:14:09 +00:00
|
|
|
|
|
|
|
bool evaluate_boolean_expression(const char *str) const
|
|
|
|
%code%{
|
|
|
|
try {
|
|
|
|
RETVAL = THIS->evaluate_boolean_expression(str, THIS->config());
|
|
|
|
} catch (std::exception& e) {
|
2018-03-21 07:38:33 +00:00
|
|
|
croak("%s\n", e.what());
|
2017-12-18 11:14:09 +00:00
|
|
|
}
|
|
|
|
%};
|
2014-05-06 08:07:18 +00:00
|
|
|
};
|