diff --git a/include/DialogFeatures.h b/include/DialogFeatures.h index 4d72d5a9..ae8a8c73 100644 --- a/include/DialogFeatures.h +++ b/include/DialogFeatures.h @@ -18,7 +18,7 @@ #ifndef GPARTED_DIALOGFEATURES_H #define GPARTED_DIALOGFEATURES_H -#include "Utils.h" +#include "FileSystem.h" #include #include diff --git a/include/Dialog_Base_Partition.h b/include/Dialog_Base_Partition.h index 36124007..10a52929 100644 --- a/include/Dialog_Base_Partition.h +++ b/include/Dialog_Base_Partition.h @@ -19,8 +19,8 @@ #define GPARTED_DIALOG_BASE_PARTITION_H #include "Frame_Resizer_Extended.h" +#include "FileSystem.h" #include "Partition.h" -#include "Utils.h" #include #include diff --git a/include/Dialog_Partition_Copy.h b/include/Dialog_Partition_Copy.h index 03e2048e..bdc9c084 100644 --- a/include/Dialog_Partition_Copy.h +++ b/include/Dialog_Partition_Copy.h @@ -19,8 +19,8 @@ #define GPARTED_DIALOG_PARTITION_COPY_H #include "Dialog_Base_Partition.h" +#include "FileSystem.h" #include "Partition.h" -#include "Utils.h" namespace GParted { diff --git a/include/Dialog_Partition_Resize_Move.h b/include/Dialog_Partition_Resize_Move.h index 448dfe43..0f7dfe57 100644 --- a/include/Dialog_Partition_Resize_Move.h +++ b/include/Dialog_Partition_Resize_Move.h @@ -18,9 +18,9 @@ #define GPARTED_DIALOG_PARTITION_RESIZE_MOVE_H #include "Dialog_Base_Partition.h" +#include "FileSystem.h" #include "Partition.h" #include "PartitionVector.h" -#include "Utils.h" namespace GParted { diff --git a/include/FileSystem.h b/include/FileSystem.h index 43d36755..0e65f7d8 100644 --- a/include/FileSystem.h +++ b/include/FileSystem.h @@ -31,6 +31,54 @@ namespace GParted { +// Minimum and maximum file system size limits +struct FS_Limits +{ + Byte_Value min_size; // 0 => no limit, +ve => limit defined. (As implemented by) + Byte_Value max_size; // -----------------"----------------- (code using these.) + + FS_Limits() : min_size( 0 ) , max_size( 0 ) {}; + FS_Limits( Byte_Value min, Byte_Value max ) : min_size( min ), max_size( max ) {}; +}; + +// Struct to store file system support information +struct FS +{ + enum Support + { + NONE = 0, + GPARTED = 1, + LIBPARTED = 2, + EXTERNAL = 3 + }; + + FSType filesystem; + Support busy; // How to determine if partition/file system is busy + Support read; // Can and how to read sector usage while inactive + Support read_label; + Support write_label; + Support read_uuid; + Support write_uuid; + Support create; + Support create_with_label; // Can and how to format file system with label + Support grow; + Support shrink; + Support move; // start point and endpoint + Support check; // Some check tool available? + Support copy; + Support remove; + Support online_read; // Can and how to read sector usage while active + Support online_grow; + Support online_shrink; + + FS( FSType fstype = FS_UNKNOWN ) : filesystem( fstype ) + { + busy = read = read_label = write_label = read_uuid = write_uuid = create = + create_with_label = grow = shrink = move = check = copy = remove = online_read = + online_grow = online_shrink = NONE; + } +}; + enum ExecFlags { EXEC_NONE = 1 << 0, diff --git a/include/Utils.h b/include/Utils.h index 9be31c62..0f10902c 100644 --- a/include/Utils.h +++ b/include/Utils.h @@ -123,55 +123,6 @@ enum CUSTOM_TEXT CTEXT_RESIZE_DISALLOWED_WARNING // File system resizing currently disallowed reason } ; -// Minimum and maximum file system size limits -struct FS_Limits -{ - Byte_Value min_size; // 0 => no limit, +ve => limit defined. (As implemented by) - Byte_Value max_size; // -----------------"----------------- (code using these.) - - FS_Limits() : min_size( 0 ) , max_size( 0 ) {}; - FS_Limits( Byte_Value min, Byte_Value max ) : min_size( min ), max_size( max ) {}; -}; - -//struct to store file system information -struct FS -{ - enum Support - { - NONE = 0, - GPARTED = 1, - LIBPARTED = 2, - EXTERNAL = 3 - }; - - FSType filesystem; - Support busy ; //How to determine if partition/file system is busy - Support read ; //Can and how to read sector usage while inactive - Support read_label ; - Support write_label ; - Support read_uuid ; - Support write_uuid ; - Support create ; - Support create_with_label ; //Can and how to format file system with label - Support grow ; - Support shrink ; - Support move ; //startpoint and endpoint - Support check ; //some checktool available? - Support copy ; - Support remove ; - Support online_read ; //Can and how to read sector usage while active - Support online_grow ; - Support online_shrink ; - - FS( FSType fstype = FS_UNKNOWN ) : filesystem( fstype ) - { - busy = read = read_label = write_label = read_uuid = write_uuid = create = - create_with_label = grow = shrink = move = check = copy = remove = online_read = - online_grow = online_shrink = NONE ; - } -} ; - - class Utils { public: diff --git a/src/DialogFeatures.cc b/src/DialogFeatures.cc index 16062d09..a162647d 100644 --- a/src/DialogFeatures.cc +++ b/src/DialogFeatures.cc @@ -16,6 +16,7 @@ */ #include "DialogFeatures.h" +#include "FileSystem.h" #include "GParted_Core.h" #include diff --git a/src/Dialog_Partition_Copy.cc b/src/Dialog_Partition_Copy.cc index eddc2c66..0b7037c9 100644 --- a/src/Dialog_Partition_Copy.cc +++ b/src/Dialog_Partition_Copy.cc @@ -16,6 +16,7 @@ */ #include "Dialog_Partition_Copy.h" +#include "FileSystem.h" #include "GParted_Core.h" #include "Partition.h" #include "Utils.h" diff --git a/src/Dialog_Partition_New.cc b/src/Dialog_Partition_New.cc index 24fb2bf7..237b3afd 100644 --- a/src/Dialog_Partition_New.cc +++ b/src/Dialog_Partition_New.cc @@ -16,6 +16,7 @@ */ #include "Dialog_Partition_New.h" +#include "FileSystem.h" #include "GParted_Core.h" #include "Partition.h" #include "Utils.h" diff --git a/src/Dialog_Partition_Resize_Move.cc b/src/Dialog_Partition_Resize_Move.cc index 9bfa57dc..eb72ec3f 100644 --- a/src/Dialog_Partition_Resize_Move.cc +++ b/src/Dialog_Partition_Resize_Move.cc @@ -16,6 +16,7 @@ */ #include "Dialog_Partition_Resize_Move.h" +#include "FileSystem.h" #include "GParted_Core.h" #include "Partition.h" #include "PartitionVector.h" diff --git a/src/btrfs.cc b/src/btrfs.cc index 80d3517f..c80a3985 100644 --- a/src/btrfs.cc +++ b/src/btrfs.cc @@ -17,6 +17,7 @@ #include "btrfs.h" #include "BlockSpecial.h" +#include "FileSystem.h" #include "Mount_Info.h" #include "Partition.h" diff --git a/src/exfat.cc b/src/exfat.cc index ce32b880..e17bbabc 100644 --- a/src/exfat.cc +++ b/src/exfat.cc @@ -15,6 +15,7 @@ */ #include "exfat.h" +#include "FileSystem.h" namespace GParted { @@ -32,4 +33,3 @@ FS exfat::get_filesystem_support() } } //GParted - diff --git a/src/ext2.cc b/src/ext2.cc index 8c2291fe..f1273270 100644 --- a/src/ext2.cc +++ b/src/ext2.cc @@ -16,6 +16,7 @@ */ #include "ext2.h" +#include "FileSystem.h" #include "OperationDetail.h" #include "Partition.h" #include "Utils.h" diff --git a/src/f2fs.cc b/src/f2fs.cc index 87e544e1..561bb777 100644 --- a/src/f2fs.cc +++ b/src/f2fs.cc @@ -15,6 +15,7 @@ */ #include "f2fs.h" +#include "FileSystem.h" #include "Partition.h" namespace GParted diff --git a/src/fat16.cc b/src/fat16.cc index 4abb4155..0c27322e 100644 --- a/src/fat16.cc +++ b/src/fat16.cc @@ -16,6 +16,7 @@ */ #include "fat16.h" +#include "FileSystem.h" #include "Partition.h" /***** diff --git a/src/hfs.cc b/src/hfs.cc index fef1a31c..62f57605 100644 --- a/src/hfs.cc +++ b/src/hfs.cc @@ -16,6 +16,7 @@ */ #include "hfs.h" +#include "FileSystem.h" #include "Partition.h" namespace GParted diff --git a/src/hfsplus.cc b/src/hfsplus.cc index fdc3d0f2..c0ff439a 100644 --- a/src/hfsplus.cc +++ b/src/hfsplus.cc @@ -16,6 +16,7 @@ */ #include "hfsplus.h" +#include "FileSystem.h" #include "Partition.h" namespace GParted diff --git a/src/jfs.cc b/src/jfs.cc index 644ca31c..bcee88ed 100644 --- a/src/jfs.cc +++ b/src/jfs.cc @@ -16,6 +16,7 @@ */ #include "jfs.h" +#include "FileSystem.h" #include "Partition.h" namespace GParted diff --git a/src/linux_swap.cc b/src/linux_swap.cc index 1266bcbb..d276b3ed 100644 --- a/src/linux_swap.cc +++ b/src/linux_swap.cc @@ -17,6 +17,7 @@ #include "linux_swap.h" #include "BlockSpecial.h" +#include "FileSystem.h" #include "Partition.h" #include diff --git a/src/luks.cc b/src/luks.cc index 04575317..a5be0d97 100644 --- a/src/luks.cc +++ b/src/luks.cc @@ -14,6 +14,7 @@ * along with this program; if not, see . */ +#include "FileSystem.h" #include "LUKS_Info.h" #include "Utils.h" #include "luks.h" diff --git a/src/lvm2_pv.cc b/src/lvm2_pv.cc index 8cb76e53..15af3eba 100644 --- a/src/lvm2_pv.cc +++ b/src/lvm2_pv.cc @@ -14,6 +14,7 @@ * along with this program; if not, see . */ +#include "FileSystem.h" #include "LVM2_PV_Info.h" #include "lvm2_pv.h" #include "Partition.h" diff --git a/src/nilfs2.cc b/src/nilfs2.cc index ecc5573e..9d2cf2b2 100644 --- a/src/nilfs2.cc +++ b/src/nilfs2.cc @@ -15,6 +15,7 @@ */ #include "nilfs2.h" +#include "FileSystem.h" #include "Partition.h" namespace GParted diff --git a/src/ntfs.cc b/src/ntfs.cc index 4c7ba470..4fbf1376 100644 --- a/src/ntfs.cc +++ b/src/ntfs.cc @@ -16,6 +16,7 @@ */ #include "ntfs.h" +#include "FileSystem.h" #include "OperationDetail.h" #include "Partition.h" #include "Utils.h" diff --git a/src/reiser4.cc b/src/reiser4.cc index c2224121..556cefce 100644 --- a/src/reiser4.cc +++ b/src/reiser4.cc @@ -16,6 +16,7 @@ */ #include "reiser4.h" +#include "FileSystem.h" #include "Partition.h" namespace GParted diff --git a/src/reiserfs.cc b/src/reiserfs.cc index 5dcca9e8..0d6bd881 100644 --- a/src/reiserfs.cc +++ b/src/reiserfs.cc @@ -16,6 +16,7 @@ */ #include "reiserfs.h" +#include "FileSystem.h" #include "Partition.h" namespace GParted diff --git a/src/udf.cc b/src/udf.cc index 7a0baa3f..46c91d60 100644 --- a/src/udf.cc +++ b/src/udf.cc @@ -15,6 +15,7 @@ */ #include "udf.h" +#include "FileSystem.h" #include "Partition.h" #include "Utils.h" diff --git a/src/ufs.cc b/src/ufs.cc index 5067a0f7..16307646 100644 --- a/src/ufs.cc +++ b/src/ufs.cc @@ -16,6 +16,7 @@ */ #include "ufs.h" +#include "FileSystem.h" namespace GParted { diff --git a/src/xfs.cc b/src/xfs.cc index 83d04ffb..11f590ed 100644 --- a/src/xfs.cc +++ b/src/xfs.cc @@ -16,6 +16,7 @@ */ #include "xfs.h" +#include "FileSystem.h" #include "OperationDetail.h" #include "Partition.h" #include "Utils.h"