Changeset 27918 in vbox for trunk/src/VBox/Main/ApplianceImpl.cpp
- Timestamp:
- Mar 31, 2010 5:10:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r27908 r27918 964 964 /* Initialize data */ 965 965 m = new Data(); 966 m->pConfig = NULL; 966 967 967 968 /* Confirm a successful initialization */ … … 976 977 void VirtualSystemDescription::uninit() 977 978 { 979 if (m->pConfig) 980 delete m->pConfig; 978 981 delete m; 979 982 m = NULL; … … 1323 1326 } 1324 1327 1328 /** 1329 * Method called from Appliance::Interpret() if the source OVF for a virtual system 1330 * contains a <vbox:Machine> element. This method then attempts to parse that and 1331 * create a MachineConfigFile instance from it which is stored in this instance data 1332 * and can then be used to create a machine. 1333 * 1334 * This must only be called once per instance. 1335 * 1336 * This rethrows all XML and logic errors from MachineConfigFile. 1337 * 1338 * @param elmMachine <vbox:Machine> element with attributes and subelements from some 1339 * DOM tree. 1340 */ 1341 void VirtualSystemDescription::importVboxMachineXML(const xml::ElementNode &elmMachine) 1342 { 1343 settings::MachineConfigFile *pConfig = NULL; 1344 1345 Assert(m->pConfig == NULL); 1346 1347 try 1348 { 1349 pConfig = new settings::MachineConfigFile(NULL); 1350 pConfig->importMachineXML(elmMachine); 1351 1352 m->pConfig = pConfig; 1353 } 1354 catch (...) 1355 { 1356 if (pConfig) 1357 delete pConfig; 1358 throw; 1359 } 1360 } 1361 1362 /** 1363 * Returns the machine config created by importVboxMachineXML() or NULL if there's none. 1364 * @return 1365 */ 1366 const settings::MachineConfigFile* VirtualSystemDescription::getMachineConfig() const 1367 { 1368 return m->pConfig; 1369 } 1370
Note:
See TracChangeset
for help on using the changeset viewer.