2004-11-17 06:00:25 -07:00
|
|
|
/* Copyright (C) 2004 Bart
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GPARTED_CORE
|
|
|
|
#define GPARTED_CORE
|
|
|
|
|
|
|
|
#include "../include/Operation.h"
|
|
|
|
#include "../include/ext2.h"
|
|
|
|
#include "../include/ext3.h"
|
|
|
|
#include "../include/fat16.h"
|
|
|
|
#include "../include/fat32.h"
|
|
|
|
#include "../include/linux_swap.h"
|
|
|
|
#include "../include/reiserfs.h"
|
2004-11-23 09:20:59 -07:00
|
|
|
#include "../include/ntfs.h"
|
2004-11-17 06:00:25 -07:00
|
|
|
|
|
|
|
#include <glibmm/ustring.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
namespace GParted
|
|
|
|
{
|
|
|
|
|
|
|
|
class GParted_Core
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GParted_Core( ) ;
|
|
|
|
void find_supported_filesystems( ) ;
|
|
|
|
void get_devices( std::vector<Device> & devices, bool deep_scan ) ;
|
2004-11-19 04:55:38 -07:00
|
|
|
|
2004-11-21 14:49:38 -07:00
|
|
|
int get_estimated_time( const Operation & operation ) ;
|
2004-11-17 06:00:25 -07:00
|
|
|
|
|
|
|
void Apply_Operation_To_Disk( Operation & operation );
|
|
|
|
|
|
|
|
bool Create( const Glib::ustring & device_path, Partition & new_partition ) ;
|
|
|
|
bool Convert_FS( const Glib::ustring & device_path, const Partition & partition ) ;
|
|
|
|
bool Delete( const Glib::ustring & device_path, const Partition & partition ) ;
|
|
|
|
bool Resize( const Glib::ustring & device_path, const Partition & partition_old, const Partition & partition_new ) ;
|
|
|
|
bool Copy( const Glib::ustring & dest_device_path, const Glib::ustring & src_part_path, Partition & partition_dest ) ;
|
|
|
|
|
2004-11-27 16:31:19 -07:00
|
|
|
bool Set_Disklabel( const Glib::ustring & device_path, const Glib::ustring & disklabel ) ;
|
|
|
|
|
2004-11-17 06:00:25 -07:00
|
|
|
std::vector<FS> get_fs( ) ;
|
|
|
|
Glib::RefPtr<Gtk::TextBuffer> get_textbuffer( ) ;
|
|
|
|
|
|
|
|
private:
|
2004-11-19 04:55:38 -07:00
|
|
|
void set_device_partitions( Device & device, bool deep_scan = true ) ;
|
2004-11-17 06:00:25 -07:00
|
|
|
Glib::ustring get_sym_path( const Glib::ustring & real_path ) ;
|
2004-11-21 14:49:38 -07:00
|
|
|
void Set_Used_Sectors( Partition & partition );
|
2004-11-17 06:00:25 -07:00
|
|
|
Glib::ustring Get_Flags( PedPartition *c_partition ) ;
|
2004-11-19 04:55:38 -07:00
|
|
|
int Create_Empty_Partition( const Glib::ustring & device_path, Partition & new_partition, bool copy = false ) ;
|
2004-11-24 03:32:56 -07:00
|
|
|
bool Resize_Container_Partition( const Glib::ustring & device_path, const Partition & partition_old, const Partition & partition_new, bool fixed_start = true ) ;
|
2004-11-21 14:49:38 -07:00
|
|
|
bool Resize_Normal_Using_Libparted( const Glib::ustring & device_path, const Partition & partition_old, const Partition & partition_new ) ;
|
2004-11-17 06:00:25 -07:00
|
|
|
|
|
|
|
void Show_Error( Glib::ustring message ) ;
|
|
|
|
void set_proper_filesystem( const Glib::ustring & filesystem ) ;
|
2004-11-21 14:49:38 -07:00
|
|
|
long Get_Cylinder_Size( const Glib::ustring & device_path ) ;
|
2004-11-17 06:00:25 -07:00
|
|
|
|
|
|
|
Glib::RefPtr<Gtk::TextBuffer> textbuffer;
|
|
|
|
|
|
|
|
std::vector<FS> FILESYSTEMS ;
|
|
|
|
FileSystem * p_filesystem ;
|
|
|
|
std::vector <PedPartitionFlag> flags;
|
|
|
|
PedDevice *device ;
|
|
|
|
PedDisk *disk ;
|
|
|
|
PedPartition *c_partition ;
|
|
|
|
Glib::ustring temp ;
|
|
|
|
};
|
|
|
|
|
|
|
|
} //GParted
|
|
|
|
|
|
|
|
|
|
|
|
#endif //GPARTED_CORE
|