Changeset 8721
- Timestamp:
- 02/17/09 19:28:59 (4 years ago)
- Location:
- ossiedev/branches/mcarrick/DPD
- Files:
-
- 1 added
- 1 removed
- 13 modified
-
DPDParser.cpp (modified) (1 diff)
-
DPDParser.h (modified) (3 diffs)
-
DeviceClass.cpp (modified) (1 diff)
-
DeviceClass.h (modified) (1 diff)
-
DevicePkg.cpp (modified) (2 diffs)
-
DevicePkg.h (modified) (3 diffs)
-
DevicePkgRef.cpp (modified) (1 diff)
-
DevicePkgRef.h (modified) (1 diff)
-
HWDeviceRegistration.cpp (modified) (5 diffs)
-
HWDeviceRegistration.h (modified) (6 diffs)
-
PropertyFile.cpp (modified) (1 diff)
-
PropertyFile.h (modified) (1 diff)
-
testApp.cpp (modified) (3 diffs)
-
xml/devicePkg.xml (deleted)
-
xml/test.dpd.xml (added)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/mcarrick/DPD/DPDParser.cpp
r8719 r8721 1 1 #include "DPDParser.h" 2 2 3 DPDParser::DPDParser(TiXmlElement *elem) :DevicePkg(elem)3 DPDParser::DPDParser(TiXmlElement *elem) 4 4 { 5 devPkg = new DevicePkg(elem); 5 6 } 6 7 7 8 DPDParser::~DPDParser() 8 9 { 10 delete devPkg; 9 11 } 10 12 13 DevicePkg* DPDParser::getDevicePkg() 14 { 15 return devPkg; 16 } 17 -
ossiedev/branches/mcarrick/DPD/DPDParser.h
r8719 r8721 12 12 13 13 //class OSSIEPARSER_API DPDParser:public DevicePkg 14 class DPDParser :public DevicePkg14 class DPDParser 15 15 { 16 16 public: … … 18 18 DPDParser(TiXmlElement *elem); 19 19 ~DPDParser(); 20 21 DevicePkg* getDevicePkg(); 20 22 21 23 protected: … … 25 27 DPDParser(const DPDParser &aDPDParser); // no copying 26 28 29 DevicePkg *devPkg; 27 30 }; 28 31 -
ossiedev/branches/mcarrick/DPD/DeviceClass.cpp
r8713 r8721 36 36 } 37 37 38 std::vector <std::string> DeviceClass::get DeviceClass()38 std::vector <std::string> DeviceClass::getClass() 39 39 { 40 40 return deviceClass; -
ossiedev/branches/mcarrick/DPD/DeviceClass.h
r8699 r8721 16 16 ~DeviceClass(); 17 17 18 std::vector <std::string> get DeviceClass();18 std::vector <std::string> getClass(); 19 19 20 20 protected: -
ossiedev/branches/mcarrick/DPD/DevicePkg.cpp
r8713 r8721 5 5 #include "include/tinyxml.h" 6 6 7 DevicePkg::DevicePkg(TiXmlElement *elem) :HWDeviceRegistration(elem->FirstChildElement("hwdeviceregistration"))7 DevicePkg::DevicePkg(TiXmlElement *elem) 8 8 { 9 9 parseElement(elem); // parse elements within devicepkg 10 hwDev = new HWDeviceRegistration(elem->FirstChildElement("hwdeviceregistration")); 10 11 } 11 12 12 13 DevicePkg::~DevicePkg() 13 14 { 15 delete hwDev; 14 16 } 15 17 … … 119 121 } 120 122 121 std::string DevicePkg::get DevPkgID()123 std::string DevicePkg::getID() 122 124 { 123 125 return id; 124 126 } 125 127 126 std::string DevicePkg::get DevPkgName()128 std::string DevicePkg::getName() 127 129 { 128 130 return name; 129 131 } 130 132 131 std::string DevicePkg::get DevPkgVersion()133 std::string DevicePkg::getVersion() 132 134 { 133 135 return version; 134 136 } 135 137 136 std::string DevicePkg::get DevPkgTitle()138 std::string DevicePkg::getTitle() 137 139 { 138 140 return title; 139 141 } 140 142 141 std::string DevicePkg::get DevPkgAuthor()143 std::string DevicePkg::getAuthor() 142 144 { 143 145 return author; 144 146 } 145 147 146 std::string DevicePkg::getDe vPkgDescription()148 std::string DevicePkg::getDescription() 147 149 { 148 150 return description; 149 151 } 150 152 153 HWDeviceRegistration* DevicePkg::getHWDeviceRegistration() 154 { 155 return hwDev; 156 } -
ossiedev/branches/mcarrick/DPD/DevicePkg.h
r8713 r8721 12 12 13 13 //class OSSIEPARSER_API DevicePkg 14 class DevicePkg :public HWDeviceRegistration14 class DevicePkg 15 15 { 16 16 public: … … 18 18 ~DevicePkg(); 19 19 20 std::string getDevPkgID(); 21 std::string getDevPkgName(); 22 std::string getDevPkgVersion(); 23 std::string getDevPkgTitle(); 24 std::string getDevPkgAuthor(); 25 std::string getDevPkgDescription(); 20 std::string getID(); 21 std::string getName(); 22 std::string getVersion(); 23 std::string getTitle(); 24 std::string getAuthor(); 25 std::string getDescription(); 26 27 HWDeviceRegistration* getHWDeviceRegistration(); 26 28 27 29 protected: … … 43 45 std::string name; 44 46 std::string version; 45 46 47 std::string title; 47 48 std::string author; 48 49 std::string description; 49 50 50 HWDeviceRegistration hwDev(TiXmlElement *elem);51 HWDeviceRegistration *hwDev; 51 52 }; 52 53 -
ossiedev/branches/mcarrick/DPD/DevicePkgRef.cpp
r8713 r8721 50 50 } 51 51 52 std::string DevicePkgRef::get DevPkgRefType()52 std::string DevicePkgRef::getType() 53 53 { 54 54 return type; 55 55 } 56 56 57 std::string DevicePkgRef::get DevPkgRefLocalFile()57 std::string DevicePkgRef::getLocalFile() 58 58 { 59 59 return localfile; -
ossiedev/branches/mcarrick/DPD/DevicePkgRef.h
r8703 r8721 16 16 ~DevicePkgRef(); 17 17 18 std::string get DevPkgRefType();19 std::string get DevPkgRefLocalFile();18 std::string getType(); 19 std::string getLocalFile(); 20 20 21 21 protected: -
ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.cpp
r8719 r8721 5 5 #include "include/tinyxml.h" 6 6 7 HWDeviceRegistration::HWDeviceRegistration(TiXmlElement *elem):PropertyFile(elem->FirstChildElement("propertyfile")), 8 DeviceClass(elem->FirstChildElement("deviceclass")) 7 HWDeviceRegistration::HWDeviceRegistration(TiXmlElement *elem) 9 8 { 10 9 parseElement(elem); // parse tags in hwdeviceregistration, with exception of propertyfile, deviceclass, childhwdevice 10 11 propFile = new PropertyFile(elem->FirstChildElement("propertyfile")); 12 devClass = new DeviceClass(elem->FirstChildElement("deviceclass")); 13 11 14 constructChildHWDevice(elem->FirstChildElement("childhwdevice")); 12 15 } … … 17 20 { 18 21 delete childHWDevices[i]; 19 } 22 childHWDevices[i] = NULL; 23 } 24 25 delete propFile; 26 propFile = NULL; 27 delete devClass; 28 devClass = NULL; 20 29 21 30 } … … 145 154 } 146 155 147 ChildHWDevice::ChildHWDevice(TiXmlElement *elem) :DevicePkgRef(elem->FirstChildElement("devicepkgref"))156 ChildHWDevice::ChildHWDevice(TiXmlElement *elem) 148 157 { 149 158 hwDeviceReg = new HWDeviceRegistration(elem->FirstChildElement("hwdeviceregistration")); 159 devPkgRef = new DevicePkgRef(elem->FirstChildElement("devicepkgref")); 150 160 } 151 161 … … 160 170 } 161 171 162 std::string HWDeviceRegistration::getHWDevRegID() 172 PropertyFile* HWDeviceRegistration::getPropertyFile() 173 { 174 return propFile; 175 } 176 177 DeviceClass* HWDeviceRegistration::getDeviceClass() 178 { 179 return devClass; 180 } 181 182 std::string HWDeviceRegistration::getID() 163 183 { 164 184 return id; 165 185 } 166 186 167 std::string HWDeviceRegistration::get HWDevRegVersion()187 std::string HWDeviceRegistration::getVersion() 168 188 { 169 189 return version; 170 190 } 171 191 172 std::string HWDeviceRegistration::get HWDevRegName()192 std::string HWDeviceRegistration::getName() 173 193 { 174 194 return name; 175 195 } 176 196 177 std::string HWDeviceRegistration::get HWDevRegDescription()197 std::string HWDeviceRegistration::getDescription() 178 198 { 179 199 return description; 180 200 } 181 201 182 std::string HWDeviceRegistration::get HWDevRegManufacturer()202 std::string HWDeviceRegistration::getManufacturer() 183 203 { 184 204 return manufacturer; 185 205 } 186 206 187 std::string HWDeviceRegistration::get HWDevRegModelNumber()207 std::string HWDeviceRegistration::getModelNumber() 188 208 { 189 209 return modelnumber; … … 195 215 } 196 216 197 198 199 200 217 DevicePkgRef* ChildHWDevice::getDevicePkgRef() 218 { 219 return devPkgRef; 220 } 221 222 223 -
ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.h
r8712 r8721 17 17 18 18 //class OSSIEPARSER_API HWDeviceRegistration 19 class HWDeviceRegistration :public PropertyFile, public DeviceClass19 class HWDeviceRegistration 20 20 { 21 21 public: … … 23 23 ~HWDeviceRegistration(); 24 24 25 std::string get HWDevRegID();26 std::string get HWDevRegVersion();27 std::string get HWDevRegName();28 std::string get HWDevRegDescription();29 std::string get HWDevRegManufacturer();30 std::string get HWDevRegModelNumber();25 std::string getID(); 26 std::string getVersion(); 27 std::string getName(); 28 std::string getDescription(); 29 std::string getManufacturer(); 30 std::string getModelNumber(); 31 31 32 32 std::vector <ChildHWDevice*> getChildHWDevice(); 33 PropertyFile* getPropertyFile(); 34 DeviceClass* getDeviceClass(); 33 35 34 36 protected: … … 48 50 HWDeviceRegistration(const HWDeviceRegistration& aHWDeviceRegistration); // no copying 49 51 50 std::vector <ChildHWDevice*> childHWDevices;51 52 52 std::string id; 53 53 std::string version; … … 56 56 std::string manufacturer; 57 57 std::string modelnumber; 58 59 std::vector <ChildHWDevice*> childHWDevices; 60 PropertyFile *propFile; 61 DeviceClass *devClass; 58 62 }; 59 63 60 64 // class OSSIEPARSER_API ChildHWDevice:public DevicePkgRef 61 class ChildHWDevice :public DevicePkgRef65 class ChildHWDevice 62 66 { 63 67 public: … … 66 70 67 71 HWDeviceRegistration* getHWDeviceRegistration(); 72 DevicePkgRef* getDevicePkgRef(); 68 73 69 74 private: … … 72 77 73 78 HWDeviceRegistration *hwDeviceReg; 79 DevicePkgRef *devPkgRef; 74 80 }; 75 81 -
ossiedev/branches/mcarrick/DPD/PropertyFile.cpp
r8713 r8721 50 50 } 51 51 52 std::string PropertyFile::get PropFileType()52 std::string PropertyFile::getType() 53 53 { 54 54 return type; 55 55 } 56 56 57 std::string PropertyFile::get PropFileLocalFile()57 std::string PropertyFile::getLocalFile() 58 58 { 59 59 return localfile; -
ossiedev/branches/mcarrick/DPD/PropertyFile.h
r8699 r8721 15 15 PropertyFile(TiXmlElement *elem); 16 16 ~PropertyFile(); 17 std::string get PropFileType();18 std::string get PropFileLocalFile();17 std::string getType(); 18 std::string getLocalFile(); 19 19 20 20 protected: -
ossiedev/branches/mcarrick/DPD/testApp.cpp
r8719 r8721 1 //#include "DevicePkg.h"2 1 #include "DPDParser.h" 3 2 … … 19 18 std::cout << "testDPDParser()" << std::endl; 20 19 21 char *root = "xml/ devicePkg.xml";20 char *root = "xml/test.dpd.xml"; 22 21 TiXmlDocument xmlDoc(root); // set up path to XML through char string 23 22 … … 29 28 DPDParser parse(DPD); 30 29 31 std::cout << std::endl << std::endl; 32 std::cout << "<devpkg id=" << parse.getDevPkgID() << " version=" << parse.getDevPkgVersion(); 33 std::cout << " name=" << parse.getDevPkgName() << ">" << std::endl; 34 std::cout << " <author>" << parse.getDevPkgAuthor() << "</author>" << std::endl; 35 std::cout << " <description>" << parse.getDevPkgDescription() << "</description>" << std::endl; 36 std::cout << " <title>" << parse.getDevPkgTitle() << "</title>" << std::endl; 37 std::cout << " <hwdeviceregistration id=" << parse.getHWDevRegID() << " version=" << parse.getHWDevRegVersion(); 38 std::cout << " name=" << parse.getHWDevRegName() << ">" << std::endl; 39 40 std::cout << " <propertyfile type=" << parse.getPropFileType() << ">" << std::endl; 41 std::cout << " <localfile name=" << parse.getPropFileLocalFile() << "/>" << std::endl; 42 std::cout << " </propertyfile>" << std::endl; 43 std::cout << " <description>" << parse.getHWDevRegDescription() << "</description>" << std::endl; 44 std::cout << " <manufacturer>" << parse.getHWDevRegManufacturer() << "</manufacturer>" << std::endl; 45 std::cout << " <modelnumber>" << parse.getHWDevRegModelNumber() << "</modelnumber>" << std::endl; 46 std::cout << " <deviceclass>" << std::endl; 47 for (int i = 0; i < parse.getDeviceClass().size(); i++) 48 { 49 std::cout << " <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl; 50 } 51 std::cout << " </deviceclass>" << std::endl; 52 53 for (int i = 0; i < parse.getChildHWDevice().size(); i++) 54 { 55 std::cout << " <childhwdevice>" << std::endl; 56 std::cout << " <hwdeviceregistration id=" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getHWDevRegID(); 57 std::cout << " version=" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getHWDevRegVersion(); 58 std::cout << " name=" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getHWDevRegName() << ">" << std::endl; 59 std::cout << " <propertyfile type=" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getPropFileType(); 60 std::cout << ">" << std::endl; 61 std::cout << " <localfile name=" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getPropFileLocalFile(); 62 std::cout << "/>" << std::endl; 63 std::cout << " </propertyfile>" << std::endl; 64 65 std::cout << " <description>" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getHWDevRegDescription(); 66 std::cout << "</descripton>" << std::endl; 67 std::cout << " <manufacturer>" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getHWDevRegManufacturer(); 68 std::cout << "</manufacturer>" << std::endl; 69 std::cout << " <modelnumber>" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getHWDevRegModelNumber(); 70 std::cout << "</modelnumber>" << std::endl; 71 std::cout << " <deviceclass>" << std::endl; 72 for (int k = 0; k < parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getDeviceClass().size(); k++) 73 { 74 std::cout << " <class>" << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getDeviceClass()[k]; 75 std::cout << "</class>" << std::endl; 76 } 77 std::cout << " </deviceclass>" << std::endl; 78 79 80 for (int j = 0; j < parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getChildHWDevice().size(); j++) 81 { 82 std::cout << " <childhwdevice>" << std::endl; 83 std::cout << " <hwdeviceregistration id="; 84 std::cout << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getChildHWDevice()[j]->getHWDeviceRegistration()->getHWDevRegID(); 85 std::cout << " version="; 86 std::cout << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getChildHWDevice()[j]->getHWDeviceRegistration()->getHWDevRegVersion(); 87 std::cout << " name="; 88 std::cout << parse.getChildHWDevice()[i]->getHWDeviceRegistration()->getChildHWDevice()[j]->getHWDeviceRegistration()->getHWDevRegName(); 89 std::cout << ">" << std::endl; 90 std::cout << " ..." << std::endl; 91 std::cout << " </hwdeviceregistration>" << std::endl; 92 std::cout << " </childhwdevice>" << std::endl; 93 } 94 95 } 96 std::cout << " </hwdeviceregistration>" << std::endl; 97 std::cout << "</devpkg>" << std::endl; 30 std::cout << "devpkg: id=" << parse.getDevicePkg()->getID() << " name=" << parse.getDevicePkg()->getName(); 31 std::cout << " version=" << parse.getDevicePkg()->getVersion() << std::endl; 32 std::cout << " title: " << parse.getDevicePkg()->getTitle() << std::endl; 33 std::cout << " author: " << parse.getDevicePkg()->getAuthor() << std::endl; 34 std::cout << " description: " << parse.getDevicePkg()->getDescription() << std::endl; 35 std::cout << " hwdeviceregistration: id=" << parse.getDevicePkg()->getHWDeviceRegistration()->getID() << std::endl; 36 std::cout << " deviceclass" << std::endl; 37 std::cout << " class: " << parse.getDevicePkg()->getHWDeviceRegistration()->getDeviceClass()->getClass()[0] << std::endl; 38 std::cout << " childhwdevice: " << std::endl; 39 std::cout << " hwdeviceregistration: id=" << parse.getDevicePkg()->getHWDeviceRegistration()->getChildHWDevice()[0]->getHWDeviceRegistration()->getID() << std::endl; 98 40 99 41 }