Commit f536d362 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Correction d'une erreur pour Color

parent c02006ff
......@@ -66,7 +66,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
else if (fields[i-1]._name == "Time") {
if(!Date::instantiate(current_value, time)) {
cout << "warning : incompatible value" << endl;
cout << "warning : incompatible value : " << current_value << endl;
return;
}
}
......@@ -82,7 +82,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
else if (fields[i-1]._name == "Value") {
if(fields[i-1]._type == "double") {
if(!Double::instantiate(current_value, value_double)) {
cout << "warning : incompatible value" << endl;
cout << "warning : incompatible value : " << current_value << endl;
return;
}
}
......@@ -113,7 +113,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
else if(fields[i-1]._type == "double") {
Double value;
if(!Double::instantiate(current_value, value)) {
cout << "warning : incompatible value" << endl;
cout << "warning : incompatible value : " << current_value << endl;
return;
}
extra_fields.push_back(&value);
......@@ -121,7 +121,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
else if(fields[i-1]._type == "hex") {
Hex value;
if(!Hex::instantiate(current_value, value)) {
cout << "warning : incompatible value" << endl;
cout << "warning : incompatible value : " << current_value << endl;
return;
}
extra_fields.push_back(&value);
......@@ -129,7 +129,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
else if(fields[i-1]._type == "date") {
Date value;
if(!Date::instantiate(current_value, value)) {
cout << "warning : incompatible value" << endl;
cout << "warning : incompatible value : " << current_value << endl;
return;
}
extra_fields.push_back(&value);
......@@ -137,7 +137,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
else if(fields[i-1]._type == "int") {
Integer value;
if(!Integer::instantiate(current_value, value)) {
cout << "warning : incompatible value" << endl;
cout << "warning : incompatible value : " << current_value << endl;
return;
}
extra_fields.push_back(&value);
......@@ -145,7 +145,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
else if(fields[i-1]._type == "color") {
Color value;
if(!Color::instantiate(current_value, value)) {
cout << "warning : incompatible value" << endl;
cout << "warning : incompatible value : " << current_value << endl;
return;
}
extra_fields.push_back(&value);
......
......@@ -15,8 +15,9 @@ Color::Color(double r, double g, double b) {
bool Color::instantiate(const std::string &in, Color &out) {
double r, g, b;
if(sscanf(in.c_str(), "%lf %lf %lf", &r, &g, &b) != 3)
if(sscanf(in.c_str(), "%lf %lf %lf", &r, &g, &b) != 1){
return false;
}
out = Color(r, g, b);
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment