diff --git a/headers/private/storage/DiskDevice.h b/headers/private/storage/DiskDevice.h index 0ccc5dba9d..0b5f3b022d 100644 --- a/headers/private/storage/DiskDevice.h +++ b/headers/private/storage/DiskDevice.h @@ -15,8 +15,10 @@ public: BDiskDevice(); virtual ~BDiskDevice(); - bool IsRemovable() const; bool HasMedia() const; + bool IsRemovableMedia() const; + bool IsReadOnlyMedia() const; + bool IsWriteOnceMedia() const; status_t Eject(bool update = false); diff --git a/src/kits/storage/DiskDevice.cpp b/src/kits/storage/DiskDevice.cpp index 89530ece44..6f97f692e1 100644 --- a/src/kits/storage/DiskDevice.cpp +++ b/src/kits/storage/DiskDevice.cpp @@ -41,17 +41,6 @@ BDiskDevice::~BDiskDevice() { } -// IsRemovable -/*! \brief Returns whether the device media are removable. - \return \c true, if the device media are removable, \c false otherwise. -*/ -bool -BDiskDevice::IsRemovable() const -{ - return (fDeviceData - && fDeviceData->device_flags & B_DISK_DEVICE_REMOVABLE); -} - // HasMedia /*! \brief Returns whether the device contains a media. \return \c true, if the device contains a media, \c false otherwise. @@ -63,6 +52,33 @@ BDiskDevice::HasMedia() const && fDeviceData->device_flags & B_DISK_DEVICE_HAS_MEDIA); } +// IsRemovableMedia +/*! \brief Returns whether the device media are removable. + \return \c true, if the device media are removable, \c false otherwise. +*/ +bool +BDiskDevice::IsRemovableMedia() const +{ + return (fDeviceData + && fDeviceData->device_flags & B_DISK_DEVICE_REMOVABLE); +} + +// IsReadOnlyMedia +bool +BDiskDevice::IsReadOnlyMedia() const +{ + return (fDeviceData + && fDeviceData->device_flags & B_DISK_DEVICE_READ_ONLY); +} + +// IsWriteOnceMedia +bool +BDiskDevice::IsWriteOnceMedia() const +{ + return (fDeviceData + && fDeviceData->device_flags & B_DISK_DEVICE_WRITE_ONCE); +} + // Eject /*! \brief Eject the device's media.