Files
haiku-beta6/headers/private/storage/DiskDevice.h
T

78 lines
1.7 KiB
C++
Raw Normal View History

2003-01-31 22:05:09 +00:00
//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
//---------------------------------------------------------------------
2003-01-31 21:17:20 +00:00
#ifndef _DISK_DEVICE_H
#define _DISK_DEVICE_H
#include <DiskDeviceVisitor.h>
#include <ObjectList.h>
class BPartition;
class BSession;
class BDiskDevice {
public:
BDiskDevice();
~BDiskDevice();
void Unset();
2003-02-01 18:12:03 +00:00
off_t Size() const;
int32 BlockSize() const;
2003-01-31 21:17:20 +00:00
int32 CountSessions() const;
BSession *SessionAt(int32 index) const;
int32 CountPartitions() const;
const char *Path() const;
2003-01-31 21:17:20 +00:00
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;
2003-02-01 18:12:03 +00:00
uint8 Type() const;
2003-01-31 21:17:20 +00:00
int32 UniqueID() const;
status_t Eject();
status_t LowLevelFormat(); // TODO: remove?
2003-02-01 18:12:03 +00:00
status_t Update();
2003-01-31 21:17:20 +00:00
BSession *VisitEachSession(BDiskDeviceVisitor *visitor);
BPartition *VisitEachPartition(BDiskDeviceVisitor *visitor);
bool Traverse(BDiskDeviceVisitor *visitor);
private:
BDiskDevice(const BDiskDevice &);
BDiskDevice &operator=(const BDiskDevice &);
status_t _Unarchive(BMessage *archive);
bool _AddSession(BSession *session);
2003-01-31 21:17:20 +00:00
private:
friend class BDiskDeviceRoster;
BObjectList<BSession> fSessions;
2003-01-31 21:17:20 +00:00
int32 fUniqueID;
int32 fChangeCounter;
status_t fMediaStatus;
off_t fSize;
2003-01-31 21:17:20 +00:00
int32 fBlockSize;
uint8 fType;
2003-01-31 21:17:20 +00:00
bool fReadOnly;
bool fRemovable;
// bool fIsFloppy;
char fPath[B_FILE_NAME_LENGTH];
2003-01-31 21:17:20 +00:00
};
#endif // _DISK_DEVICE_H