92b9e33326
* Added more parameters to _SetTo(). * Fixed problem in Unset() -- the BPartition version wasn't called. * Implemented {Prepare,Cancel}Modifications() and IsModified(). The latter doesn't work yet, since the syscall implementation is still empty yet. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3977 a95241bf-73f2-0310-859d-f6bbb57e9c96
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
//----------------------------------------------------------------------
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
// by the OpenBeOS license.
|
|
//---------------------------------------------------------------------
|
|
|
|
#ifndef _DISK_DEVICE_H
|
|
#define _DISK_DEVICE_H
|
|
|
|
#include <Partition.h>
|
|
|
|
struct user_disk_device_data;
|
|
|
|
class BDiskDevice : public BPartition {
|
|
public:
|
|
BDiskDevice();
|
|
virtual ~BDiskDevice();
|
|
|
|
bool HasMedia() const;
|
|
bool IsRemovableMedia() const;
|
|
bool IsReadOnlyMedia() const;
|
|
bool IsWriteOnceMedia() const;
|
|
|
|
status_t Eject(bool update = false);
|
|
|
|
status_t SetTo(partition_id id);
|
|
status_t Update(bool *updated = NULL);
|
|
void Unset();
|
|
status_t InitCheck() const;
|
|
|
|
virtual status_t GetPath(BPath *path) const;
|
|
|
|
bool IsModified() const;
|
|
status_t PrepareModifications();
|
|
status_t CommitModifications(bool synchronously = true,
|
|
BMessenger progressMessenger = BMessenger(),
|
|
bool receiveCompleteProgressUpdates = true);
|
|
status_t CancelModifications();
|
|
|
|
private:
|
|
friend class BDiskDeviceList;
|
|
friend class BDiskDeviceRoster;
|
|
|
|
status_t _SetTo(partition_id id, bool deviceOnly, bool shadow,
|
|
size_t neededSize);
|
|
status_t _SetTo(user_disk_device_data *data);
|
|
|
|
virtual bool _AcceptVisitor(BDiskDeviceVisitor *visitor, int32 level);
|
|
|
|
user_disk_device_data *fDeviceData;
|
|
};
|
|
|
|
#endif // _DISK_DEVICE_H
|