mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
COMMON: Add ability to handle unknown xml keys
This commit is contained in:
parent
f7785f463a
commit
cd09481f6e
@ -190,7 +190,9 @@ bool XMLParser::parseActiveKey(bool closed) {
|
||||
}
|
||||
|
||||
} else {
|
||||
return parserError("Unexpected key in the active scope ('" + key->name + "').");
|
||||
if (!handleUnknownKey(key))
|
||||
return parserError("Unexpected key in the active scope ('" + key->name + "').");
|
||||
ignore = true;
|
||||
}
|
||||
|
||||
// check if any of the parents must be ignored.
|
||||
|
@ -362,6 +362,15 @@ protected:
|
||||
*/
|
||||
virtual void cleanup() {}
|
||||
|
||||
/**
|
||||
* Overload if your parser wants to be notified of keys which haven't
|
||||
* been explicitly declared.
|
||||
*
|
||||
* The functions should return true if the key was handled and parsing should
|
||||
* continue, or false (default) to raise a parsing error.
|
||||
*/
|
||||
virtual bool handleUnknownKey(ParserNode *node) { return false; }
|
||||
|
||||
List<XMLKeyLayout *> _layoutList;
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user