Added a special disk device class, that is responsible for representing
files as disk devices. This will not only be great for testing the file and partitioning system modules' writing capabilities, it will also just be a nice feature to have. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3598 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
// KFileDiskDevice.h
|
||||
|
||||
#ifndef _K_FILE_DISK_DEVICE_H
|
||||
#define _K_FILE_DISK_DEVICE_H
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include "KDiskDevice.h"
|
||||
|
||||
namespace BPrivate {
|
||||
namespace DiskDevice {
|
||||
|
||||
class KFileDiskDevice : public KDiskDevice {
|
||||
public:
|
||||
KFileDiskDevice(partition_id id = -1);
|
||||
virtual ~KFileDiskDevice();
|
||||
|
||||
status_t SetTo(const char *filePath, const char *devicePath = NULL);
|
||||
void Unset();
|
||||
virtual status_t InitCheck() const;
|
||||
// TODO: probably superfluous
|
||||
|
||||
const char *FilePath() const;
|
||||
|
||||
virtual KPartition *CreateShadowPartition();
|
||||
|
||||
// virtual void Dump(bool deep = true, int32 level = 0);
|
||||
|
||||
protected:
|
||||
virtual status_t GetMediaStatus(status_t *mediaStatus);
|
||||
virtual status_t GetGeometry(device_geometry *geometry);
|
||||
|
||||
private:
|
||||
char *fFilePath;
|
||||
};
|
||||
|
||||
} // namespace DiskDevice
|
||||
} // namespace BPrivate
|
||||
|
||||
using BPrivate::DiskDevice::KFileDiskDevice;
|
||||
|
||||
#endif // _K_FILE_DISK_DEVICE_H
|
||||
Reference in New Issue
Block a user