1 /* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed
2 under the terms of the GNU GPL version 2, as detailed in the COPYING file. */
7 #include <unicode/ustream.h>
9 #define UnicodeString string
15 #ifndef __PARTITION_TYPES
16 #define __PARTITION_TYPES
22 // I'm using a custom 16-bit extension of the original MBR 8-bit
23 // type codes, so as to permit disambiguation and use of new
24 // codes required by GPT
28 int display; // 1 to show to users as available type, 0 not to
32 class PartType : public GUIDData {
34 static int numInstances;
35 static AType* allTypes; // Linked list holding all the data
36 static AType* lastType; // Pointer to last entry in the list
37 void AddAllTypes(void);
40 PartType(const PartType & orig);
41 PartType(const GUIDData & orig);
44 // Set up type information
45 int AddType(uint16_t mbrType, const char * guidData, const char * name, int toDisplay = 1);
47 // New assignment operators....
48 PartType & operator=(const string & orig);
49 PartType & operator=(const char * orig);
51 // Assignment operators based on base class....
52 GUIDData & operator=(const GUIDData & orig) {return GUIDData::operator=(orig);}
54 // New data assignment
55 PartType & operator=(uint16_t ID); // Use MBR type code times 0x0100 to assign GUID
57 // Retrieve transformed GUID data based on type code matches
58 string TypeName(void) const;
59 UnicodeString UTypeName(void) const;
60 uint16_t GetHexType() const;
62 // Information relating to all type data
63 void ShowAllTypes(void) const;
64 int Valid(uint16_t code) const;