1// KFileDiskDevice.h
2
3#ifndef _K_FILE_DISK_DEVICE_H
4#define _K_FILE_DISK_DEVICE_H
5
6#include <OS.h>
7
8#include "KDiskDevice.h"
9
10namespace BPrivate {
11namespace DiskDevice {
12
13class KPath;
14
15class KFileDiskDevice : public KDiskDevice {
16public:
17	KFileDiskDevice(partition_id id = -1);
18	virtual ~KFileDiskDevice();
19
20	status_t SetTo(const char *filePath, const char *devicePath = NULL);
21	void Unset();
22	virtual status_t InitCheck() const;
23		// TODO: probably superfluous
24
25	const char *FilePath() const;
26
27//	virtual void Dump(bool deep = true, int32 level = 0);
28
29protected:
30	virtual status_t GetMediaStatus(status_t *mediaStatus);
31	virtual status_t GetGeometry(device_geometry *geometry);
32
33private:
34	static status_t _GetDirectoryPath(partition_id id, KPath *path);
35
36	static status_t _RegisterDevice(const char *file, const char *device);
37	static status_t _UnregisterDevice(const char *device);
38
39private:
40	char			*fFilePath;
41};
42
43} // namespace DiskDevice
44} // namespace BPrivate
45
46using BPrivate::DiskDevice::KFileDiskDevice;
47
48#endif	// _K_FILE_DISK_DEVICE_H
49