I would like to be able to track how much data the irrlicht xml reader has processed. I tried passing IReadFile to create an XMLReader, but XMLReader seems to load IReadFile into memory. So I could not do something like
double percentage = IReadFile->getPos() / fileSize, because it would always return 1.0
(Feature Request) Tracking XML File Reads
Re: (Feature Request) Tracking XML File Reads
Yeah - you did already find the problem with tracking loading progress (also makes it hard to show per-line errors by the waym that was another feature request in the past). But I also have no idea how to change this without writing another xml reader.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: (Feature Request) Tracking XML File Reads
CuteAlien
You could add an extra class variable
And just add a function to return that value
Code: Select all
//! Reads forward to the next xml node.
//! \return Returns false, if there was no further node.
virtual bool read()
{
// if not end reached, parse the node
if (P && ((unsigned int)(P - TextBegin) < TextSize - 1) && (*P != 0))
{
return parseCurrentNode();
}
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return false;
}
Code: Select all
Percentage = (double)(P - TextBegin) / (double)(TextSize - 1) * 100.0;