Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PlaceholderParser.xsp « xsp « xs - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 244f89cf88ff22289f3c6d67e9beb9858ab196de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
%module{Slic3r::XS};

%{
#include <xsinit.h>
#include <vector>
#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());
            }
        %};

    bool evaluate_boolean_expression(const char *str) const
        %code%{
            try {
                RETVAL = THIS->evaluate_boolean_expression(str, THIS->config());
            } catch (std::exception& e) {
                croak(e.what());
            }
        %};        
};