Page 1 of 1

(Feature Request) Tracking XML File Reads

Posted: Fri Nov 01, 2013 3:16 am
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

Re: (Feature Request) Tracking XML File Reads

Posted: Sun Nov 03, 2013 10:16 pm
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.

Re: (Feature Request) Tracking XML File Reads

Posted: Fri Nov 22, 2013 11:32 pm
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