VirtualBox

Changeset 13950 in vbox


Ignore:
Timestamp:
Nov 7, 2008 11:23:23 AM (16 years ago)
Author:
vboxsync
Message:

Main: Removed redundant suffixes from DataType, DataFlags and HardDiskFormatCapabilities enums + cleanup.

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r13851 r13950  
    28352835                                            ComSafeArrayAsOutParam (propertyDefaults)));
    28362836
    2837             RTPrintf (" config=(");
     2837            RTPrintf (" properties=(");
    28382838            if (propertyNames.size() > 0)
    28392839            {
    28402840                for (size_t a = 0; a < propertyNames.size(); ++ a)
    28412841                {
    2842                     RTPrintf ("key='%ls' desc='%ls' type=", Bstr (propertyNames [a]).raw(), Bstr (propertyDescriptions [a]).raw());
     2842                    RTPrintf ("\n  name='%ls' desc='%ls' type=",
     2843                              Bstr (propertyNames [a]).raw(), Bstr (propertyDescriptions [a]).raw());
    28432844                    switch (propertyTypes [a])
    28442845                    {
    2845                         case DataType_Int32Type: RTPrintf ("int"); break;
    2846                         case DataType_Int8Type: RTPrintf ("byte"); break;
    2847                         case DataType_StringType: RTPrintf ("string"); break;
     2846                        case DataType_Int32: RTPrintf ("int"); break;
     2847                        case DataType_Int8: RTPrintf ("byte"); break;
     2848                        case DataType_String: RTPrintf ("string"); break;
    28482849                    }
    28492850                    RTPrintf (" flags=%#04x", propertyFlags [a]);
    28502851                    RTPrintf (" default='%ls'", Bstr (propertyDefaults [a]).raw());
    28512852                    if (a != propertyNames.size()-1)
    2852                         RTPrintf (",");
     2853                        RTPrintf (", ");
    28532854                }
    28542855            }
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h

    r13601 r13950  
    865865                                bool aRecursive = false);
    866866
    867     static QList< QPair<QString, QString> > HDDBackends();
     867    static QList <QPair <QString, QString> > HDDBackends();
    868868
    869869    /* Qt 4.2.0 support function */
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r13844 r13950  
    46944694
    46954695/**
    4696  * Automatically figure out which hdd backends are currently support by vbox.
     4696 * Figures out which hard disk formats are currently supported by VirtualBox.
    46974697 * Returned is a list of pairs with the form
    4698  * <"Backend Name", "*.suffix1 *.suffix2 ...">.
     4698 *   <tt>{"Backend Name", "*.suffix1 .suffix2 ..."}</tt>.
    46994699 */
    47004700/* static */
    4701 QList< QPair<QString, QString> > VBoxGlobal::HDDBackends()
     4701QList <QPair <QString, QString> > VBoxGlobal::HDDBackends()
    47024702{
    47034703    CSystemProperties systemProperties = vboxGlobal().virtualBox().GetSystemProperties();
  • trunk/src/VBox/Main/HardDiskFormatImpl.cpp

    r13845 r13950  
    8585        while (pa->pszKey != NULL)
    8686        {
    87             Utf8Str defaults ("");
     87            Utf8Str defaultValue ("");
    8888            DataType_T dt;
    8989            /* Check for the configure data type */
     
    9191            {
    9292                case VDCFGVALUETYPE_INTEGER:
     93                {
     94                    dt = DataType_Int32;
     95                    /* If there is a default value get them in the right format */
     96                    if (pa->pDefaultValue)
     97                        defaultValue =
     98                            Utf8StrFmt ("%d", pa->pDefaultValue->Integer.u64);
     99                    break;
     100                }
     101                case VDCFGVALUETYPE_BYTES:
     102                {
     103                    dt = DataType_Int8;
     104                    /* If there is a default value get them in the right format */
     105                    if (pa->pDefaultValue)
    93106                    {
    94                         dt = DataType_Int32Type;
    95                         /* If there is a default value get them in the right format */
    96                         if (pa->pDefaultValue)
    97                             defaults = Utf8StrFmt ("%d", pa->pDefaultValue->Integer.u64);
    98                         break;
     107                        /* Copy the bytes over */
     108                        defaultValue.alloc (pa->pDefaultValue->Bytes.cb + 1);
     109                        memcpy (defaultValue.mutableRaw(), pa->pDefaultValue->Bytes.pv,
     110                                pa->pDefaultValue->Bytes.cb);
     111                        defaultValue.mutableRaw() [defaultValue.length()] = 0;
    99112                    }
    100                 case VDCFGVALUETYPE_BYTES:
    101                     {
    102                         dt = DataType_Int8Type;
    103                         /* If there is a default value get them in the right format */
    104                         if (pa->pDefaultValue)
    105                         {
    106                             /* Copy the bytes over */
    107                             defaults.alloc (pa->pDefaultValue->Bytes.cb + 1);
    108                             memcpy (defaults.mutableRaw(), pa->pDefaultValue->Bytes.pv, pa->pDefaultValue->Bytes.cb);
    109                             defaults.mutableRaw() [defaults.length()] = 0;
    110                         }
    111                         break;
    112                     }
     113                    break;
     114                }
    113115                case VDCFGVALUETYPE_STRING:
    114                     {
    115                         dt = DataType_StringType;
    116                         /* If there is a default value get them in the right format */
    117                         if (pa->pDefaultValue)
    118                             defaults = pa->pDefaultValue->String.psz;
    119                         break;
    120                     }
     116                {
     117                    dt = DataType_String;
     118                    /* If there is a default value get them in the right format */
     119                    if (pa->pDefaultValue)
     120                        defaultValue = pa->pDefaultValue->String.psz;
     121                    break;
     122                }
    121123            }
     124
     125            /// @todo add extendedFlags to Property when we reach the 32 bit
     126            /// limit (or make the argument ULONG64 after checking that COM is
     127            /// capable of defining enums (used to represent bit flags) that
     128            /// contain 64-bit values)
     129            ComAssertRet (pa->uKeyFlags == ((ULONG) pa->uKeyFlags), E_FAIL);
     130
    122131            /* Create one property structure */
    123132            const Property prop = { Utf8Str (pa->pszKey),
    124133                                    Utf8Str (""),
    125134                                    dt,
    126                                     static_cast<unsigned int> (pa->uKeyFlags),
    127                                     defaults };
     135                                    static_cast <ULONG> (pa->uKeyFlags),
     136                                    defaultValue };
    128137            unconst (mData.properties).push_back (prop);
    129138            ++ pa;
     
    251260    com::SafeArray <ULONG> propertyFlags (mData.properties.size());
    252261    com::SafeArray <BSTR> propertyDefaults (mData.properties.size());
     262
    253263    int i = 0;
    254264    for (PropertyList::const_iterator it = mData.properties.begin();
     
    260270        propertyTypes [i] = prop.type;
    261271        propertyFlags [i] = prop.flags;
    262         prop.defaults.cloneTo (&propertyDefaults [i]);
     272        prop.defaultValue.cloneTo (&propertyDefaults [i]);
    263273    }
     274
    264275    propertyNames.detachTo (ComSafeArrayOutArg (aNames));
    265276    propertyDescriptions.detachTo (ComSafeArrayOutArg (aDescriptions));
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r13844 r13950  
    794794        <li><link to="DeviceType::HardDisk"/>: the media is a hard disk
    795795        that, if registered, can be obtained using the
    796         <link to="IVirtualBox::getHardDisk"/> call.</li>
     796        <link to="IVirtualBox::getHardDisk2()"/> call.</li>
    797797        <li><link to="DeviceType::DVD"/>: the media is a CD/DVD image
    798798        that, if registered, can be obtained using the
    799         <link to="IVirtualBox::getDVDImage"/> call.</li>
     799        <link to="IVirtualBox::getDVDImage()"/> call.</li>
    800800        <li><link to="DeviceType::Floppy"/>: the media is a Floppy image
    801801        that, if registered, can be obtained using the
    802         <link to="IVirtualBox::getFloppyImage"/> call.</li>
     802        <link to="IVirtualBox::getFloppyImage()"/> call.</li>
    803803        </ul>
    804804
     
    947947
    948948      To enumerate all the virtual machines on the host, use the
    949       <link to="IVirtualBox::machines"/> attribute.
     949      <link to="IVirtualBox::machines2"/> attribute.
    950950    </desc>
    951951
     
    13761376        </ul>
    13771377
    1378         Some hard disk attributes, such as <link to="id"/>, may remain
     1378        Some hard disk attributes, such as <link to="#id"/>, may remain
    13791379        uninitialized until the hard disk storage unit is successfully created
    13801380        by one of the above methods.
     
    13821382        After the storage unit is successfully created, the hard disk gets
    13831383        remembered by this VirtualBox installation and will be accessible
    1384         trhough <link to="#getHardDisk2"/> and <link to="#findHardDisk2"/>
     1384        trhough <link to="#getHardDisk2()"/> and <link to="#findHardDisk2()"/>
    13851385        methods. Remembered root (base) hard disks are also returned as part of
    13861386        the <link to="#hardDisks2"/> array. See IHardDisk2 for more details.
     
    15521552
    15531553        The search is done by comparing the value of the @a location argument to
    1554         the <link to="IMedia::location"/> attribute of each known CD/DVD image.
     1554        the <link to="IMedium::location"/> attribute of each known CD/DVD image.
    15551555
    15561556        The requested location can be a path relative to the
     
    15791579        accessible trhough <link to="#getFloppyImage()"/> and
    15801580        <link to="#findFloppyImage()"/> methods. Remembered images are also
    1581         returned as part of the <link to="#FloppyImages"/> array and can be
     1581        returned as part of the <link to="#floppyImages"/> array and can be
    15821582        mounted to virtual machines. See IMedium for more details.
    15831583
     
    16311631
    16321632        The search is done by comparing the value of the @a location argument to
    1633         the <link to="IMedia::location"/> attribute of each known floppy image.
     1633        the <link to="IMedium::location"/> attribute of each known floppy image.
    16341634
    16351635        The requested location can be a path relative to the
     
    25452545      This interface is used in two contexts. First of all, a collection of
    25462546      objects implementing this interface is stored in the
    2547       <link to="IVirtualBox::machines"/> attribute which lists all the virtual
     2547      <link to="IVirtualBox::machines2"/> attribute which lists all the virtual
    25482548      machines that are currently registered with this VirtualBox
    25492549      installation. Also, once a session has been opened for the given virtual
     
    25552555      machine and provide methods to change various aspects of the virtual
    25562556      machine's configuration. For machine objects stored in the
    2557       <link to="IVirtualBox::machines"/> collection, all attributes are
     2557      <link to="IVirtualBox::machines2"/> collection, all attributes are
    25582558      read-only unless explicitly stated otherwise in individual attribute
    25592559      and method descriptions. In order to change a machine setting, a session
     
    46884688        <note>
    46894689          Child hard disks of all normal hard disks of the discarded snapshot
    4690           must be <link to="IHardDisk::accessible">accessible</link> for this
     4690          must be accessible (see <link to="IMedium::state"/>) for this
    46914691          operation to succeed.  In particular, this means that all virtual
    46924692          machines, whose hard disks are directly or indirectly based on the
     
    58355835      Snapshots can be chained. Chained snapshots form a branch where
    58365836      every next snapshot is based on the previous one. This chaining is
    5837       mostly related to hard disk branching (see <link to="IHardDisk"/>
     5837      mostly related to hard disk branching (see <link to="IHardDisk2"/>
    58385838      description). This means that every time a new snapshot is created,
    58395839      a new differencing hard disk is implicitly created for all normal
     
    64566456        its methods or attributes will fail with the <tt>"Object not ready"
    64576457        (E_ACCESSDENIED)</tt> error.
    6458 
    6459         <see>#deleteStorage()</see>
    64606458      </desc>
    64616459    </method>
     
    65116509
    65126510      The array of hard disk attachments is returned by
    6513       <link to="IMachine::hardDiskAttachments"/>.
     6511      <link to="IMachine::hardDisk2Attachments"/>.
    65146512
    65156513      <note>
     
    66066604      <ul>
    66076605        <li><link to="#deleteStorage()"/></li>
    6608         <li><link to="#mergeToParent()"/></li>
    6609         <li><link to="#mergeToAncestor()"/></li>
     6606        <li><link to="#mergeTo()"/></li>
    66106607      </ul>
    66116608
     
    72087205    uuid="d90ea51e-a3f1-4a01-beb1-c1723c0d3ba7"
    72097206  >
    7210     <const name="Int32Type" value="0"/>
    7211     <const name="Int8Type" value="1"/>
    7212     <const name="StringType" value="2"/>
     7207    <const name="Int32" value="0"/>
     7208    <const name="Int8" value="1"/>
     7209    <const name="String" value="2"/>
    72137210  </enum>
    72147211
     
    72177214    uuid="86884dcf-1d6b-4f1b-b4bf-f5aa44959d60"
    72187215  >
    7219     <const name="NoneFlag" value="0x00"/>
    7220     <const name="MandatoryFlag" value="0x01"/>
    7221     <const name="ExpertFlag" value="0x02"/>
     7216    <const name="None" value="0x00"/>
     7217    <const name="Mandatory" value="0x01"/>
     7218    <const name="Expert" value="0x02"/>
    72227219    <const name="FlagMask" value="0x03"/>
    72237220  </enum>
     
    72287225  >
    72297226    <desc>
    7230        Harddisk format capability flags.
     7227       Hard disk format capability flags.
    72317228    </desc>
    72327229
    7233     <const name="UuidCapability" value="0x01">
     7230    <const name="Uuid" value="0x01">
    72347231      <desc>
    72357232        Supports UUIDs as expected by VirtualBox code.
     
    72377234    </const>
    72387235
    7239     <const name="CreateFixedCapability" value="0x02">
     7236    <const name="CreateFixed" value="0x02">
    72407237      <desc>
    72417238        Supports creating fixed size images, allocating all space instantly.
     
    72437240    </const>
    72447241
    7245     <const name="CreateDynamicCapability" value="0x04">
     7242    <const name="CreateDynamic" value="0x04">
    72467243      <desc>
    72477244        Supports creating dynamically growing images, allocating space on
     
    72507247    </const>
    72517248
    7252     <const name="CreateSplit2GCapability" value="0x08">
    7253       <desc>
    7254         Supports creating images split in chunks of a bit less than 2GBytes.
     7249    <const name="CreateSplit2G" value="0x08">
     7250      <desc>
     7251        Supports creating images split in chunks of a bit less than 2 GBytes.
    72557252      </desc>
    72567253    </const>
    72577254
    7258     <const name="DiffCapability" value="0x10">
    7259       <desc>
    7260         Supports being used as differencing image format backend.
     7255    <const name="Differencing" value="0x10">
     7256      <desc>
     7257        Supports being used as a format for differencing hard disks (see <link
     7258        to="IHardDisk2::createDiffStorage"/>).
    72617259      </desc>
    72627260    </const>
    72637261
    7264     <const name="ASyncCapability" value="0x20">
     7262    <const name="Asynchronous" value="0x20">
    72657263      <desc>
    72667264        Supports asynchronous I/O operations for at least some configurations.
     
    72687266    </const>
    72697267
    7270     <const name="FileCapability" value="0x40">
    7271       <desc>
    7272         The backend operates on files. The caller needs to know to handle the
    7273         location appropriately. For a list of supported file extentions see
     7268    <const name="File" value="0x40">
     7269      <desc>
     7270        The format backend operates on files. The <link to="IMedium::location"/>
     7271        attribute of the hard disk specifies a file used to store hard disk
     7272        data. For a list of supported file extentions see
    72747273        <link to="IHardDiskFormat::fileExtensions"/>.
    72757274      </desc>
    72767275    </const>
    72777276
    7278     <const name="ConfigCapability" value="0x80">
    7279       <desc>
    7280         The backend uses the config interface. The caller needs to know how to
    7281         provide the mandatory configuration parts this way.
    7282 
    7283         <see>IHardDiskFormat::describeProperties</see>
     7277    <const name="Properties" value="0x80">
     7278      <desc>
     7279        The format backend uses the property interface to configure the storage
     7280        location and properties. The <link to="IHardDiskFormat::describeProperties"/>
     7281        method is used to get access to poperties supported by the given hard
     7282        disk format.
    72847283      </desc>
    72857284    </const>
     
    73467345    <attribute name="capabilities" type="unsigned long" readonly="yes">
    73477346      <desc>
    7348         The capabilities of the backend as a bitmask.
    7349        
    7350         For the meaning of the different capabilities see
     7347        Capabilities of the format as a set of bit flags.
     7348
     7349        For the meaning of individual capabilitiy flags see
    73517350        <link to="HardDiskFormatCapabilities"/>.
    73527351      </desc>
     
    73557354    <method name="describeProperties">
    73567355      <desc>
    7357         Return several lists for the configuration description of this backend.
    7358 
    7359         This is non empty only if HardDiskFormatCapabilities::ConfigCapability
    7360         is set.
     7356        Returns several arrays describing the properties supported by this
     7357        format.
     7358
     7359        An element with the given index in each array describes one
     7360        property. Thus, the number of elements in each returned array is the
     7361        same and corresponds to the number of supported properties.
     7362
     7363        The returned arrays are not empty only if the
     7364        <link to="HardDiskFormatCapabilities::Properties"/> flag is set.
     7365
    73617366        <see>DataType</see>
    73627367        <see>DataFlags</see>
    73637368      </desc>
    73647369
    7365       <param name="names" type="wstring" safearray="yes" dir="out"/>
    7366       <param name="description" type="wstring" safearray="yes" dir="out"/>
    7367       <param name="types" type="unsigned long" safearray="yes" dir="out"/>
    7368       <param name="flags" type="unsigned long" safearray="yes" dir="out"/>
    7369       <param name="defaults" type="wstring" safearray="yes" dir="out"/>
     7370      <param name="names" type="wstring" safearray="yes" dir="out">
     7371        <desc>Array of property names.</desc>
     7372      </param>
     7373      <param name="description" type="wstring" safearray="yes" dir="out">
     7374        <desc>Array of property descriptions.</desc>
     7375      </param>
     7376      <param name="types" type="unsigned long" safearray="yes" dir="out">
     7377        <desc>Array of property types.</desc>
     7378      </param>
     7379      <param name="flags" type="unsigned long" safearray="yes" dir="out">
     7380        <desc>Array of property flags.</desc>
     7381      </param>
     7382      <param name="defaults" type="wstring" safearray="yes" dir="out">
     7383        <desc>Array of default property values.</desc>
     7384      </param>
    73707385    </method>
    73717386
  • trunk/src/VBox/Main/include/HardDiskFormatImpl.h

    r13844 r13950  
    9494        DataType_T type;
    9595        ULONG flags;
    96         Bstr defaults;
     96        Bstr defaultValue;
    9797    };
    9898    typedef std::list <Property> PropertyList;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette