Tuesday, August 11, 2009

Hey nick!!

void XMLParser::startElement(const XML_Char* name, const XML_Char** atts)
{
m_inputNaam = name;
if(m_inputNaam == _T("module"))
{
m_CurrentModule = new Module();
VulIn(atts[0],atts[1]);
VulIn(atts[2],atts[3]);
VulIn(atts[4],atts[5]);
VulIn(atts[6],atts[7]);
m_VectorRef.push_back(m_CurrentModule);
}
}

void XMLParser::VulIn(tstring attribuutNaam, tstring waarde)
{
tstringstream stream;
if(attribuutNaam == _T("naam"))
{
m_CurrentModule->SetNaam(waarde);
}
else if(attribuutNaam == _T("aantal"))
{
stream< int i;
stream >>i;
stream.str(_T(""));
stream.clear();
m_CurrentModule->SetAantal(i);
}
else if(attribuutNaam == _T("type"))
{
m_CurrentModule->SetType(waarde);
}
else if(attribuutNaam == _T("techlevel"))
{
if(waarde == _T("2"))
m_CurrentModule->SetTech2(true);
else
m_CurrentModule->SetTech2(false);
}
}