- Timestamp:
- Jan 30, 2007 10:21:03 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r441 r447 5328 5328 char *pszExtraDataKey = (char*)strExtraDataKeyUtf8.raw() + 13; 5329 5329 5330 /* the key will be in the format "Node1/Node2/Value" */ 5330 /* the key will be in the format "Node1/Node2/Value" or simply "Value". */ 5331 PCFGMNODE pNode; 5331 5332 char *pszCFGMValueName = strrchr(pszExtraDataKey, '/'); 5332 if (!pszCFGMValueName) 5333 continue; 5334 /* terminate the node and advance to the value */ 5335 *pszCFGMValueName = '\0'; 5336 pszCFGMValueName++; 5337 5338 PCFGMNODE pNode; 5339 /* does the node already exist? */ 5340 pNode = CFGMR3GetChild(pRoot, pszExtraDataKey); 5341 if (pNode) 5342 { 5333 if (pszCFGMValueName) 5334 { 5335 /* terminate the node and advance to the value */ 5336 *pszCFGMValueName = '\0'; 5337 pszCFGMValueName++; 5338 5339 /* does the node already exist? */ 5340 pNode = CFGMR3GetChild(pRoot, pszExtraDataKey); 5341 if (pNode) 5342 { 5343 /* the value might already exist, remove it to be safe */ 5344 CFGMR3RemoveValue(pNode, pszCFGMValueName); 5345 } 5346 else 5347 { 5348 /* create the node */ 5349 rc = CFGMR3InsertNode(pRoot, pszExtraDataKey, &pNode); 5350 AssertMsgRC(rc, ("failed to insert node '%s'\n", pszExtraDataKey)); 5351 if (VBOX_FAILURE(rc) || !pNode) 5352 continue; 5353 } 5354 } 5355 else 5356 { 5357 pNode = pRoot; 5358 pszCFGMValueName = pszExtraDataKey; 5359 pszExtraDataKey--; 5360 5343 5361 /* the value might already exist, remove it to be safe */ 5344 5362 CFGMR3RemoveValue(pNode, pszCFGMValueName); 5345 5363 } 5346 else 5347 { 5348 /* create the node */ 5349 rc = CFGMR3InsertNode(pRoot, pszExtraDataKey, &pNode); 5350 AssertMsgRC(rc, ("failed to insert node '%s'\n", pszExtraDataKey)); 5351 if (VBOX_FAILURE(rc) || !pNode) 5352 continue; 5353 } 5364 5354 5365 /* now let's have a look at the value */ 5355 5366 Utf8Str strCFGMValueUtf8 = Utf8Str(strExtraDataValue);
Note:
See TracChangeset
for help on using the changeset viewer.