Fixed a bug in parsering a Point from a config file.
This commit is contained in:
bubnikv 2018-05-17 10:30:20 +02:00
parent cc52654db3
commit e3d84407e0

View file

@ -644,12 +644,9 @@ public:
bool deserialize(const std::string &str, bool append = false) override bool deserialize(const std::string &str, bool append = false) override
{ {
UNUSED(append); UNUSED(append);
std::istringstream iss(str); char dummy;
iss >> this->value.x; return sscanf(str.data(), " %lf , %lf %c", &this->value.x, &this->value.y, &dummy) == 2 ||
iss.ignore(std::numeric_limits<std::streamsize>::max(), ','); sscanf(str.data(), " %lf x %lf %c", &this->value.x, &this->value.y, &dummy) == 2;
iss.ignore(std::numeric_limits<std::streamsize>::max(), 'x');
iss >> this->value.y;
return true;
} }
}; };