1 /* mbr.h -- MBR data structure definitions, types, and functions */ 2 3 /* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed 4 under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ 5 6 #include <stdint.h> 7 #include <sys/types.h> 8 #include "gptpart.h" 9 //#include "partnotes.h" 10 #include "diskio.h" 11 #include "basicmbr.h" 12 13 #ifndef __MBRSTRUCTS 14 #define __MBRSTRUCTS 15 16 using namespace std; 17 18 /**************************************** 19 * * 20 * MBRData class and related structures * 21 * * 22 ****************************************/ 23 24 // Full data in tweaked MBR format 25 class MBRData : public BasicMBRData { 26 protected: 27 public: 28 MBRData(void) {} 29 MBRData(string deviceFilename) : BasicMBRData(deviceFilename) {} 30 MBRData & operator=(const BasicMBRData & orig); 31 32 // Functions to create, delete, or change partitions 33 // Pass EmptyMBR 1 to clear the boot loader code, 0 to leave it intact 34 void MakeProtectiveMBR(int clearBoot = 0); 35 void OptimizeEESize(void); 36 int DeleteByLocation(uint64_t start64, uint64_t length64); 37 38 // Functions to extract data on specific partitions.... 39 GPTPart AsGPT(int i); 40 }; // struct MBRData 41 42 #endif 43