(Feature Request) Tracking XML File Reads

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
clarks
Posts: 35
Joined: Sat Jul 28, 2012 5:23 am

(Feature Request) Tracking XML File Reads

Post by clarks »

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
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: (Feature Request) Tracking XML File Reads

Post by CuteAlien »

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
clarks
Posts: 35
Joined: Sat Jul 28, 2012 5:23 am

Re: (Feature Request) Tracking XML File Reads

Post by clarks »

CuteAlien

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;
    }
 
You could add an extra class variable

Code: Select all

 
Percentage = (double)(P - TextBegin) / (double)(TextSize - 1) * 100.0;
 
And just add a function to return that value
Post Reply