haiku/headers/private/storage/DiskDevice.h
Ingo Weinhold d713d1d973 The beginning of the DiskDevice API.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-31 21:17:20 +00:00

65 lines
1.4 KiB
C++

// DiskDevice.h
#ifndef _DISK_DEVICE_H
#define _DISK_DEVICE_H
#include <DiskDeviceVisitor.h>
#include <ObjectList.h>
class BPartition;
class BSession;
class BDiskDevice {
public:
BDiskDevice();
~BDiskDevice();
int32 CountSessions() const;
BSession *SessionAt(int32 index) const;
int32 CountPartitions() const;
int32 BlockSize() const;
const char *DevicePath() const;
void GetName(BString *name, bool includeBusID = true,
bool includeLUN = false) const;
void 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; // cf. device_geometry::device_type
int32 UniqueID() const;
status_t Eject();
status_t LowLevelFormat(); // TODO: remove?
status_t Update(); // sync this object with reality
BSession *VisitEachSession(BDiskDeviceVisitor *visitor);
// return BSession* if terminated early
BPartition *VisitEachPartition(BDiskDeviceVisitor *visitor);
// return BPartition* if terminated early
bool Traverse(BDiskDeviceVisitor *visitor);
// return true if terminated early
private:
BDiskDevice(const BDiskDevice &);
BDiskDevice &operator=(const BDiskDevice &);
private:
BObjectList<Session *> fSessions;
int32 fUniqueID;
int32 fBlockSize;
char fPath[B_FILE_NAME_LENGTH];
bool fReadOnly;
bool fRemovable;
bool fIsFloppy;
};
#endif // _DISK_DEVICE_H