00001
00002
00003
00004 #ifndef _FdiskAcc_h
00005 #define _FdiskAcc_h
00006
00007
00008 #include <string>
00009 #include <vector>
00010
00011 using std::vector;
00012
00013 class InterCmd;
00014
00015 #include "PartInfo.defs.h"
00016 #include "SystemCmd.h"
00017 #include "DiskAcc.h"
00018
00019 class FdiskAccess : public DiskAccess
00020 {
00021 public:
00022 FdiskAccess(string Disk_Cv, bool Readonly_bv);
00023 virtual ~FdiskAccess();
00024 virtual bool WritePartitionTable();
00025 virtual void SetType(const unsigned Part_iv, const unsigned Type_iv);
00026 virtual void Delete(const unsigned Part_iv);
00027 virtual bool NewPartition(const PartitionType Part_e, const unsigned Part_nr,
00028 string Von_Cv, string Bis_Cv,
00029 const unsigned Type_iv, string DefLabel_Cv );
00030 virtual void DeleteAll();
00031
00032 protected:
00033 string GetPartitionNumber(int Part_iv);
00034 void SendQuit();
00035 void CheckOutput(SystemCmd& Cmd_C, string Pat_Cv);
00036 void CheckOutputStd(SystemCmd& Cmd_C, string Disk_Cv);
00037 void CheckOutputBsd(SystemCmd& Cmd_C, string Disk_Cv);
00038 bool IsBsdLine(string Line_Cv);
00039 bool IsPdiskLine(string Line_Cv);
00040 void ScanFdiskLine(string Line_Cv, PartInfo& Part_rr);
00041 void ScanPdiskLine(string Line_Cv, PartInfo& Part_rr, string Disk_Cv);
00042 void ScanBsdLine(string Line_Cv, PartInfo& Part_rr, string Disk_Cv);
00043 void SetTypeStd(const unsigned Part_iv, const unsigned Type_iv);
00044 void SetTypeBsd(const unsigned Part_iv, const unsigned Type_iv);
00045 bool NewPartitionStd(const PartitionType Part_e,
00046 const unsigned Part_nr, string Von_Cv,
00047 string Bis_Cv);
00048 bool NewPartitionBsd(const unsigned Part_nr, string Von_Cv,
00049 string Bis_Cv);
00050 void CheckWritable();
00051 void SendPrint();
00052 InterCmd *Fdisk_pC;
00053 };
00054
00055 #endif