haiku/headers/private/storage/Session.h

85 lines
1.9 KiB
C
Raw Normal View History

//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
//---------------------------------------------------------------------
#ifndef _SESSION_H
#define _SESSION_H
#include <DiskDeviceVisitor.h>
#include <disk_scanner.h>
#include <ObjectList.h>
#include <Rect.h>
#include <String.h>
class BDiskDevice;
class BPartition;
extern const char *B_INTEL_PARTITIONING;
class BSession {
public:
~BSession();
BDiskDevice *Device() const;
off_t Offset() const;
off_t Size() const;
int32 BlockSize() const;
int32 CountPartitions() const;
BPartition *PartitionAt(int32 index) const;
int32 Index() const;
uint32 Flags() const;
bool IsAudio() const;
bool IsData() const;
bool IsVirtual() const;
const char *PartitioningSystem() const;
int32 UniqueID() const;
BPartition *VisitEachPartition(BDiskDeviceVisitor *visitor);
BPartition *PartitionWithID(int32 id);
status_t GetPartitioningParameters(const char *partitioningSystem,
BString *parameters,
BRect dialogCenter = BRect(),
bool *cancelled = NULL);
status_t Partition(const char *partitioningSystem, const char *parameters);
status_t Partition(const char *partitioningSystem,
BRect dialogCenter = BRect(),
bool *cancelled = NULL);
private:
BSession();
BSession(const BSession &);
BSession &operator=(const BSession &);
void _Unset();
status_t _Unarchive(BMessage *archive);
status_t _Update(BMessage *archive);
void _SetDevice(BDiskDevice *device);
bool _AddPartition(BPartition *partition);
private:
friend class BDiskDevice;
friend class BDiskDeviceList;
BDiskDevice *fDevice;
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