xref: /haiku/headers/private/storage/DiskSystem.h (revision 21258e2674226d6aa732321b6f8494841895af5f)
1 /*
2  * Copyright 2003-2008, Haiku Inc.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _DISK_SYSTEM_H
6 #define _DISK_SYSTEM_H
7 
8 
9 #include <DiskDeviceDefs.h>
10 #include <String.h>
11 
12 class BPartition;
13 class BString;
14 struct user_disk_system_info;
15 
16 
17 class BDiskSystem {
18 public:
19 							BDiskSystem();
20 							BDiskSystem(const BDiskSystem& other);
21 							~BDiskSystem();
22 
23 			status_t		InitCheck() const;
24 
25 			const char*		Name() const;
26 			const char*		ShortName() const;
27 			const char*		PrettyName() const;
28 
29 			bool			SupportsDefragmenting(bool* whileMounted) const;
30 			bool			SupportsRepairing(bool checkOnly,
31 								bool* whileMounted) const;
32 			bool			SupportsResizing(bool* whileMounted) const;
33 			bool			SupportsResizingChild() const;
34 			bool			SupportsMoving(bool* whileMounted) const;
35 			bool			SupportsMovingChild() const;
36 			bool			SupportsName() const;
37 			bool			SupportsContentName() const;
38 			bool			SupportsSettingName() const;
39 			bool			SupportsSettingContentName(
40 								bool* whileMounted) const;
41 			bool			SupportsSettingType() const;
42 			bool			SupportsSettingParameters() const;
43 			bool			SupportsSettingContentParameters(
44 								bool* whileMounted) const;
45 			bool			SupportsCreatingChild() const;
46 			bool			SupportsDeletingChild() const;
47 			bool			SupportsInitializing() const;
48 			bool			SupportsWriting() const;
49 
50 			status_t		GetTypeForContentType(const char* contentType,
51 								BString* type) const;
52 
53 			bool			IsPartitioningSystem() const;
54 			bool			IsFileSystem() const;
55 
56 			BDiskSystem&	operator=(const BDiskSystem& other);
57 
58 private:
59 			status_t		_SetTo(disk_system_id id);
60 			status_t		_SetTo(const user_disk_system_info* info);
61 			void			_Unset();
62 
63 private:
64 	friend class BDiskDeviceRoster;
65 	friend class BPartition;
66 
67 	disk_system_id			fID;
68 	BString					fName;
69 	BString					fShortName;
70 	BString					fPrettyName;
71 	uint32					fFlags;
72 };
73 
74 #endif	// _DISK_SYSTEM_H
75