00001
00002
00003
00004 #ifndef _DiskAcc_h
00005 #define _DiskAcc_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
00016 class DiskAccess
00017 {
00018 public:
00019 DiskAccess(string Disk_Cv);
00020 virtual ~DiskAccess();
00021
00022 string Disk();
00023 unsigned long CylinderToKb(int Cyl_iv);
00024 int KbToCylinder(unsigned long Kb_lv);
00025 unsigned long CapacityInKb();
00026 int NumCylinder();
00027 unsigned PrimaryMax();
00028 bool Changed() { return Changed_b; };
00029 vector<PartInfo>& Partitions();
00030 string DiskLabel();
00031
00032 static string GetDiskName(string Part_Cv);
00033 static int GetPartNumber(const string& Part_Cv);
00034 static bool IsKnownDevice(const string& Part_Cv);
00035
00036
00037 virtual bool WritePartitionTable() { return false; };
00038 virtual void Delete(const unsigned Part_iv) {};
00039 virtual void DeleteAll() {};
00040 virtual bool NewPartition(const PartitionType Part_e, const unsigned Part_nr,
00041 string Von_Cv, string Bis_Cv,
00042 const unsigned Type_iv,
00043 string DefLabel_Cv ) { return false; };
00044 virtual void SetType(const unsigned Part_iv, const unsigned Type_iv) {};
00045 string Stderr();
00046
00047 protected:
00048 string GetPartDeviceName(int Num_iv);
00049 string GetPartDeviceName(int Num_iv, string Disk_Cv);
00050
00051 string Stderr_C;
00052 string Disk_C;
00053 string Label_C;
00054 int Head_i;
00055 int Cylinder_i;
00056 int Sector_i;
00057 unsigned long ByteCyl_l;
00058 bool Changed_b;
00059 bool BsdLabel_b;
00060 vector<PartInfo> Part_C;
00061 };
00062
00063 #endif