Core: add method to XMLReader to access next element of an XML file
If the next element could be read-in successfully true is returned, and false otherwise.
This commit is contained in:
@@ -222,10 +222,38 @@ void Base::XMLReader::readElement(const char* ElementName)
|
||||
(ElementName && LocalName != ElementName));
|
||||
}
|
||||
|
||||
bool Base::XMLReader::readNextElement()
|
||||
{
|
||||
bool ok{};
|
||||
while (true) {
|
||||
ok = read();
|
||||
if (!ok)
|
||||
break;
|
||||
if (ReadType == StartEndElement)
|
||||
break;
|
||||
if (ReadType == EndElement)
|
||||
break;
|
||||
if (ReadType == EndDocument)
|
||||
break;
|
||||
};
|
||||
|
||||
return (ReadType == StartEndElement);
|
||||
}
|
||||
|
||||
int Base::XMLReader::level() const {
|
||||
return Level;
|
||||
}
|
||||
|
||||
bool Base::XMLReader::isEndOfElement() const
|
||||
{
|
||||
return (ReadType == EndElement);
|
||||
}
|
||||
|
||||
bool Base::XMLReader::isEndOfDocument() const
|
||||
{
|
||||
return (ReadType == EndDocument);
|
||||
}
|
||||
|
||||
void Base::XMLReader::readEndElement(const char* ElementName, int level)
|
||||
{
|
||||
// if we are already at the end of the current element
|
||||
|
||||
Reference in New Issue
Block a user