DiskDevice API v2.0
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3374 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,77 +6,28 @@
|
||||
#ifndef _DISK_DEVICE_H
|
||||
#define _DISK_DEVICE_H
|
||||
|
||||
#include <DiskDeviceVisitor.h>
|
||||
#include <ObjectList.h>
|
||||
|
||||
class BPartition;
|
||||
class BSession;
|
||||
|
||||
class BDiskDevice {
|
||||
class BDiskDevice : public BPartition {
|
||||
public:
|
||||
BDiskDevice();
|
||||
~BDiskDevice();
|
||||
void Unset(); // What is this for?
|
||||
|
||||
char* DeviceType() const;
|
||||
virtual char* Path() const;
|
||||
|
||||
void Unset();
|
||||
|
||||
off_t Size() const;
|
||||
int32 BlockSize() const;
|
||||
|
||||
int32 CountSessions() const;
|
||||
BSession *SessionAt(int32 index) const;
|
||||
|
||||
int32 CountPartitions() const;
|
||||
|
||||
const char *Path() const;
|
||||
status_t GetName(BString *name, bool includeBusID = true,
|
||||
bool includeLUN = false) const;
|
||||
status_t GetName(char *name, bool includeBusID = true,
|
||||
bool includeLUN = false) const;
|
||||
|
||||
bool IsReadOnly() const;
|
||||
bool IsRemovable() const;
|
||||
bool HasMedia() const;
|
||||
bool IsFloppy() const;
|
||||
uint8 Type() const;
|
||||
|
||||
int32 UniqueID() const;
|
||||
|
||||
status_t Eject(bool update = false);
|
||||
status_t LowLevelFormat(); // TODO: remove?
|
||||
|
||||
status_t Update(bool *updated = NULL);
|
||||
|
||||
BSession *VisitEachSession(BDiskDeviceVisitor *visitor);
|
||||
BPartition *VisitEachPartition(BDiskDeviceVisitor *visitor);
|
||||
bool Traverse(BDiskDeviceVisitor *visitor);
|
||||
|
||||
BSession *SessionWithID(int32 id);
|
||||
BPartition *PartitionWithID(int32 id);
|
||||
|
||||
private:
|
||||
BDiskDevice(const BDiskDevice &);
|
||||
BDiskDevice &operator=(const BDiskDevice &);
|
||||
|
||||
status_t _Unarchive(BMessage *archive);
|
||||
status_t _Update(BMessage *archive);
|
||||
|
||||
bool _AddSession(BSession *session);
|
||||
|
||||
private:
|
||||
friend class BDiskDeviceList;
|
||||
friend class BDiskDeviceRoster;
|
||||
|
||||
BObjectList<BSession> fSessions;
|
||||
int32 fUniqueID;
|
||||
int32 fChangeCounter;
|
||||
status_t fMediaStatus;
|
||||
off_t fSize;
|
||||
int32 fBlockSize;
|
||||
uint8 fType;
|
||||
bool fReadOnly;
|
||||
bool fRemovable;
|
||||
// bool fIsFloppy;
|
||||
char fPath[B_FILE_NAME_LENGTH];
|
||||
};
|
||||
char fDeviceType[B_FILE_NAME_LENGTH];
|
||||
char fPath[B_FILE_NAME_LENGTH];
|
||||
|
||||
bool fIsRemovable;
|
||||
status_t fMediaStatus;
|
||||
}
|
||||
|
||||
#endif // _DISK_DEVICE_H
|
||||
|
||||
Reference in New Issue
Block a user