mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
closedKeyCallback on XMLParser (as asked by Kenny)
svn-id: r32909
This commit is contained in:
parent
96f2d9ca18
commit
40bf717d3b
@ -194,6 +194,11 @@ bool XMLParser::parse() {
|
||||
|
||||
case kParserNeedPropertyName:
|
||||
if (activeClosure) {
|
||||
if (!closedKeyCallback(_activeKey.top()->name)) {
|
||||
parserError("Missing data when closing key '%s'.", _activeKey.top()->name.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
activeClosure = false;
|
||||
delete _activeKey.pop();
|
||||
|
||||
|
@ -203,6 +203,20 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The closed key callback function must be overloaded by inheriting classes to
|
||||
* implement parser-specific functions.
|
||||
*
|
||||
* The closedKeyCallback is issued once a key has been finished parsing, to let
|
||||
* the parser verify that all the required subkeys, etc, were included.
|
||||
*
|
||||
* Returns true if the key was properly closed, false otherwise.
|
||||
* By default, all keys are properly closed.
|
||||
*/
|
||||
virtual bool closedKeyCallback(Common::String keyName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the value of a given key. There's no reason to overload this.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user