Changeset 2929 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- May 30, 2007 1:31:16 PM (18 years ago)
- Location:
- trunk/src/VBox/Main/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/HostDVDDriveImpl.h
r2917 r2929 27 27 28 28 class ATL_NO_VTABLE HostDVDDrive : 29 public VirtualBoxBaseNEXT, 29 30 public VirtualBoxSupportErrorInfoImpl <HostDVDDrive, IHostDVDDrive>, 30 31 public VirtualBoxSupportTranslation <HostDVDDrive>, 31 public VirtualBoxBase,32 32 public IHostDVDDrive 33 33 { 34 34 public: 35 35 36 HostDVDDrive(); 37 virtual ~HostDVDDrive(); 36 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (HostDVDDrive) 38 37 39 DECLARE_NOT_AGGREGATABLE (HostDVDDrive)38 DECLARE_NOT_AGGREGATABLE (HostDVDDrive) 40 39 41 40 DECLARE_PROTECT_FINAL_CONSTRUCT() … … 48 47 NS_DECL_ISUPPORTS 49 48 49 DECLARE_EMPTY_CTOR_DTOR (HostDVDDrive) 50 51 HRESULT FinalConstruct(); 52 void FinalRelease(); 53 50 54 // public initializer/uninitializer for internal purposes only 51 HRESULT init (INPTR BSTR driveName);52 HRESULT init (INPTR BSTR driveName, INPTR BSTR driveDescription);55 HRESULT init (INPTR BSTR aName, INPTR BSTR aDescription = NULL); 56 void uninit(); 53 57 54 58 // IHostDVDDrive properties 55 STDMETHOD(COMGETTER(Name)) (BSTR * driveName);56 STDMETHOD(COMGETTER(Description)) (BSTR * driveDescription);59 STDMETHOD(COMGETTER(Name)) (BSTR *aName); 60 STDMETHOD(COMGETTER(Description)) (BSTR *aDescription); 57 61 58 62 // public methods for internal purposes only 59 63 60 const Bstr &driveName() const { return mDriveName; } 64 /* @note Must be called from under the object read lock. */ 65 const Bstr &name() const { return mName; } 61 66 62 67 // for VirtualBoxSupportErrorInfoImpl … … 65 70 private: 66 71 67 Bstr mDriveName;68 Bstr mDriveDescription;72 const Bstr mName; 73 const Bstr mDescription; 69 74 }; 70 75 71 76 COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (HostDVDDrive) 72 77 73 STDMETHOD(FindByName) (INPTR BSTR name, IHostDVDDrive **drive)78 STDMETHOD(FindByName) (INPTR BSTR aName, IHostDVDDrive **aDrive) 74 79 { 75 if (! name)80 if (!aName) 76 81 return E_INVALIDARG; 77 if (! drive)82 if (!aDrive) 78 83 return E_POINTER; 79 84 80 * drive = NULL;85 *aDrive = NULL; 81 86 Vector::value_type found; 82 87 Vector::iterator it = vec.begin(); … … 85 90 Bstr n; 86 91 (*it)->COMGETTER(Name) (n.asOutParam()); 87 if (n == name)92 if (n == aName) 88 93 found = *it; 89 94 ++ it; … … 92 97 if (!found) 93 98 return setError (E_INVALIDARG, HostDVDDriveCollection::tr ( 94 "The host DVD drive named '%ls' could not be found"), name);99 "The host DVD drive named '%ls' could not be found"), aName); 95 100 96 return found.queryInterfaceTo ( drive);101 return found.queryInterfaceTo (aDrive); 97 102 } 98 103 -
trunk/src/VBox/Main/include/HostFloppyDriveImpl.h
r1 r2929 27 27 28 28 class ATL_NO_VTABLE HostFloppyDrive : 29 public VirtualBoxBaseNEXT, 29 30 public VirtualBoxSupportErrorInfoImpl <HostFloppyDrive, IHostFloppyDrive>, 30 31 public VirtualBoxSupportTranslation <HostFloppyDrive>, 31 public VirtualBoxBase,32 32 public IHostFloppyDrive 33 33 { 34 34 public: 35 35 36 HostFloppyDrive(); 37 virtual ~HostFloppyDrive(); 36 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (HostFloppyDrive) 38 37 39 DECLARE_NOT_AGGREGATABLE (HostFloppyDrive)38 DECLARE_NOT_AGGREGATABLE (HostFloppyDrive) 40 39 41 40 DECLARE_PROTECT_FINAL_CONSTRUCT() … … 48 47 NS_DECL_ISUPPORTS 49 48 49 DECLARE_EMPTY_CTOR_DTOR (HostFloppyDrive) 50 51 HRESULT FinalConstruct(); 52 void FinalRelease(); 53 50 54 // public initializer/uninitializer for internal purposes only 51 HRESULT init (INPTR BSTR driveName); 55 HRESULT init (INPTR BSTR aName); 56 void uninit(); 52 57 53 58 // IHostDVDDrive properties 54 STDMETHOD(COMGETTER(Name)) (BSTR * driveName);59 STDMETHOD(COMGETTER(Name)) (BSTR *aName); 55 60 56 61 // public methods for internal purposes only 57 62 58 const Bstr &driveName() const { return mDriveName; } 63 /* @note Must be called from under the object read lock. */ 64 const Bstr &name() const { return mName; } 59 65 60 66 // for VirtualBoxSupportErrorInfoImpl … … 63 69 private: 64 70 65 Bstr mDriveName;71 const Bstr mName; 66 72 }; 67 73 68 74 COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (HostFloppyDrive) 69 75 70 STDMETHOD(FindByName) (INPTR BSTR name, IHostFloppyDrive **drive)76 STDMETHOD(FindByName) (INPTR BSTR aName, IHostFloppyDrive **aDrive) 71 77 { 72 if (! name)78 if (!aName) 73 79 return E_INVALIDARG; 74 if (! drive)80 if (!aDrive) 75 81 return E_POINTER; 76 82 77 * drive = NULL;83 *aDrive = NULL; 78 84 Vector::value_type found; 79 85 Vector::iterator it = vec.begin(); … … 82 88 Bstr n; 83 89 (*it)->COMGETTER(Name) (n.asOutParam()); 84 if (n == name)90 if (n == aName) 85 91 found = *it; 86 92 ++ it; … … 89 95 if (!found) 90 96 return setError (E_INVALIDARG, HostFloppyDriveCollection::tr ( 91 "The host floppy drive named '%ls' could not be found"), name);97 "The host floppy drive named '%ls' could not be found"), aName); 92 98 93 return found.queryInterfaceTo ( drive);99 return found.queryInterfaceTo (aDrive); 94 100 } 95 101
Note:
See TracChangeset
for help on using the changeset viewer.