Changeset 8699
- Timestamp:
- 02/16/09 15:29:09 (4 years ago)
- Location:
- ossiedev/branches/mcarrick/DPD
- Files:
-
- 9 modified
-
DeviceClass.cpp (modified) (1 diff)
-
DeviceClass.h (modified) (1 diff)
-
DevicePkg.cpp (modified) (3 diffs)
-
DevicePkg.h (modified) (1 diff)
-
HWDeviceRegistration.cpp (modified) (5 diffs)
-
HWDeviceRegistration.h (modified) (2 diffs)
-
PropertyFile.cpp (modified) (2 diffs)
-
PropertyFile.h (modified) (1 diff)
-
testApp.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/mcarrick/DPD/DeviceClass.cpp
r8691 r8699 12 12 DeviceClass::~DeviceClass() 13 13 { 14 std::cout << "dev class deconstruct ... " << std::endl;15 14 } 16 15 -
ossiedev/branches/mcarrick/DPD/DeviceClass.h
r8679 r8699 15 15 DeviceClass(TiXmlElement *elem); 16 16 ~DeviceClass(); 17 17 18 std::vector <std::string> getDeviceClass(); 18 19 -
ossiedev/branches/mcarrick/DPD/DevicePkg.cpp
r8697 r8699 12 12 DevicePkg::~DevicePkg() 13 13 { 14 std::cout << "dev pkg deconstruct ... " << std::endl;15 14 } 16 15 … … 20 19 21 20 // get attributes from devicepkg 21 parseAttributes(elem); 22 23 // parse info from author, title and description tags 24 parseChildElements(elem); 25 } 26 27 void DevicePkg::parseAttributes(TiXmlElement *elem) 28 { 22 29 id = elem->Attribute("id"); 23 30 name = elem->Attribute("name"); 24 31 version = elem->Attribute("version"); 32 } 25 33 26 // parse info from author, title and description tags 34 void DevicePkg::parseChildElements(TiXmlElement *elem) 35 { 27 36 TiXmlElement *auth = elem->FirstChildElement("author"); 28 37 author = auth->GetText(); … … 33 42 TiXmlElement *descrip = elem->FirstChildElement("description"); 34 43 description = descrip->GetText(); 35 36 44 } 37 45 38 std::string DevicePkg::get IDDevPkg()46 std::string DevicePkg::getDevPkgID() 39 47 { 40 48 return id; 41 49 } 42 50 43 std::string DevicePkg::get NameDevPkg()51 std::string DevicePkg::getDevPkgName() 44 52 { 45 53 return name; 46 54 } 47 55 48 std::string DevicePkg::get VersionDevPkg()56 std::string DevicePkg::getDevPkgVersion() 49 57 { 50 58 return version; 51 59 } 52 60 53 std::string DevicePkg::get Title()61 std::string DevicePkg::getDevPkgTitle() 54 62 { 55 63 return title; 56 64 } 57 65 58 std::string DevicePkg::get Author()66 std::string DevicePkg::getDevPkgAuthor() 59 67 { 60 68 return author; 61 69 } 62 70 63 std::string DevicePkg::getDe scription()71 std::string DevicePkg::getDevPkgDescription() 64 72 { 65 73 return description; -
ossiedev/branches/mcarrick/DPD/DevicePkg.h
r8697 r8699 18 18 ~DevicePkg(); 19 19 20 std::string get IDDevPkg();21 std::string get NameDevPkg();22 std::string get VersionDevPkg();20 std::string getDevPkgID(); 21 std::string getDevPkgName(); 22 std::string getDevPkgVersion(); 23 23 24 std::string get Title();25 std::string get Author();26 std::string getDe scription();24 std::string getDevPkgTitle(); 25 std::string getDevPkgAuthor(); 26 std::string getDevPkgDescription(); 27 27 28 28 protected: 29 29 void parseElement(TiXmlElement *elem); 30 void parseAttributes(TiXmlElement *elem); 31 void parseChildElements(TiXmlElement *elem); 30 32 31 33 private: -
ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.cpp
r8697 r8699 16 16 HWDeviceRegistration::~HWDeviceRegistration() 17 17 { 18 /*19 std::cout << "hw device reg deconstruct ... " << std::endl;20 21 for (int i = 0; i < childHWDevices.size(); i++)22 {23 std::cout << "i: " << i << std::endl;24 delete [] childHWDevices[i];25 std::cout << "deleted, i: " << i << std::endl;26 }27 std::cout << "exiting hwdev deconstruct ... " << std::endl;28 */29 18 } 30 19 … … 64 53 } 65 54 66 ChildHWDevice::ChildHWDevice(TiXmlElement *elem):DevicePkgRef(elem->FirstChildElement("devicepkgref")) ,HWDeviceRegistration(elem->FirstChildElement("hwdeviceregistration"))55 ChildHWDevice::ChildHWDevice(TiXmlElement *elem):DevicePkgRef(elem->FirstChildElement("devicepkgref")) 67 56 { 68 57 } … … 70 59 ChildHWDevice::~ChildHWDevice() 71 60 { 72 std::cout << "child hw dev deconstruct ... " << std::endl;73 61 } 74 62 … … 78 66 } 79 67 80 std::string HWDeviceRegistration::get IDHWDevReg()68 std::string HWDeviceRegistration::getHWDevRegID() 81 69 { 82 70 return id; 83 71 } 84 72 85 std::string HWDeviceRegistration::get VersionHWDevReg()73 std::string HWDeviceRegistration::getHWDevRegVersion() 86 74 { 87 75 return version; 88 76 } 89 77 90 std::string HWDeviceRegistration::get NameHWDevReg()78 std::string HWDeviceRegistration::getHWDevRegName() 91 79 { 92 80 return name; 93 81 } 94 82 95 std::string HWDeviceRegistration::get Description()83 std::string HWDeviceRegistration::getHWDevRegDescription() 96 84 { 97 85 return description; 98 86 } 99 87 100 std::string HWDeviceRegistration::get Manufacturer()88 std::string HWDeviceRegistration::getHWDevRegManufacturer() 101 89 { 102 90 return manufacturer; 103 91 } 104 92 105 std::string HWDeviceRegistration::get ModelNumber()93 std::string HWDeviceRegistration::getHWDevRegModelNumber() 106 94 { 107 95 return modelnumber; … … 115 103 116 104 117 -
ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.h
r8697 r8699 23 23 ~HWDeviceRegistration(); 24 24 25 std::string get IDHWDevReg();26 std::string get VersionHWDevReg();27 std::string get NameHWDevReg();28 std::string get Description();29 std::string get Manufacturer();30 std::string get ModelNumber();25 std::string getHWDevRegID(); 26 std::string getHWDevRegVersion(); 27 std::string getHWDevRegName(); 28 std::string getHWDevRegDescription(); 29 std::string getHWDevRegManufacturer(); 30 std::string getHWDevRegModelNumber(); 31 31 32 32 std::vector <ChildHWDevice*> getChildHWDevice(); … … 57 57 ~ChildHWDevice(); 58 58 59 //HWDeviceRegistration getHWDeviceRegistration();59 HWDeviceRegistration getHWDeviceRegistration(); 60 60 61 61 protected: -
ossiedev/branches/mcarrick/DPD/PropertyFile.cpp
r8691 r8699 12 12 PropertyFile::~PropertyFile() 13 13 { 14 std::cout << "prop file deconstruct ... " << std::endl;15 14 } 16 15 … … 19 18 std::cout << "DEBUG: parsing property file..." << std::endl; 20 19 21 type = elem->Attribute("type"); // get type from propertyfile tag 22 23 TiXmlElement *local = elem->FirstChildElement("localfile"); // get link to localfile tag 24 localfile = local->Attribute("name"); // store path 20 parseAttributes(elem); // get type from propertyfile tag 21 parseChildElements(elem); // parse localfile tag 25 22 } 26 23 27 std::string PropertyFile::getTypePropFile() 24 void PropertyFile::parseAttributes(TiXmlElement *elem) 25 { 26 type = elem->Attribute("type"); 27 } 28 29 void PropertyFile::parseChildElements(TiXmlElement *elem) 30 { 31 TiXmlElement *local = elem->FirstChildElement("localfile"); 32 localfile = local->Attribute("name"); 33 } 34 35 std::string PropertyFile::getPropFileType() 28 36 { 29 37 return type; 30 38 } 31 39 32 std::string PropertyFile::get LocalFilePropFile()40 std::string PropertyFile::getPropFileLocalFile() 33 41 { 34 42 return localfile; -
ossiedev/branches/mcarrick/DPD/PropertyFile.h
r8686 r8699 15 15 PropertyFile(TiXmlElement *elem); 16 16 ~PropertyFile(); 17 std::string get TypePropFile();18 std::string get LocalFilePropFile();17 std::string getPropFileType(); 18 std::string getPropFileLocalFile(); 19 19 20 20 protected: 21 21 void parseElement(TiXmlElement *elem); 22 void parseAttributes(TiXmlElement *elem); 23 void parseChildElements(TiXmlElement *elem); 22 24 23 25 private: -
ossiedev/branches/mcarrick/DPD/testApp.cpp
r8697 r8699 42 42 DevicePkg parse(devpkg); 43 43 44 44 // print xml tags ... 45 45 std::cout << "******************************" << std::endl; 46 46 std::cout << "DevicePkg: " << std::endl; 47 std::cout << "<devicepkg id=" << parse.getIDDevPkg() << " version=" << parse.getVersionDevPkg() << " name=" << parse.getNameDevPkg() << ">" << std::endl; 48 std::cout << " <title>" << parse.getTitle() << "</title>" << std::endl; 49 std::cout << " <author>" << parse.getAuthor() << "</author>" << std::endl; 50 std::cout << " <description>" << parse.getDescription() << "</description>" << std::endl; 51 std::cout << " <hwdeviceregistration id=" << parse.getIDHWDevReg() << std::endl; 47 std::cout << "<devicepkg id=" << parse.getDevPkgID() << " version=" << parse.getDevPkgVersion() << " name=" << parse.getDevPkgName() << ">" << std::endl; 48 std::cout << " <title>" << parse.getDevPkgTitle() << "</title>" << std::endl; 49 std::cout << " <author>" << parse.getDevPkgAuthor() << "</author>" << std::endl; 50 std::cout << " <description>" << parse.getDevPkgDescription() << "</description>" << std::endl; 51 std::cout << " <hwdeviceregistration id=" << parse.getHWDevRegID() << " version=" << parse.getHWDevRegVersion(); 52 std::cout << " name=" << parse.getHWDevRegName() << ">" << std::endl; 53 std::cout << " <propertyfile type=" << parse.getPropFileType() << ">" << std::endl; 54 std::cout << " <localfile name=" << parse.getPropFileLocalFile() << "/>" << std::endl; 55 std::cout << " </propertyfile>" << std::endl; 56 std::cout << " <description>" << parse.getHWDevRegDescription() << "</description>" << std::endl; 57 std::cout << " <manufacturer>" << parse.getHWDevRegManufacturer() << "</manufacturer>" << std::endl; 58 std::cout << " <modelnumber>" << parse.getHWDevRegModelNumber() << "</modelnumber>" << std::endl; 59 std::cout << " <deviceclass>" << std::endl; 60 for (int i = 0; i < parse.getDeviceClass().size(); i++) 61 { 62 std::cout << " <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl; 63 } 64 std::cout << " </deviceclass>" << std::endl; 65 66 52 67 std::cout << "</devicepkg>" << std::endl; 53 68 } … … 73 88 74 89 PropertyFile parse(propFile); 75 76 std::cout << "******************" << std::endl;77 std::cout << "PropertyFile: " << std::endl;78 std::cout << "Type: " << parse.getTypePropFile() << std::endl;79 std::cout << "Localfile: " << parse.getLocalFilePropFile() << std::endl;80 std::cout << "******************" << std::endl;81 90 } 82 91 else … … 101 110 102 111 HWDeviceRegistration parse(devReg); 103 104 std::cout << std::endl << std::endl;105 106 std::cout << "<hwdeviceregistration id=" << parse.getIDHWDevReg() << " version=" << parse.getVersionHWDevReg();107 std::cout << " name=" << parse.getNameHWDevReg() << ">" << std::endl;108 std::cout << " <propertyfile type=" << parse.getTypePropFile() << ">" << std::endl;109 std::cout << " <localfile name=" << parse.getLocalFilePropFile() << ">" << std::endl;110 std::cout << " </propertyfile>" << std::endl;111 std::cout << " <description>" << parse.getDescription() << "</description" << std::endl;112 std::cout << " <manufacturer>" << parse.getManufacturer() << "</manufacturer>" << std::endl;113 std::cout << " <modelnumber>" << parse.getModelNumber() << "</modelnumber>" << std::endl;114 std::cout << " <deviceclass>" << std::endl;115 116 for (int i = 0; i < parse.getDeviceClass().size(); i++)117 {118 std::cout << " <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl;119 }120 std::cout << " </deviceclass>" << std::endl;121 122 std::cout << " <childhwdevice>" << std::endl;123 std::cout << " <hwdeviceregistration id=" << parse.getChildHWDevice()[0]->getIDHWDevReg();124 std::cout << " version=" << parse.getChildHWDevice()[0]->getVersionHWDevReg();125 std::cout << " name=" << parse.getChildHWDevice()[0]->getNameHWDevReg() << " >" << std::endl;126 std::cout << " <propertyfile " << parse.getChildHWDevice()[0]->getTypePropFile() << "> " << std::endl;127 std::cout << " <localfile name=" << parse.getChildHWDevice()[0]->getLocalFilePropFile() << "/> " << std::endl;128 std::cout << " </propertyfile>" << std::endl;129 std::cout << " <description>" << parse.getChildHWDevice()[0]->getDescription() << "</description>" << std::endl;130 std::cout << " <manufacturer>" << parse.getChildHWDevice()[0]->getManufacturer() << "</manufacturer>" << std::endl;131 std::cout << " <modelnumber>" << parse.getChildHWDevice()[0]->getModelNumber() << "</modelnumber>" << std::endl;132 std::cout << " <deviceclass>" << std::endl;133 std::cout << " <class>" << parse.getChildHWDevice()[0]->getDeviceClass()[0] << "</class>" << std::endl;134 std::cout << " </deviceclass>" << std::endl;135 std::cout << " <childhwdevice>" << std::endl;136 std::cout << " <hwdeviceregistration id=";137 std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getIDHWDevReg();138 std::cout << " version=" << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getVersionHWDevReg();139 std::cout << " name=" << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getNameHWDevReg() << ">" << std::endl;140 std::cout << " <propertyfile type=";141 std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getTypePropFile() << ">" << std::endl;142 std::cout << " <localfile name=";143 std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getLocalFilePropFile() << "/>" << std::endl;144 std::cout << " </propertyfile>" << std::endl;145 std::cout << " <description>";146 std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getDescription();147 std::cout << "</description>" << std::endl;148 std::cout << " <manufacturer>";149 std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getManufacturer();150 std::cout << "</manufacturer>" << std::endl;151 std::cout << " <modelnumber>";152 std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getModelNumber();153 std::cout << "</modelnumber>" << std::endl;154 std::cout << " <deviceclass>" << std::endl;155 std::cout << " <class>";156 std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getDeviceClass()[0];157 std::cout << "</class>" << std::endl;158 std::cout << " </deviceclass>" << std::endl;159 std::cout << " </hwdeviceregistration>" << std::endl;160 std::cout << " <devicepkgref name=" << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getTypeDevPkgRef();161 std::cout << std::endl;162 std::cout << " <localfile name=";163 std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getLocalFileDevPkgRef() << "/>" << std::endl;164 std::cout << " </devicepkgref>" << std::endl;165 std::cout << " </childhwdevice>" << std::endl;166 std::cout << " </hwdeviceregistration>" << std::endl;167 std::cout << " <devicepkgref>" << std::endl;168 std::cout << " <localfile name=" << parse.getChildHWDevice()[0]->getLocalFileDevPkgRef() << "/>" << std::endl;169 std::cout << " </devicepkgref>" << std::endl;170 std::cout << " </childhwdevice>" << std::endl;171 172 173 std::cout << " <childhwdevice>" << std::endl;174 std::cout << " <hwdeviceregistration id=" << parse.getChildHWDevice()[1]->getIDHWDevReg();175 std::cout << " version=" << parse.getChildHWDevice()[1]->getVersionHWDevReg();176 std::cout << " name=" << parse.getChildHWDevice()[1]->getNameHWDevReg() << ">" << std::endl;177 std::cout << " <propertyfile type=" << parse.getChildHWDevice()[1]->getTypePropFile() << ">" << std::endl;178 std::cout << " <localfile name=" << parse.getChildHWDevice()[1]->getLocalFilePropFile() << "/>" << std::endl;179 std::cout << " </propertyfile>" << std::endl;180 std::cout << " <description>" << parse.getChildHWDevice()[1]->getDescription() << "</description>" << std::endl;181 std::cout << " <manufacturer>" << parse.getChildHWDevice()[1]->getManufacturer() << "</manufacturer>" << std::endl;182 std::cout << " <modelnumber>" << parse.getChildHWDevice()[1]->getModelNumber() << "</modelnumber>" << std::endl;183 std::cout << " <deviceclass>" << std::endl;184 std::cout << " <class>" << parse.getChildHWDevice()[1]->getDeviceClass()[0] << "</class>" << std::endl;185 std::cout << " <class>" << parse.getChildHWDevice()[1]->getDeviceClass()[1] << "</class>" << std::endl;186 std::cout << " </deviceclass>" << std::endl;187 std::cout << " </hwdeviceregistration>" << std::endl;188 std::cout << " <devicepkgref type=" << parse.getChildHWDevice()[1]->getTypeDevPkgRef() << ">" << std::endl;189 std::cout << " <localfile name=" << parse.getChildHWDevice()[1]->getLocalFileDevPkgRef() << "/>" << std::endl;190 std::cout << " </devicepkgref>" << std::endl;191 192 193 194 std::cout << "</hwdeviceregistration>" << std::endl;195 196 112 197 113 std::cout << std::endl << std::endl;