root/ossiedev/branches/mcarrick/DPD/DeviceClass.cpp @ 8691

Revision 8691, 0.7 KB (checked in by mcarrick, 4 years ago)

parser works for recursive hwdevreg, childhwdev tags

Line 
1#include "DeviceClass.h"
2
3#include <iostream>
4
5#include "include/tinyxml.h"
6
7DeviceClass::DeviceClass(TiXmlElement *elem)
8{
9        parseElement(elem);
10}
11
12DeviceClass::~DeviceClass()
13{
14        std::cout << "dev class deconstruct ... " << std::endl;
15}
16
17void DeviceClass::parseElement(TiXmlElement *elem)
18{
19        std::cout << "DEBUG: parsing device class..." << std::endl;
20
21        TiXmlElement *classType = elem->FirstChildElement("class"); // set link to class tags
22       
23        // there may be one or more class tags, loop through and append them all
24        for (; classType; classType = classType->NextSiblingElement("class"))
25        {
26                deviceClass.push_back(classType->GetText());
27        }
28
29
30}
31
32std::vector <std::string> DeviceClass::getDeviceClass()
33{
34        return deviceClass;
35}
36
37
Note: See TracBrowser for help on using the browser.