Changeset 10147 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Jul 3, 2008 9:26:28 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 32673
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r10002 r10147 7497 7497 if (machine) 7498 7498 { 7499 #if 0 7500 /* enumeration? */ 7501 if (strcmp(argv[1], "enumerate") == 0) 7502 { 7503 Bstr extraDataKey; 7504 7505 do 7506 { 7507 Bstr nextExtraDataKey; 7508 Bstr nextExtraDataValue; 7509 HRESULT rcEnum = machine->GetNextExtraDataKey(extraDataKey, nextExtraDataKey.asOutParam(), 7510 nextExtraDataValue.asOutParam()); 7511 extraDataKey = nextExtraDataKey; 7512 7513 if (SUCCEEDED(rcEnum) && extraDataKey) 7514 { 7515 RTPrintf("Key: %lS, Value: %lS\n", nextExtraDataKey.raw(), nextExtraDataValue.raw()); 7516 } 7517 } while (extraDataKey); 7518 } 7519 else 7520 #endif /* 0 */ 7499 char *pszKey = NULL; 7500 int rrc = RTStrCurrentCPToUtf8(&pszKey, argv[1]); 7501 if (RT_SUCCESS(rrc)) 7521 7502 { 7522 7503 Bstr value; 7523 CHECK_ERROR(machine, GetGuestProperty(Bstr( argv[1]), value.asOutParam()));7504 CHECK_ERROR(machine, GetGuestProperty(Bstr(pszKey), value.asOutParam())); 7524 7505 if (value) 7525 7506 RTPrintf("Value: %lS\n", value.raw()); 7526 7507 else 7527 7508 RTPrintf("No value set!\n"); 7528 } 7509 RTStrFree(pszKey); 7510 } 7511 else 7512 rc = E_INVALIDARG; 7529 7513 } 7530 7514 return SUCCEEDED(rc) ? 0 : 1; … … 7550 7534 if (machine) 7551 7535 { 7552 if (argc < 3) 7553 CHECK_ERROR(machine, SetGuestProperty(Bstr(argv[1]), NULL)); 7554 else if (argc == 3) 7555 CHECK_ERROR(machine, SetGuestProperty(Bstr(argv[1]), Bstr(argv[2]))); 7536 char *pszKey = NULL; 7537 int rrc = RTStrCurrentCPToUtf8(&pszKey, argv[1]); 7538 if (RT_SUCCESS(rrc)) 7539 { 7540 if (argc < 3) 7541 CHECK_ERROR(machine, SetGuestProperty(Bstr(argv[1]), NULL)); 7542 else if (argc == 3) 7543 { 7544 char *pszValue = NULL; 7545 rrc = RTStrCurrentCPToUtf8(&pszKey, argv[1]); 7546 if (RT_SUCCESS(rrc)) 7547 CHECK_ERROR(machine, SetGuestProperty(Bstr(argv[1]), Bstr(argv[2]))); 7548 else 7549 rc = E_INVALIDARG; 7550 RTStrFree(pszValue); 7551 } 7552 else 7553 return errorSyntax(USAGE_SETGUESTPROPERTY, "Too many parameters"); 7554 RTStrFree(pszKey); 7555 } 7556 7556 else 7557 r eturn errorSyntax(USAGE_SETGUESTPROPERTY, "Too many parameters");7557 rc = E_INVALIDARG; 7558 7558 } 7559 7559 return SUCCEEDED(rc) ? 0 : 1;
Note:
See TracChangeset
for help on using the changeset viewer.