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

85 lines
1.9 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 _SESSION_H
#define _SESSION_H
#include <DiskDeviceVisitor.h>
#include <disk_scanner.h>
2003-01-31 21:17:20 +00:00
#include <ObjectList.h>
#include <Rect.h>
2003-01-31 21:17:20 +00:00
#include <String.h>
class BDiskDevice;
class BPartition;
2003-02-01 18:12:03 +00:00
extern const char *B_INTEL_PARTITIONING;
2003-01-31 21:17:20 +00:00
class BSession {
public:
~BSession();
2003-01-31 21:17:20 +00:00
BDiskDevice *Device() const;
off_t Offset() const;
off_t Size() const;
int32 BlockSize() const;
2003-01-31 21:17:20 +00:00
int32 CountPartitions() const;
BPartition *PartitionAt(int32 index) const;
int32 Index() const;
uint32 Flags() const;
bool IsAudio() const;
bool IsData() const;
bool IsVirtual() const;
2003-02-01 18:12:03 +00:00
const char *PartitioningSystem() const;
2003-01-31 21:17:20 +00:00
int32 UniqueID() const;
2003-02-01 18:12:03 +00:00
BPartition *VisitEachPartition(BDiskDeviceVisitor *visitor);
2003-01-31 21:17:20 +00:00
BPartition *PartitionWithID(int32 id);
2003-01-31 21:17:20 +00:00
status_t GetPartitioningParameters(const char *partitioningSystem,
BString *parameters,
BRect dialogCenter = BRect(),
2003-01-31 21:17:20 +00:00
bool *cancelled = NULL);
status_t Partition(const char *partitioningSystem, const char *parameters);
status_t Partition(const char *partitioningSystem,
BRect dialogCenter = BRect(),
2003-01-31 21:17:20 +00:00
bool *cancelled = NULL);
private:
2003-02-01 18:12:03 +00:00
BSession();
2003-01-31 21:17:20 +00:00
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);
2003-01-31 21:17:20 +00:00
private:
friend class BDiskDevice;
2003-02-20 00:22:09 +00:00
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;
2003-01-31 21:17:20 +00:00
};
#endif // _SESSION_H