Move struct FS and FS_Limits into FileSystem.h

Struct FS and struct FS_Limits are strongly related to the FileSystem
class, both being return values from members and associated with storing
file system attributes.  Move their definitions from Utils.h into
FileSystem.h.
This commit is contained in:
Mike Fleetwood 2018-01-18 16:26:20 +00:00 committed by Curtis Gedak
parent 175d27c55d
commit a3b47ca14a
28 changed files with 74 additions and 54 deletions

View File

@ -18,7 +18,7 @@
#ifndef GPARTED_DIALOGFEATURES_H
#define GPARTED_DIALOGFEATURES_H
#include "Utils.h"
#include "FileSystem.h"
#include <gtkmm/dialog.h>
#include <gtkmm/frame.h>

View File

@ -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 <gtkmm/dialog.h>
#include <gtkmm/stock.h>

View File

@ -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
{

View File

@ -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
{

View File

@ -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,

View File

@ -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:

View File

@ -16,6 +16,7 @@
*/
#include "DialogFeatures.h"
#include "FileSystem.h"
#include "GParted_Core.h"
#include <gtkmm/stock.h>

View File

@ -16,6 +16,7 @@
*/
#include "Dialog_Partition_Copy.h"
#include "FileSystem.h"
#include "GParted_Core.h"
#include "Partition.h"
#include "Utils.h"

View File

@ -16,6 +16,7 @@
*/
#include "Dialog_Partition_New.h"
#include "FileSystem.h"
#include "GParted_Core.h"
#include "Partition.h"
#include "Utils.h"

View File

@ -16,6 +16,7 @@
*/
#include "Dialog_Partition_Resize_Move.h"
#include "FileSystem.h"
#include "GParted_Core.h"
#include "Partition.h"
#include "PartitionVector.h"

View File

@ -17,6 +17,7 @@
#include "btrfs.h"
#include "BlockSpecial.h"
#include "FileSystem.h"
#include "Mount_Info.h"
#include "Partition.h"

View File

@ -15,6 +15,7 @@
*/
#include "exfat.h"
#include "FileSystem.h"
namespace GParted
{
@ -32,4 +33,3 @@ FS exfat::get_filesystem_support()
}
} //GParted

View File

@ -16,6 +16,7 @@
*/
#include "ext2.h"
#include "FileSystem.h"
#include "OperationDetail.h"
#include "Partition.h"
#include "Utils.h"

View File

@ -15,6 +15,7 @@
*/
#include "f2fs.h"
#include "FileSystem.h"
#include "Partition.h"
namespace GParted

View File

@ -16,6 +16,7 @@
*/
#include "fat16.h"
#include "FileSystem.h"
#include "Partition.h"
/*****

View File

@ -16,6 +16,7 @@
*/
#include "hfs.h"
#include "FileSystem.h"
#include "Partition.h"
namespace GParted

View File

@ -16,6 +16,7 @@
*/
#include "hfsplus.h"
#include "FileSystem.h"
#include "Partition.h"
namespace GParted

View File

@ -16,6 +16,7 @@
*/
#include "jfs.h"
#include "FileSystem.h"
#include "Partition.h"
namespace GParted

View File

@ -17,6 +17,7 @@
#include "linux_swap.h"
#include "BlockSpecial.h"
#include "FileSystem.h"
#include "Partition.h"
#include <cerrno>

View File

@ -14,6 +14,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "FileSystem.h"
#include "LUKS_Info.h"
#include "Utils.h"
#include "luks.h"

View File

@ -14,6 +14,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "FileSystem.h"
#include "LVM2_PV_Info.h"
#include "lvm2_pv.h"
#include "Partition.h"

View File

@ -15,6 +15,7 @@
*/
#include "nilfs2.h"
#include "FileSystem.h"
#include "Partition.h"
namespace GParted

View File

@ -16,6 +16,7 @@
*/
#include "ntfs.h"
#include "FileSystem.h"
#include "OperationDetail.h"
#include "Partition.h"
#include "Utils.h"

View File

@ -16,6 +16,7 @@
*/
#include "reiser4.h"
#include "FileSystem.h"
#include "Partition.h"
namespace GParted

View File

@ -16,6 +16,7 @@
*/
#include "reiserfs.h"
#include "FileSystem.h"
#include "Partition.h"
namespace GParted

View File

@ -15,6 +15,7 @@
*/
#include "udf.h"
#include "FileSystem.h"
#include "Partition.h"
#include "Utils.h"

View File

@ -16,6 +16,7 @@
*/
#include "ufs.h"
#include "FileSystem.h"
namespace GParted
{

View File

@ -16,6 +16,7 @@
*/
#include "xfs.h"
#include "FileSystem.h"
#include "OperationDetail.h"
#include "Partition.h"
#include "Utils.h"