Ported the G-code generator from Perl to C++.

Removed GCode.pm
Removed the Perl bindigns for AvoidCrossingPerimeters, OozePrevention, SpiralVase, Wipe
Changed the std::set of extruder IDs to vector of IDs.
Removed some MSVC compiler warnings, removed obnoxious compiler warnings when compiling the Perl bindings.
This commit is contained in:
bubnikv 2017-05-03 18:28:22 +02:00
parent 72ae3585e4
commit e90279c513
52 changed files with 1362 additions and 1632 deletions

View file

@ -97,23 +97,34 @@ PlaceholderParser::apply_env_variables()
}
}
void
PlaceholderParser::set(const std::string &key, const std::string &value)
void PlaceholderParser::set(const std::string &key, const std::string &value)
{
this->_single[key] = value;
this->_multiple.erase(key);
}
void
PlaceholderParser::set(const std::string &key, int value)
void PlaceholderParser::set(const std::string &key, int value)
{
std::ostringstream ss;
ss << value;
this->set(key, ss.str());
}
void
PlaceholderParser::set(const std::string &key, std::vector<std::string> values)
void PlaceholderParser::set(const std::string &key, unsigned int value)
{
std::ostringstream ss;
ss << value;
this->set(key, ss.str());
}
void PlaceholderParser::set(const std::string &key, double value)
{
std::ostringstream ss;
ss << value;
this->set(key, ss.str());
}
void PlaceholderParser::set(const std::string &key, std::vector<std::string> values)
{
if (values.empty()) {
this->_multiple.erase(key);
@ -124,8 +135,7 @@ PlaceholderParser::set(const std::string &key, std::vector<std::string> values)
}
}
std::string
PlaceholderParser::process(std::string str) const
std::string PlaceholderParser::process(std::string str) const
{
// replace single options, like [foo]
for (t_strstr_map::const_iterator it = this->_single.begin(); it != this->_single.end(); ++it) {
@ -154,8 +164,7 @@ PlaceholderParser::process(std::string str) const
return str;
}
bool
PlaceholderParser::find_and_replace(std::string &source, std::string const &find, std::string const &replace) const
bool PlaceholderParser::find_and_replace(std::string &source, std::string const &find, std::string const &replace) const
{
bool found = false;
for (std::string::size_type i = 0; (i = source.find(find, i)) != std::string::npos; ) {