2003-06-23 02:54:16 +04:00
|
|
|
// KFileDiskDevice.h
|
|
|
|
|
|
|
|
#ifndef _K_FILE_DISK_DEVICE_H
|
|
|
|
#define _K_FILE_DISK_DEVICE_H
|
|
|
|
|
|
|
|
#include <OS.h>
|
|
|
|
|
|
|
|
#include "KDiskDevice.h"
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
namespace DiskDevice {
|
|
|
|
|
2004-10-28 01:56:05 +04:00
|
|
|
class KPath;
|
|
|
|
|
2003-06-23 02:54:16 +04:00
|
|
|
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 void Dump(bool deep = true, int32 level = 0);
|
|
|
|
|
2003-06-25 03:56:16 +04:00
|
|
|
private:
|
2004-10-28 01:56:05 +04:00
|
|
|
static status_t _GetDirectoryPath(partition_id id, KPath *path);
|
|
|
|
|
2003-06-25 03:56:16 +04:00
|
|
|
static status_t _RegisterDevice(const char *file, const char *device);
|
|
|
|
static status_t _UnregisterDevice(const char *device);
|
2003-06-23 02:54:16 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
char *fFilePath;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DiskDevice
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
using BPrivate::DiskDevice::KFileDiskDevice;
|
|
|
|
|
|
|
|
#endif // _K_FILE_DISK_DEVICE_H
|