| 85 | | void testPropertyFile() |
| 86 | | { |
| 87 | | std::cout << "testPropertyFile()" << std::endl; |
| 88 | | |
| 89 | | char *root = "xml/propertyFile.xml"; |
| 90 | | TiXmlDocument xmlDoc(root); // set up path to XML through char string |
| 91 | | |
| 92 | | if (xmlDoc.LoadFile()) |
| 93 | | { |
| 94 | | TiXmlHandle doc(&xmlDoc); // get handle to XML file |
| 95 | | TiXmlElement *propFile = doc.FirstChild("propertyfile").Element(); |
| 96 | | |
| 97 | | PropertyFile parse(propFile); |
| 98 | | } |
| 99 | | else |
| 100 | | { |
| 101 | | std::cout << "can't load the file " << root << std::endl; |
| 102 | | } |
| 103 | | std::cout << std::endl; |
| 104 | | } |
| 105 | | |
| 106 | | |
| 107 | | void testHWDeviceRegistration() |
| 108 | | { |
| 109 | | std::cout << "testHWDeviceRegistration()" << std::endl; |
| 110 | | |
| 111 | | char *root = "xml/hwDeviceRegistration.xml"; |
| 112 | | TiXmlDocument xmlDoc(root); // set up path to XML through char string |
| 113 | | |
| 114 | | if (xmlDoc.LoadFile()) |
| 115 | | { |
| 116 | | TiXmlHandle doc(&xmlDoc); // get handle to XML file |
| 117 | | TiXmlElement *devReg = doc.FirstChild("hwdeviceregistration").Element(); |
| 118 | | |
| 119 | | HWDeviceRegistration parse(devReg); |
| 120 | | |
| 121 | | std::cout << std::endl << std::endl; |
| 122 | | |
| 123 | | } |
| 124 | | else |
| 125 | | { |
| 126 | | std::cout << "you botched it, can't load " << root << std::endl; |
| 127 | | } |
| 128 | | std::cout << std::endl; |
| 129 | | } |
| 130 | | |
| 131 | | void testDevicePkgRef() |
| 132 | | { |
| 133 | | std::cout << "testDevicePkgRef()" << std::endl; |
| 134 | | |
| 135 | | char *root = "xml/devicePkgRef.xml"; |
| 136 | | TiXmlDocument xmlDoc(root); // set up path to XML through char string |
| 137 | | |
| 138 | | if (xmlDoc.LoadFile()) |
| 139 | | { |
| 140 | | TiXmlHandle doc(&xmlDoc); // get handle to XML file |
| 141 | | TiXmlElement *devPkgRef = doc.FirstChild("devicepkgref").Element(); |
| 142 | | |
| 143 | | DevicePkgRef parse(devPkgRef); |
| 144 | | } |
| 145 | | else |
| 146 | | { |
| 147 | | std::cout << "you botched it, couldn't load " << root << std::endl; |
| 148 | | } |
| 149 | | std::cout << std::endl; |
| 150 | | } |
| 151 | | |
| 152 | | void testDeviceClass() |
| 153 | | { |
| 154 | | std::cout << "testDeviceClass()" << std::endl; |
| 155 | | char *root = "xml/deviceClass.xml"; |
| 156 | | TiXmlDocument xmlDoc(root); // set up path to XML through character string |
| 157 | | |
| 158 | | if (xmlDoc.LoadFile()) |
| 159 | | { |
| 160 | | TiXmlHandle doc(&xmlDoc); // get handle to XML file |
| 161 | | TiXmlElement *devClass = doc.FirstChild("deviceclass").Element(); |
| 162 | | DeviceClass parse(devClass); |
| 163 | | |
| 164 | | std::cout << "*************************" << std::endl; |
| 165 | | std::cout << "DeviceClass: " << std::endl; |
| 166 | | std::cout << "Classes: " << std::endl; |
| 167 | | |
| 168 | | int size = parse.getDeviceClass().size(); |
| 169 | | for (int i = 0; i < size; i++) |
| 170 | | { |
| 171 | | std::cout << parse.getDeviceClass()[i] << ", "; |
| 172 | | } |
| 173 | | |
| 174 | | std::cout << std::endl; |
| 175 | | std::cout << "*************************" << std::endl; |
| 176 | | } |
| 177 | | else |
| 178 | | { |
| 179 | | std::cout << "you botched it, couldn't load " << root << std::endl; |
| 180 | | } |
| 181 | | std::cout << std::endl; |
| 182 | | } |