Started implementing the API. Necessary changes to the headers.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2657 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -17,6 +17,8 @@ public:
|
|||||||
BDiskDevice();
|
BDiskDevice();
|
||||||
~BDiskDevice();
|
~BDiskDevice();
|
||||||
|
|
||||||
|
void Unset();
|
||||||
|
|
||||||
off_t Size() const;
|
off_t Size() const;
|
||||||
int32 BlockSize() const;
|
int32 BlockSize() const;
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ public:
|
|||||||
|
|
||||||
int32 CountPartitions() const;
|
int32 CountPartitions() const;
|
||||||
|
|
||||||
const char *DevicePath() const;
|
const char *Path() const;
|
||||||
void GetName(BString *name, bool includeBusID = true,
|
void GetName(BString *name, bool includeBusID = true,
|
||||||
bool includeLUN = false) const;
|
bool includeLUN = false) const;
|
||||||
void GetName(char *name, bool includeBusID = true,
|
void GetName(char *name, bool includeBusID = true,
|
||||||
@@ -52,14 +54,24 @@ private:
|
|||||||
BDiskDevice(const BDiskDevice &);
|
BDiskDevice(const BDiskDevice &);
|
||||||
BDiskDevice &operator=(const BDiskDevice &);
|
BDiskDevice &operator=(const BDiskDevice &);
|
||||||
|
|
||||||
|
status_t _Unarchive(BMessage *archive);
|
||||||
|
|
||||||
|
bool _AddSession(BSession *session);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BObjectList<Session *> fSessions;
|
friend class BDiskDeviceRoster;
|
||||||
|
|
||||||
|
BObjectList<BSession> fSessions;
|
||||||
int32 fUniqueID;
|
int32 fUniqueID;
|
||||||
|
int32 fChangeCounter;
|
||||||
|
status_t fMediaStatus;
|
||||||
|
off_t fSize;
|
||||||
int32 fBlockSize;
|
int32 fBlockSize;
|
||||||
char fPath[B_FILE_NAME_LENGTH];
|
uint8 fType;
|
||||||
bool fReadOnly;
|
bool fReadOnly;
|
||||||
bool fRemovable;
|
bool fRemovable;
|
||||||
bool fIsFloppy;
|
// bool fIsFloppy;
|
||||||
|
char fPath[B_FILE_NAME_LENGTH];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _DISK_DEVICE_H
|
#endif // _DISK_DEVICE_H
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ public:
|
|||||||
status_t StopWatching(BMessenger target);
|
status_t StopWatching(BMessenger target);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int32 fDeviceID; // iteration state
|
BMessenger fManager;
|
||||||
|
int32 fCookie;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _DISK_DEVICE_ROSTER_H
|
#endif // _DISK_DEVICE_ROSTER_H
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class BDiskDeviceVisitor {
|
|||||||
|
|
||||||
// return true to abort iteration
|
// return true to abort iteration
|
||||||
virtual bool Visit(BDiskDevice *device);
|
virtual bool Visit(BDiskDevice *device);
|
||||||
virtual bool Visit(BSession *device);
|
virtual bool Visit(BSession *session);
|
||||||
virtual bool Visit(BPartition *device);
|
virtual bool Visit(BPartition *partition);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif _DISK_DEVICE_VISITOR_H
|
#endif _DISK_DEVICE_VISITOR_H
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#ifndef _PARTITION_H
|
#ifndef _PARTITION_H
|
||||||
#define _PARTITION_H
|
#define _PARTITION_H
|
||||||
|
|
||||||
#include <fs_device.h>
|
#include <disk_scanner.h>
|
||||||
#include <Mime.h>
|
#include <Mime.h>
|
||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
@@ -18,6 +18,8 @@ class BVolume;
|
|||||||
|
|
||||||
class BPartition {
|
class BPartition {
|
||||||
public:
|
public:
|
||||||
|
~BPartition();
|
||||||
|
|
||||||
BSession *Session() const;
|
BSession *Session() const;
|
||||||
BDiskDevice *Device() const;
|
BDiskDevice *Device() const;
|
||||||
|
|
||||||
@@ -68,19 +70,26 @@ public:
|
|||||||
private:
|
private:
|
||||||
BPartition();
|
BPartition();
|
||||||
BPartition(const BPartition &);
|
BPartition(const BPartition &);
|
||||||
~BPartition();
|
|
||||||
|
|
||||||
BPartition &operator=(const BPartition &);
|
BPartition &operator=(const BPartition &);
|
||||||
|
|
||||||
|
void _Unset();
|
||||||
|
status_t _Unarchive(BMessage *archive);
|
||||||
|
|
||||||
|
void _SetSession(BSession *session);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class BSession;
|
||||||
|
|
||||||
BSession *fSession;
|
BSession *fSession;
|
||||||
|
int32 fUniqueID;
|
||||||
|
int32 fChangeCounter;
|
||||||
|
int32 fIndex;
|
||||||
// TODO: Also contains the device name, which we can get from Device() anyway.
|
// TODO: Also contains the device name, which we can get from Device() anyway.
|
||||||
// We could either remove it from extended_partition_info or list
|
// We could either remove it from extended_partition_info or list
|
||||||
// the individual fields here.
|
// the individual fields here.
|
||||||
extended_partition_info fInfo;
|
extended_partition_info fInfo;
|
||||||
int32 fUniqueID;
|
|
||||||
dev_t fVolumeID;
|
dev_t fVolumeID;
|
||||||
node_ref fMountPoint;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _PARTITION_H
|
#endif // _PARTITION_H
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#define _SESSION_H
|
#define _SESSION_H
|
||||||
|
|
||||||
#include <DiskDeviceVisitor.h>
|
#include <DiskDeviceVisitor.h>
|
||||||
#include <fs_device.h>
|
#include <disk_scanner.h>
|
||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
@@ -19,10 +19,13 @@ extern const char *B_INTEL_PARTITIONING;
|
|||||||
|
|
||||||
class BSession {
|
class BSession {
|
||||||
public:
|
public:
|
||||||
|
~BSession();
|
||||||
|
|
||||||
BDiskDevice *Device() const;
|
BDiskDevice *Device() const;
|
||||||
|
|
||||||
off_t Offset() const;
|
off_t Offset() const;
|
||||||
off_t Size() const;
|
off_t Size() const;
|
||||||
|
int32 BlockSize() const;
|
||||||
|
|
||||||
int32 CountPartitions() const;
|
int32 CountPartitions() const;
|
||||||
BPartition *PartitionAt(int32 index) const;
|
BPartition *PartitionAt(int32 index) const;
|
||||||
@@ -53,15 +56,27 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
BSession();
|
BSession();
|
||||||
~BSession();
|
|
||||||
BSession(const BSession &);
|
BSession(const BSession &);
|
||||||
BSession &operator=(const BSession &);
|
BSession &operator=(const BSession &);
|
||||||
|
|
||||||
|
void _Unset();
|
||||||
|
status_t _Unarchive(BMessage *archive);
|
||||||
|
|
||||||
|
void _SetDevice(BDiskDevice *device);
|
||||||
|
|
||||||
|
bool _AddPartition(BPartition *partition);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BDiskDevice *fDevice;
|
friend class BDiskDevice;
|
||||||
BObjectList<BPartition *> fPartitions;
|
|
||||||
int32 fUniqueID;
|
BDiskDevice *fDevice;
|
||||||
session_info fInfo;
|
BObjectList<BPartition> fPartitions;
|
||||||
|
int32 fUniqueID;
|
||||||
|
int32 fChangeCounter;
|
||||||
|
int32 fIndex;
|
||||||
|
// TODO: Only offset, size and flags are used. Cleanup!
|
||||||
|
session_info fInfo;
|
||||||
|
BString fPartitioningSystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _SESSION_H
|
#endif // _SESSION_H
|
||||||
|
|||||||
Reference in New Issue
Block a user