xref: /haiku/headers/private/kernel/disk_device_manager/KFileDiskDevice.h (revision 83b1a68c52ba3e0e8796282759f694b7fdddf06d)
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 
10 namespace BPrivate {
11 namespace DiskDevice {
12 
13 class KPath;
14 
15 class KFileDiskDevice : public KDiskDevice {
16 public:
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 
29 protected:
30 	virtual status_t GetMediaStatus(status_t *mediaStatus);
31 	virtual status_t GetGeometry(device_geometry *geometry);
32 
33 private:
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 
39 private:
40 	char			*fFilePath;
41 };
42 
43 } // namespace DiskDevice
44 } // namespace BPrivate
45 
46 using BPrivate::DiskDevice::KFileDiskDevice;
47 
48 #endif	// _K_FILE_DISK_DEVICE_H
49