VirtualBox

Changeset 31481 in vbox for trunk


Ignore:
Timestamp:
Aug 9, 2010 12:33:59 PM (14 years ago)
Author:
vboxsync
Message:

Main: use a shared type for string maps

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r31464 r31481  
    9999};
    100100
    101 typedef std::map<com::Utf8Str, com::Utf8Str> PropertiesMap;
     101typedef std::map<com::Utf8Str, com::Utf8Str> StringsMap;
    102102
    103103// ExtraDataItem (used by both VirtualBox.xml and machines XML)
    104 typedef std::map<com::Utf8Str, com::Utf8Str> ExtraDataItemsMap;
    105104struct USBDeviceFilter;
    106105typedef std::list<USBDeviceFilter> USBDeviceFiltersList;
     
    123122    com::Utf8Str    strFormat;
    124123    bool            fAutoReset;         // optional, only for diffs, default is false
    125     PropertiesMap   properties;
     124    StringsMap      properties;
    126125    MediumType_T    hdType;
    127126
     
    168167
    169168    void readExtraData(const xml::ElementNode &elmExtraData,
    170                        ExtraDataItemsMap &map);
     169                       StringsMap &map);
    171170    void readUSBDeviceFilters(const xml::ElementNode &elmDeviceFilters,
    172171                              USBDeviceFiltersList &ll);
     
    178177    void createStubDocument();
    179178
    180     void buildExtraData(xml::ElementNode &elmParent, const ExtraDataItemsMap &me);
     179    void buildExtraData(xml::ElementNode &elmParent, const StringsMap &me);
    181180    void buildUSBDeviceFilters(xml::ElementNode &elmParent,
    182181                               const USBDeviceFiltersList &ll,
     
    257256    MachinesRegistry        llMachines;
    258257    DHCPServersList         llDhcpServers;
    259     ExtraDataItemsMap       mapExtraDataItems;
     258    StringsMap              mapExtraDataItems;
    260259};
    261260
     
    881880    MediaRegistry           mediaRegistry;
    882881
    883     ExtraDataItemsMap       mapExtraDataItems;
     882    StringsMap              mapExtraDataItems;
    884883
    885884    SnapshotsList           llFirstSnapshot;            // first snapshot or empty list if there's none
  • trunk/src/VBox/Main/MachineImpl.cpp

    r31358 r31481  
    37983798    com::SafeArray<BSTR> saKeys(mData->pMachineConfigFile->mapExtraDataItems.size());
    37993799    int i = 0;
    3800     for (settings::ExtraDataItemsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.begin();
     3800    for (settings::StringsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.begin();
    38013801         it != mData->pMachineConfigFile->mapExtraDataItems.end();
    38023802         ++it, ++i)
     
    38273827    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    38283828
    3829     settings::ExtraDataItemsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.find(Utf8Str(aKey));
     3829    settings::StringsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.find(Utf8Str(aKey));
    38303830    if (it != mData->pMachineConfigFile->mapExtraDataItems.end())
    38313831        // found:
     
    38623862    {
    38633863        AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); // hold read lock only while looking up
    3864         settings::ExtraDataItemsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.find(strKey);
     3864        settings::StringsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.find(strKey);
    38653865        if (it != mData->pMachineConfigFile->mapExtraDataItems.end())
    38663866            strOldValue = it->second;
  • trunk/src/VBox/Main/MediumImpl.cpp

    r31480 r31481  
    150150    bool hostDrive : 1;
    151151
    152     settings::PropertiesMap mapProperties;
     152    settings::StringsMap mapProperties;
    153153
    154154    bool implicit : 1;
     
    986986     * compatibility; we can also clean them up from the XML upon next
    987987     * XML format version change if we wish) */
    988     for (settings::PropertiesMap::const_iterator it = data.properties.begin();
     988    for (settings::StringsMap::const_iterator it = data.properties.begin();
    989989         it != data.properties.end();
    990990         ++it)
     
    19621962    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    19631963
    1964     settings::PropertiesMap::const_iterator it = m->mapProperties.find(Utf8Str(aName));
     1964    settings::StringsMap::const_iterator it = m->mapProperties.find(Utf8Str(aName));
    19651965    if (it == m->mapProperties.end())
    19661966        return setError(VBOX_E_OBJECT_NOT_FOUND,
     
    19901990    }
    19911991
    1992     settings::PropertiesMap::iterator it = m->mapProperties.find(Utf8Str(aName));
     1992    settings::StringsMap::iterator it = m->mapProperties.find(Utf8Str(aName));
    19931993    if (it == m->mapProperties.end())
    19941994        return setError(VBOX_E_OBJECT_NOT_FOUND,
     
    20252025    size_t i = 0;
    20262026
    2027     for (settings::PropertiesMap::const_iterator it = m->mapProperties.begin();
     2027    for (settings::StringsMap::const_iterator it = m->mapProperties.begin();
    20282028         it != m->mapProperties.end();
    20292029         ++it)
     
    20692069         ++i)
    20702070    {
    2071         settings::PropertiesMap::iterator it = m->mapProperties.find(Utf8Str(names[i]));
     2071        settings::StringsMap::iterator it = m->mapProperties.find(Utf8Str(names[i]));
    20722072        AssertReturn(it != m->mapProperties.end(), E_FAIL);
    20732073
     
    30203020    /* optional properties */
    30213021    data.properties.clear();
    3022     for (settings::PropertiesMap::const_iterator it = m->mapProperties.begin();
     3022    for (settings::StringsMap::const_iterator it = m->mapProperties.begin();
    30233023         it != m->mapProperties.end();
    30243024         ++it)
     
    50175017    AssertReturn(that != NULL, VERR_GENERAL_FAILURE);
    50185018
    5019     settings::PropertiesMap::const_iterator it = that->m->mapProperties.find(Utf8Str(pszName));
     5019    settings::StringsMap::const_iterator it = that->m->mapProperties.find(Utf8Str(pszName));
    50205020    if (it == that->m->mapProperties.end())
    50215021        return VERR_CFGM_VALUE_NOT_FOUND;
     
    50415041    AssertReturn(that != NULL, VERR_GENERAL_FAILURE);
    50425042
    5043     settings::PropertiesMap::const_iterator it = that->m->mapProperties.find(Utf8Str(pszName));
     5043    settings::StringsMap::const_iterator it = that->m->mapProperties.find(Utf8Str(pszName));
    50445044    if (it == that->m->mapProperties.end())
    50455045        return VERR_CFGM_VALUE_NOT_FOUND;
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r31473 r31481  
    17731773    com::SafeArray<BSTR> saKeys(m->pMainConfigFile->mapExtraDataItems.size());
    17741774    int i = 0;
    1775     for (ExtraDataItemsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.begin();
     1775    for (StringsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.begin();
    17761776         it != m->pMainConfigFile->mapExtraDataItems.end();
    17771777         ++it, ++i)
     
    18011801    Bstr bstrResult;
    18021802
    1803     settings::ExtraDataItemsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.find(strKey);
     1803    settings::StringsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.find(strKey);
    18041804    if (it != m->pMainConfigFile->mapExtraDataItems.end())
    18051805        // found:
     
    18371837    {
    18381838        AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); // hold read lock only while looking up
    1839         settings::ExtraDataItemsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.find(strKey);
     1839        settings::StringsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.find(strKey);
    18401840        if (it != m->pMainConfigFile->mapExtraDataItems.end())
    18411841            strOldValue = it->second;
  • trunk/src/VBox/Main/xml/Settings.cpp

    r31472 r31481  
    477477 */
    478478void ConfigFileBase::readExtraData(const xml::ElementNode &elmExtraData,
    479                                    ExtraDataItemsMap &map)
     479                                   StringsMap &map)
    480480{
    481481    xml::NodesLoop nlLevel4(elmExtraData);
     
    894894 */
    895895void ConfigFileBase::buildExtraData(xml::ElementNode &elmParent,
    896                                     const ExtraDataItemsMap &me)
     896                                    const StringsMap &me)
    897897{
    898898    if (me.size())
    899899    {
    900900        xml::ElementNode *pelmExtraData = elmParent.createChild("ExtraData");
    901         for (ExtraDataItemsMap::const_iterator it = me.begin();
     901        for (StringsMap::const_iterator it = me.begin();
    902902             it != me.end();
    903903             ++it)
     
    992992        pelmHardDisk->setAttribute("Description", mdm.strDescription);
    993993
    994     for (PropertiesMap::const_iterator it = mdm.properties.begin();
     994    for (StringsMap::const_iterator it = mdm.properties.begin();
    995995         it != mdm.properties.end();
    996996         ++it)
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