VirtualBox

Ignore:
Timestamp:
Jul 9, 2009 12:24:28 PM (15 years ago)
Author:
vboxsync
Message:

Main: make HostHardwareLinux use MiniString instead of std::string; add exception handling to HostImpl bits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/HostHardwareLinux.h

    r21394 r21436  
    2626
    2727#include <iprt/err.h>
    28 #include <string>
     28#include <iprt/ministring_cpp.h>
    2929#include <vector>
    3030
     
    4848    {
    4949        /** The device node of the drive. */
    50         std::string mDevice;
     50        iprt::MiniString mDevice;
    5151        /** The hal unique device identifier, if available. */
    52         std::string mUdi;
     52        iprt::MiniString mUdi;
    5353        /** A textual description of the drive. */
    54         std::string mDescription;
     54        iprt::MiniString mDescription;
    5555
    5656        /** Constructors */
    57         DriveInfo (std::string aDevice, std::string aUdi, std::string aDescription)
    58             : mDevice (aDevice), mUdi (aUdi), mDescription (aDescription) {}
    59         DriveInfo (std::string aDevice, std::string aUdi,
    60                    const char *aDescription = NULL)
    61             : mDevice (aDevice), mUdi (aUdi),
    62             mDescription (aDescription != NULL ? aDescription : std::string ()) {}
    63         DriveInfo (std::string aDevice, const char *aUdi = NULL,
    64                    const char *aDescription = NULL)
    65             : mDevice (aDevice), mUdi (aUdi != NULL ? aUdi : std::string ()),
    66             mDescription (aDescription != NULL ? aDescription : std::string ()) {}
     57        DriveInfo(const iprt::MiniString &aDevice,
     58                  const iprt::MiniString &aUdi = "",
     59                  const iprt::MiniString &aDescription = "")
     60            : mDevice(aDevice),
     61              mUdi(aUdi),
     62              mDescription(aDescription)
     63        { }
    6764    };
    68    
     65
    6966    /** List (resp vector) holding drive information */
    70     typedef std::vector <DriveInfo> DriveInfoList;
     67    typedef std::vector<DriveInfo> DriveInfoList;
    7168
    7269    /**
     
    7572     * @returns iprt status code
    7673     */
    77     int updateFloppies ();
     74    int updateFloppies();
    7875
    7976    /**
     
    8279     * @returns iprt status code
    8380     */
    84     int updateDVDs ();
     81    int updateDVDs();
    8582
    8683    /** Get the first element in the list of floppy drives. */
     
    131128    {
    132129        /** The device node of the device. */
    133         std::string mDevice;
     130        iprt::MiniString mDevice;
    134131        /** The sysfs path of the device. */
    135         std::string mSysfsPath;
     132        iprt::MiniString mSysfsPath;
    136133        /** Type for the list of interfaces. */
    137         typedef std::vector <std::string> InterfaceList;
     134        typedef std::vector<iprt::MiniString> InterfaceList;
    138135        /** The sysfs paths of the device's interfaces. */
    139136        InterfaceList mInterfaces;
    140137
    141138        /** Constructors */
    142         USBDeviceInfo (std::string aDevice, std::string aSysfsPath)
    143             : mDevice (aDevice), mSysfsPath (aSysfsPath) {}
    144         USBDeviceInfo () {}
     139        USBDeviceInfo(const iprt::MiniString &aDevice,
     140                      const iprt::MiniString &aSysfsPath)
     141            : mDevice(aDevice),
     142              mSysfsPath(aSysfsPath)
     143        { }
    145144    };
    146    
     145
    147146    /** List (resp vector) holding drive information */
    148     typedef std::vector <USBDeviceInfo> DeviceInfoList;
     147    typedef std::vector<USBDeviceInfo> DeviceInfoList;
    149148
    150149    /**
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