2003-05-28 21:46:11 +00:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef _DISK_SYSTEM_H
|
|
|
|
#define _DISK_SYSTEM_H
|
|
|
|
|
2003-07-06 23:11:10 +00:00
|
|
|
#include <DiskDeviceDefs.h>
|
2003-07-08 23:32:52 +00:00
|
|
|
#include <String.h>
|
2003-07-06 23:11:10 +00:00
|
|
|
|
|
|
|
class BPartition;
|
2003-07-08 23:32:52 +00:00
|
|
|
struct user_disk_system_info;
|
2003-07-06 23:11:10 +00:00
|
|
|
|
2003-05-28 21:46:11 +00:00
|
|
|
class BDiskSystem {
|
|
|
|
public:
|
2003-07-08 23:32:52 +00:00
|
|
|
BDiskSystem();
|
|
|
|
~BDiskSystem();
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
|
|
|
|
2003-05-28 21:46:11 +00:00
|
|
|
const char *Name() const;
|
2003-06-10 22:45:49 +00:00
|
|
|
const char *PrettyName() const;
|
2003-05-28 21:46:11 +00:00
|
|
|
|
2003-07-08 23:32:52 +00:00
|
|
|
bool SupportsDefragmenting(BPartition *partition,
|
|
|
|
bool *whileMounted) const;
|
|
|
|
bool SupportsRepairing(BPartition *partition, bool checkOnly,
|
|
|
|
bool *whileMounted) const;
|
2003-05-28 21:47:29 +00:00
|
|
|
bool SupportsResizing(BPartition *partition, bool *whileMounted) const;
|
2003-05-28 21:46:11 +00:00
|
|
|
bool SupportsResizingChild(BPartition *child) const;
|
2003-05-28 21:47:29 +00:00
|
|
|
bool SupportsMoving(BPartition *partition, bool *whileMounted) const;
|
2003-05-28 21:46:11 +00:00
|
|
|
bool SupportsMovingChild(BPartition *child) const;
|
2003-07-08 23:32:52 +00:00
|
|
|
bool SupportsSettingName(BPartition *partition) const;
|
|
|
|
bool SupportsSettingContentName(BPartition *partition,
|
|
|
|
bool *whileMounted) const;
|
|
|
|
bool SupportsSettingType(BPartition *partition) const;
|
2003-06-22 23:29:29 +00:00
|
|
|
bool SupportsCreatingChild(BPartition *partition) const;
|
2003-07-15 21:44:23 +00:00
|
|
|
bool SupportsDeletingChild(BPartition *child) const;
|
|
|
|
bool SupportsInitializing(BPartition *partition) const;
|
|
|
|
bool SupportsInitializingChild(BPartition *child,
|
|
|
|
const char *diskSystem) const;
|
|
|
|
|
2003-07-08 23:32:52 +00:00
|
|
|
status_t ValidateResize(BPartition *partition, off_t *size) const;
|
2003-07-16 21:02:14 +00:00
|
|
|
status_t ValidateResizeChild(BPartition *child, off_t *size) const;
|
2003-07-15 21:44:23 +00:00
|
|
|
status_t ValidateMove(BPartition *partition, off_t *start) const;
|
2003-07-16 21:02:14 +00:00
|
|
|
status_t ValidateMoveChild(BPartition *child, off_t *start) const;
|
2003-07-08 23:32:52 +00:00
|
|
|
status_t ValidateSetName(BPartition *partition, char *name) const;
|
|
|
|
status_t ValidateSetContentName(BPartition *partition, char *name) const;
|
2003-07-15 21:44:23 +00:00
|
|
|
status_t ValidateSetType(BPartition *partition, const char *type) const;
|
2003-07-08 23:32:52 +00:00
|
|
|
status_t ValidateCreateChild(BPartition *partition, off_t *start,
|
|
|
|
off_t *size, const char *type,
|
|
|
|
const char *parameters) const;
|
2003-07-17 00:05:31 +00:00
|
|
|
status_t ValidateInitialize(BPartition *partition, char *name,
|
|
|
|
const char *parameters) const;
|
2003-07-08 23:32:52 +00:00
|
|
|
|
|
|
|
status_t GetNextSupportedType(BPartition *partition, int32 *cookie,
|
|
|
|
char *type) const;
|
|
|
|
// Returns all types the disk system supports for children of the
|
|
|
|
// supplied partition.
|
|
|
|
status_t GetTypeForContentType(const char *contentType, char *type) const;
|
2003-05-28 21:46:11 +00:00
|
|
|
|
|
|
|
bool IsPartitioningSystem() const;
|
|
|
|
bool IsFileSystem() const;
|
2003-05-28 21:47:29 +00:00
|
|
|
bool IsSubSystemFor(BPartition *parent) const;
|
2003-07-08 23:32:52 +00:00
|
|
|
|
|
|
|
private:
|
2003-07-17 00:05:31 +00:00
|
|
|
status_t _SetTo(disk_system_id id);
|
2003-07-08 23:32:52 +00:00
|
|
|
status_t _SetTo(user_disk_system_info *info);
|
|
|
|
void _Unset();
|
|
|
|
|
|
|
|
friend class BDiskDeviceRoster;
|
2003-07-17 00:05:31 +00:00
|
|
|
friend class BPartition;
|
2003-07-08 23:32:52 +00:00
|
|
|
|
|
|
|
disk_system_id fID;
|
|
|
|
BString fName;
|
|
|
|
BString fPrettyName;
|
|
|
|
bool fFileSystem;
|
2003-05-28 21:46:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _DISK_SYSTEM_H
|