ValueTokenizer will throw a "Not enough tokens" exception, if trying to get the next value without one present

This commit is contained in:
Axel Kohlmeyer
2021-03-14 10:44:27 -04:00
parent 11386097c6
commit 14abdade03

View File

@ -200,7 +200,7 @@ std::string ValueTokenizer::next_string() {
if (has_next()) {
std::string value = tokens.next();
return value;
}
} throw TokenizerException("Not enough tokens","");
return "";
}
@ -216,7 +216,7 @@ int ValueTokenizer::next_int() {
}
int value = atoi(current.c_str());
return value;
}
} throw TokenizerException("Not enough tokens","");
return 0;
}
@ -232,7 +232,7 @@ bigint ValueTokenizer::next_bigint() {
}
bigint value = ATOBIGINT(current.c_str());
return value;
}
} throw TokenizerException("Not enough tokens","");
return 0;
}
@ -248,7 +248,7 @@ tagint ValueTokenizer::next_tagint() {
}
tagint value = ATOTAGINT(current.c_str());
return value;
}
} throw TokenizerException("Not enough tokens","");
return 0;
}
@ -264,7 +264,7 @@ double ValueTokenizer::next_double() {
}
double value = atof(current.c_str());
return value;
}
} throw TokenizerException("Not enough tokens","");
return 0.0;
}