00001
00002
00003
00004 #ifndef _PartedAcc_h
00005 #define _PartedAcc_h
00006
00007
00008 #include <string>
00009 #include <vector>
00010
00011 using std::vector;
00012
00013 #include "PartInfo.defs.h"
00014 #include "SystemCmd.h"
00015 #include "DiskAcc.h"
00016
00017 class PartedAccess : public DiskAccess
00018 {
00019 public:
00020 PartedAccess(string Disk_Cv, bool Readonly_bv);
00021 virtual ~PartedAccess();
00022 virtual bool WritePartitionTable() { return false; };
00023 virtual void Delete(const unsigned Part_iv);
00024 virtual void DeleteAll();
00025 virtual bool Init( const string& label_Cv );
00026 virtual bool NewPartition(const PartitionType Part_e, const unsigned Part_nr,
00027 string Von_Cv, string Bis_Cv,
00028 const unsigned Type_iv, string DefLabel_Cv );
00029 bool Resize( const unsigned Part_iv, const unsigned NewLastCyl_iv );
00030 virtual void SetType(const unsigned Part_iv, const unsigned Type_iv);
00031
00032 protected:
00033 void CheckError( const string& CmdString_Cv, SystemCmd& Cmd_C );
00034
00035 string GetPartitionNumber(int Part_iv);
00036 void CheckOutput(SystemCmd& Cmd_C, string Pat_Cv);
00037 bool ScanLine(string Line_Cv, PartInfo& Part_rr);
00038 void GetPartitionList( bool OnlyLabel_bv );
00039 };
00040
00041 #endif