mirror of
https://github.com/scummvm/scummvm.git
synced 2026-11-18 21:34:48 +00:00
XMLParser:
- Cleanup. - Support for file/buffer loading. ThemeParser: - Triangle orientation. svn-id: r32784
This commit is contained in:
1 parent
f0e63a49e3
commit
2fcbb97005
3 files changed
+73
-58
No files matched your search
+7
-10
@@ -42,16 +42,14 @@ void XMLParser::debug_testEval() {
|
||||
"</ drawdata>/* lol this is just a simple test*/\n"
|
||||
"I loled";
|
||||
|
||||
_text.fillFromMem(strdup(debugConfigText));
|
||||
loadBuffer(debugConfigText);
|
||||
_fileName = strdup("test_parse.xml");
|
||||
|
||||
Common::String test = "12, 125, 125";
|
||||
|
||||
parse();
|
||||
}
|
||||
|
||||
|
||||
void XMLParser::parserError(const char *errorString, ...) {
|
||||
bool XMLParser::parserError(const char *errorString, ...) {
|
||||
_state = kParserError;
|
||||
|
||||
int pos = _pos;
|
||||
@@ -90,6 +88,8 @@ void XMLParser::parserError(const char *errorString, ...) {
|
||||
va_end(args);
|
||||
|
||||
printf("\n");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool XMLParser::parseActiveKey(bool closed) {
|
||||
@@ -248,14 +248,11 @@ bool XMLParser::parse() {
|
||||
}
|
||||
}
|
||||
|
||||
if (_state == kParserError) {
|
||||
if (_state == kParserError)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_state != kParserNeedKey || !_activeKey.empty()) {
|
||||
parserError("Unexpected end of file.");
|
||||
return false;
|
||||
}
|
||||
if (_state != kParserNeedKey || !_activeKey.empty())
|
||||
return parserError("Unexpected end of file.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user