PrusaSlicer/src/libslic3r/GCode/FindReplace.hpp
Vojtech Bubnik d4fd95bd4a WIP: G-code find & replace: Support for non-regular expression,
whole word and case insensitive search.
2022-01-17 12:29:46 +01:00

32 lines
677 B
C++

#ifndef slic3r_FindReplace_hpp_
#define slic3r_FindReplace_hpp_
#include "../PrintConfig.hpp"
#include <boost/regex.hpp>
namespace Slic3r {
class GCodeFindReplace {
public:
GCodeFindReplace(const PrintConfig &print_config);
std::string process_layer(const std::string &gcode);
private:
struct Substitution {
std::string plain_pattern;
boost::regex regexp_pattern;
std::string format;
bool regexp { false };
bool case_insensitive { false };
bool whole_word { false };
};
std::vector<Substitution> m_substitutions;
};
}
#endif // slic3r_FindReplace_hpp_