closedKeyCallback on XMLParser (as asked by Kenny)
svn-id: r32909
This commit is contained in:
parent
96f2d9ca18
commit
40bf717d3b
2 changed files with 19 additions and 0 deletions
|
@ -194,6 +194,11 @@ bool XMLParser::parse() {
|
||||||
|
|
||||||
case kParserNeedPropertyName:
|
case kParserNeedPropertyName:
|
||||||
if (activeClosure) {
|
if (activeClosure) {
|
||||||
|
if (!closedKeyCallback(_activeKey.top()->name)) {
|
||||||
|
parserError("Missing data when closing key '%s'.", _activeKey.top()->name.c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
activeClosure = false;
|
activeClosure = false;
|
||||||
delete _activeKey.pop();
|
delete _activeKey.pop();
|
||||||
|
|
||||||
|
|
|
@ -203,6 +203,20 @@ protected:
|
||||||
return false;
|
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.
|
* Parses the value of a given key. There's no reason to overload this.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue