Changeset 90274 in vbox
- Timestamp:
- Jul 21, 2021 1:43:05 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145813
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloudMachine.cpp
r90269 r90274 638 638 { 639 639 RTStrmPrintf(g_pStdErr, 640 "%ls: unable to obtainboolean value\n", bstrLabel.raw());640 "%ls: unable to convert to boolean value\n", bstrLabel.raw()); 641 641 break; 642 642 } … … 663 663 { 664 664 RTStrmPrintf(g_pStdErr, 665 "%ls: unable to obtainstring value\n", bstrLabel.raw());665 "%ls: unable to convert to string value\n", bstrLabel.raw()); 666 666 break; 667 667 } … … 698 698 699 699 case FormValueType_RangedInteger: 700 RTStrmPrintf(g_pStdOut, "integer\n"); 700 { 701 ComPtr<IRangedIntegerFormValue> pIntValue; 702 hrc = pValue.queryInterfaceTo(pIntValue.asOutParam()); 703 if (FAILED(hrc)) 704 { 705 RTStrmPrintf(g_pStdErr, 706 "%ls: unable to convert to integer value\n", bstrLabel.raw()); 707 break; 708 } 709 710 LONG lValue; 711 hrc = pIntValue->GetInteger(&lValue); 712 if (FAILED(hrc)) 713 { 714 RTStrmPrintf(g_pStdOut, 715 "%ls: %Rhra", bstrLabel.raw(), hrc); 716 break; 717 } 718 719 RTPrintf("%ls: %RI64\n", 720 bstrLabel.raw(), (int64_t)lValue); 701 721 break; 722 } 702 723 703 724 case FormValueType_Choice: 704 RTStrmPrintf(g_pStdOut, "choice\n"); 725 { 726 ComPtr<IChoiceFormValue> pChoiceValue; 727 hrc = pValue.queryInterfaceTo(pChoiceValue.asOutParam()); 728 if (FAILED(hrc)) 729 { 730 RTStrmPrintf(g_pStdErr, 731 "%ls: unable to convert to choice value\n", bstrLabel.raw()); 732 break; 733 } 734 735 com::SafeArray<BSTR> aValues; 736 hrc = pChoiceValue->COMGETTER(Values)(ComSafeArrayAsOutParam(aValues)); 737 if (FAILED(hrc)) 738 { 739 RTStrmPrintf(g_pStdOut, 740 "%ls: values: %Rhra", bstrLabel.raw(), hrc); 741 break; 742 } 743 744 LONG idxSelected = -1; 745 hrc = pChoiceValue->GetSelectedIndex(&idxSelected); 746 if (FAILED(hrc)) 747 { 748 RTStrmPrintf(g_pStdOut, 749 "%ls: selectedIndex: %Rhra", bstrLabel.raw(), hrc); 750 break; 751 } 752 753 if (idxSelected < 0 || (size_t)idxSelected > aValues.size()) 754 { 755 RTStrmPrintf(g_pStdOut, 756 "%ls: selected index %RI64 out of range [0, %zu)\n", 757 bstrLabel.raw(), (int64_t)idxSelected, aValues.size()); 758 break; 759 } 760 761 RTPrintf("%ls: %ls\n", 762 bstrLabel.raw(), aValues[idxSelected]); 705 763 break; 764 } 706 765 707 766 default: 767 { 708 768 RTStrmPrintf(g_pStdOut, "unknown value type %RU32\n", enmType); 709 769 break; 770 } 710 771 } 711 772
Note:
See TracChangeset
for help on using the changeset viewer.