More robust vendor profile parsing.

This commit is contained in:
bubnikv 2020-03-11 18:12:16 +01:00
parent a4a6ef3c72
commit cd381d6b4f
3 changed files with 13 additions and 1 deletions

View file

@ -5,6 +5,8 @@
#include <map>
#include <string>
#include <boost/algorithm/string/trim_all.hpp>
#include "libslic3r/Config.hpp"
#include "libslic3r/Semver.hpp"
@ -52,7 +54,13 @@ public:
std::string get(const std::string &key) const
{ std::string value; this->get("", key, value); return value; }
void set(const std::string &section, const std::string &key, const std::string &value)
{
{
#ifndef _NDEBUG
std::string key_trimmed = key;
boost::trim_all(key_trimmed);
assert(key_trimmed == key);
assert(! key_trimmed.empty());
#endif _NDEBUG
std::string &old = m_storage[section][key];
if (old != value) {
old = value;