Changeset 7387 in vbox for trunk/src/VBox/Main/VirtualBoxImplExtra.cpp
- Timestamp:
- Mar 9, 2008 11:54:02 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28816
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/VirtualBoxImplExtra.cpp
r7341 r7387 75 75 * 76 76 * The implementation normally checks for the "version" value of the 77 * root key to determine if the conversion is necessary. The 78 * implementation must return a string representing the old version 79 * (before conversion) in the @c aOldVersion argument -- this string is 80 * used by XmlTreeBackend::oldVersion() and must be non-NULL to indicate 81 * that the conversion has been performed on the tree. The returned 82 * string must be allocated using RTStrDup or such. 77 * root key to determine if the conversion is necessary. When the 78 * @a aOldVersion argument is not NULL, the implementation must return a 79 * non-NULL non-empty string representing the old version (before 80 * conversion) in it this string is used by XmlTreeBackend::oldVersion() 81 * and must be non-NULL to indicate that the conversion has been 82 * performed on the tree. The returned string must be allocated using 83 * RTStrDup() or such. 84 * 85 * This method is called again after the successful transformation to 86 * let the implementation retry the version check and request another 87 * transformation if necessary. This may be used to perform multi-step 88 * conversion like this: 1.1 => 1.2, 1.2 => 1.3 (instead of 1.1 => 1.3) 89 * which saves from the need to update all previous conversion 90 * templates to make each of them convert directly to the recent 91 * version. 92 * 93 * @note Multi-step transformations are performed in a loop that exits 94 * only when this method returns @false. It's up to the 95 * implementation to detect cycling (repeated requests to convert 96 * from the same version) wrong version order, etc. and throw an 97 * EConversionCycle exception to break the loop without returning 98 * @false (which means the transformation succeeded). 83 99 * 84 100 * @param aRoot Root settings key. 85 * @param aOldVersionString Old version string (allocated by86 * RTStrDup or such).101 * @param aOldVersionString Where to store old version string 102 * pointer. May be NULL. 87 103 */ 88 104 bool VirtualBox::SettingsTreeHelper:: 89 needsConversion (const settings::Key &aRoot, char * &aOldVersion) const105 needsConversion (const settings::Key &aRoot, char **aOldVersion) const 90 106 { 91 107 if (strcmp (aRoot.name(), "VirtualBox") == 0) … … 98 114 { 99 115 /* version mismatch */ 100 aOldVersion = RTStrDup (version); 116 if (aOldVersion != NULL) 117 *aOldVersion = RTStrDup (version); 118 101 119 return true; 102 120 }
Note:
See TracChangeset
for help on using the changeset viewer.