xml class

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
after-life
Posts: 69
Joined: Wed Mar 30, 2005 8:16 am
Location: Keerbergen, Belgium

xml class

Post by after-life »

Hi, I've stated on making a couple of classes for a game that me and some other guys are going to make.
I was doing an xml reader class and I know I'm doing something terribly wrong, here is my code:

Code: Select all

#include "XMLReader.h" 

IXMLReader* xml;

void createXMLReader(IrrlichtDevice* device, c8* filename)
{
    xml = device->getFileSystem()->createXMLReader(filename); 
}

stringw XMLReader::readXMLFile(stringw element, stringw attribute)
{
    while(xml && xml->read()) 
    { 
        switch(xml->getNodeType()) 
        { 
            case EXN_ELEMENT: 
            { 
                if(element == xml->getNodeName()) 
                { 
                    return xml->getAttributeValue(attribute);
                } 
            } 
        } 
        break; 
    } 
}
but it doesnt accept a stringw for attribute and if i return a stringw how can i convert it to something useful?

thx, after-life
after-life
Posts: 69
Joined: Wed Mar 30, 2005 8:16 am
Location: Keerbergen, Belgium

Post by after-life »

can anyone help, pls?
i realy need this
Post Reply