Remove boost references from Config.hpp (this does not work on Windows!)

This commit is contained in:
Joseph Lenox 2017-03-18 11:44:06 -05:00
parent c773d407fd
commit 35be0eefef
3 changed files with 26 additions and 24 deletions

View File

@ -10,6 +10,7 @@
#include <boost/algorithm/string/erase.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ini_parser.hpp>
@ -682,4 +683,27 @@ ConfigOptionPoint3::deserialize(std::string str, bool append) {
return true;
};
bool
ConfigOptionPoints::deserialize(std::string str, bool append) {
if (!append) this->values.clear();
std::vector<std::string> tokens;
boost::split(tokens, str, boost::is_any_of("x,"));
if (tokens.size() % 2) return false;
try {
for (size_t i = 0; i < tokens.size(); ++i) {
Pointf point;
point.x = boost::lexical_cast<coordf_t>(tokens[i]);
point.y = boost::lexical_cast<coordf_t>(tokens[++i]);
this->values.push_back(point);
}
} catch (boost::bad_lexical_cast &e) {
printf("%s\n", e.what());
return false;
}
return true;
}
}

View File

@ -12,9 +12,6 @@
#include <vector>
#include "libslic3r.h"
#include "Point.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/lexical_cast.hpp>
namespace Slic3r {
@ -394,27 +391,7 @@ class ConfigOptionPoints : public ConfigOptionVector<Pointf>
return vv;
};
bool deserialize(std::string str, bool append = false) {
if (!append) this->values.clear();
std::vector<std::string> tokens;
boost::split(tokens, str, boost::is_any_of("x,"));
if (tokens.size() % 2) return false;
try {
for (size_t i = 0; i < tokens.size(); ++i) {
Pointf point;
point.x = boost::lexical_cast<coordf_t>(tokens[i]);
point.y = boost::lexical_cast<coordf_t>(tokens[++i]);
this->values.push_back(point);
}
} catch (boost::bad_lexical_cast &e) {
printf("%s\n", e.what());
return false;
}
return true;
};
bool deserialize(std::string str, bool append = false);
};
class ConfigOptionBool : public ConfigOptionSingle<bool>

View File

@ -1,5 +1,6 @@
#include "PrintConfig.hpp"
#include <boost/algorithm/string/replace.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/thread.hpp>
namespace Slic3r {