EnumReader now warns about the correct string,

parse_enum function throws if the string can not be parsed

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1341 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2009-01-11 00:45:21 +00:00
parent 8c1cf2a0a6
commit c8dd777bca
5 changed files with 24 additions and 15 deletions
+14
View File
@@ -411,3 +411,17 @@ template <> void Reader::handle(FileName& f) {
handle(static_cast<String&>(f));
}
}
// ----------------------------------------------------------------------------- : EnumReader
void EnumReader::warnIfNotDone(Reader* errors_to) {
if (!done) {
// warning: unknown value
errors_to->warning(_ERROR_1_("unrecognized value", read));
}
}
void EnumReader::errorIfNotDone() {
if (!done) {
throw ParseError(_ERROR_1_("unrecognized value", read));
}
}