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

67 lines
1.7 KiB
C++
Raw Normal View History

2007-10-17 20:51:10 +00:00
/*
* Copyright 2003-2007, Ingo Weinhold, [email protected].
* Copyright 2003, Tyler Akidau, [email protected].
* Distributed under the terms of the MIT License.
*/
2003-01-31 21:17:20 +00:00
#ifndef _DISK_DEVICE_H
#define _DISK_DEVICE_H
2003-07-06 23:11:10 +00:00
#include <Partition.h>
2007-10-17 20:51:10 +00:00
2003-07-06 23:11:10 +00:00
struct user_disk_device_data;
2003-05-28 21:43:58 +00:00
class BDiskDevice : public BPartition {
2003-01-31 21:17:20 +00:00
public:
2007-10-17 20:51:10 +00:00
BDiskDevice();
virtual ~BDiskDevice();
2003-07-06 23:11:10 +00:00
2007-10-17 20:51:10 +00:00
bool HasMedia() const;
bool IsRemovableMedia() const;
bool IsReadOnlyMedia() const;
bool IsWriteOnceMedia() const;
2003-01-31 21:17:20 +00:00
2007-10-17 20:51:10 +00:00
status_t Eject(bool update = false);
2003-01-31 21:17:20 +00:00
2007-10-17 20:51:10 +00:00
status_t SetTo(partition_id id);
status_t Update(bool* updated = NULL);
void Unset();
status_t InitCheck() const;
2003-07-06 23:11:10 +00:00
2007-10-17 20:51:10 +00:00
virtual status_t GetPath(BPath* path) const;
2003-07-06 23:11:10 +00:00
2007-10-17 20:51:10 +00:00
bool IsModified() const;
status_t PrepareModifications();
status_t CommitModifications(bool synchronously = true,
BMessenger progressMessenger = BMessenger(),
bool receiveCompleteProgressUpdates = true);
status_t CancelModifications();
2003-07-06 23:11:10 +00:00
2003-01-31 21:17:20 +00:00
private:
2007-10-17 20:51:10 +00:00
friend class BDiskDeviceList;
friend class BDiskDeviceRoster;
2007-10-17 20:51:10 +00:00
BDiskDevice(const BDiskDevice&);
BDiskDevice& operator=(const BDiskDevice&);
2007-10-17 20:51:10 +00:00
static status_t _GetData(partition_id id, bool deviceOnly,
size_t neededSize,
2007-10-17 20:51:10 +00:00
user_disk_device_data** data);
2007-10-17 20:51:10 +00:00
status_t _SetTo(partition_id id, bool deviceOnly,
size_t neededSize);
2007-10-17 20:51:10 +00:00
status_t _SetTo(user_disk_device_data* data);
status_t _Update(bool* updated);
2007-10-17 20:51:10 +00:00
status_t _Update(user_disk_device_data* data,
bool* updated);
2007-10-17 20:51:10 +00:00
static void _ClearUserData(user_partition_data* data);
2007-10-17 20:51:10 +00:00
virtual bool _AcceptVisitor(BDiskDeviceVisitor* visitor,
int32 level);
2003-05-28 21:43:58 +00:00
2007-10-17 20:51:10 +00:00
user_disk_device_data* fDeviceData;
2003-07-06 23:11:10 +00:00
};
2003-01-31 21:17:20 +00:00
#endif // _DISK_DEVICE_H