xref: /haiku/headers/private/storage/DiskSystem.h (revision d5cd5d63ff0ad395989db6cf4841a64d5b545d1d)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //---------------------------------------------------------------------
5 
6 #ifndef _DISK_SYSTEM_H
7 #define _DISK_SYSTEM_H
8 
9 #include <DiskDeviceDefs.h>
10 #include <String.h>
11 
12 class BPartition;
13 struct user_disk_system_info;
14 
15 class BDiskSystem {
16 public:
17 	BDiskSystem();
18 	~BDiskSystem();
19 
20 	status_t InitCheck() const;
21 
22 	const char *Name() const;
23 	const char *PrettyName() const;
24 
25 	bool SupportsDefragmenting(bool *whileMounted) const;
26 	bool SupportsRepairing(bool checkOnly, bool *whileMounted) const;
27 	bool SupportsResizing(bool *whileMounted) const;
28 	bool SupportsResizingChild() const;
29 	bool SupportsMoving(bool *whileMounted) const;
30 	bool SupportsMovingChild() const;
31 	bool SupportsSettingName() const;
32 	bool SupportsSettingContentName(bool *whileMounted) const;
33 	bool SupportsSettingType() const;
34 	bool SupportsSettingParameters() const;
35 	bool SupportsSettingContentParameters(bool *whileMounted) const;
36 	bool SupportsCreatingChild() const;
37 	bool SupportsDeletingChild() const;
38 	bool SupportsInitializing() const;
39 
40 	status_t GetNextSupportedType(BPartition *partition, int32 *cookie,
41 								  char *type) const;
42 		// Returns all types the disk system supports for children of the
43 		// supplied partition.
44 	status_t GetTypeForContentType(const char *contentType, char *type) const;
45 
46 	bool IsPartitioningSystem() const;
47 	bool IsFileSystem() const;
48 	bool IsSubSystemFor(BPartition *parent) const;
49 
50 private:
51 	status_t _SetTo(disk_system_id id);
52 	status_t _SetTo(user_disk_system_info *info);
53 	void _Unset();
54 
55 	friend class BDiskDeviceRoster;
56 	friend class BPartition;
57 
58 	disk_system_id	fID;
59 	BString			fName;
60 	BString			fPrettyName;
61 	uint32			fFlags;
62 };
63 
64 #endif	// _DISK_SYSTEM_H
65