Changeset 7388 in vbox
- Timestamp:
- Mar 9, 2008 11:54:16 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r7315 r7388 1299 1299 1300 1300 /** 1301 * The Error class represents errors that may happen when parsing or 1302 * validating the XML document representing the settings tree. 1303 */ 1304 class VBOXSETTINGS_CLASS Error : public RuntimeError 1305 { 1306 public: 1307 1308 Error (const char *aMsg = NULL) : RuntimeError (aMsg) {} 1309 }; 1310 1311 /** 1312 * The EConversionCycle class represents a conversion cycle detected by the 1313 * AutoConverter::needsConversion() implementation. 1314 */ 1315 class VBOXSETTINGS_CLASS EConversionCycle : public Error 1316 { 1317 public: 1318 1319 EConversionCycle (const char *aMsg = NULL) : Error (aMsg) {} 1320 }; 1321 1322 /** 1301 1323 * The InputResolver class represents an interface to provide input streams 1302 1324 * for external entities given an URL and entity ID. … … 1337 1359 * 1338 1360 * The implementation normally checks for the "version" value of the 1339 * root key to determine if the conversion is necessary. The 1340 * implementation must return a string representing the old version 1341 * (before conversion) in the @c aOldVersion argument -- this string is 1342 * used by XmlTreeBackend::oldVersion() and must be non-NULL to indicate 1343 * that the conversion has been performed on the tree. The returned 1344 * string must be allocated using RTStrDup or such. 1361 * root key to determine if the conversion is necessary. When the 1362 * @a aOldVersion argument is not NULL, the implementation must return a 1363 * non-NULL non-empty string representing the old version (before 1364 * conversion) in it this string is used by XmlTreeBackend::oldVersion() 1365 * and must be non-NULL to indicate that the conversion has been 1366 * performed on the tree. The returned string must be allocated using 1367 * RTStrDup() or such. 1368 * 1369 * This method is called again after the successful transformation to 1370 * let the implementation retry the version check and request another 1371 * transformation if necessary. This may be used to perform multi-step 1372 * conversion like this: 1.1 => 1.2, 1.2 => 1.3 (instead of 1.1 => 1.3) 1373 * which saves from the need to update all previous conversion 1374 * templates to make each of them convert directly to the recent 1375 * version. 1376 * 1377 * @note Multi-step transformations are performed in a loop that exits 1378 * only when this method returns @false. It's up to the 1379 * implementation to detect cycling (repeated requests to convert 1380 * from the same version) wrong version order, etc. and throw an 1381 * EConversionCycle exception to break the loop without returning 1382 * @false (which means the transformation succeeded). 1345 1383 * 1346 1384 * @param aRoot Root settings key. 1347 * @param aOldVersionString Old version string (allocated by1348 * RTStrDup or such).1385 * @param aOldVersionString Where to store old version string 1386 * pointer. May be NULL. 1349 1387 */ 1350 1388 virtual bool needsConversion (const Key &aRoot, 1351 char * &aOldVersion) const = 0;1389 char **aOldVersion) const = 0; 1352 1390 1353 1391 /** … … 1359 1397 }; 1360 1398 1361 /**1362 * The Error class represents errors that may happen when parsing or1363 * validating the XML document representing the settings tree.1364 */1365 class VBOXSETTINGS_CLASS Error : public RuntimeError1366 {1367 public:1368 1369 Error (const char *aMsg = NULL) : RuntimeError (aMsg) {}1370 };1371 1372 1399 XmlTreeBackend(); 1373 1400 ~XmlTreeBackend();
Note:
See TracChangeset
for help on using the changeset viewer.