blob: 34cf258287f4d2d8f7a88d6937f7e3633ef70bfb [file] [log] [blame]
srs5694221e0872009-08-29 15:00:31 -04001/* 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. */
3
srs5694e7b4ff92009-08-18 13:16:10 -04004#include <stdint.h>
srs56949ddc14b2010-08-22 22:44:42 -04005#include <string>
srs5694e7b4ff92009-08-18 13:16:10 -04006
7#ifndef __GPT_ATTRIBUTES
8#define __GPT_ATTRIBUTES
9
10#define NUM_ATR 64 /* # of attributes -- 64, since it's a 64-bit field */
11#define ATR_NAME_SIZE 25 /* maximum size of attribute names */
12
13using namespace std;
14
15class Attributes {
srs56949ddc14b2010-08-22 22:44:42 -040016
17private:
18 class staticInit {public: staticInit (void);};
19 static string atNames[NUM_ATR];
20 static Attributes::staticInit staticInitializer;
21
srs5694e7b4ff92009-08-18 13:16:10 -040022protected:
23 uint64_t attributes;
srs56949ddc14b2010-08-22 22:44:42 -040024
srs5694e7b4ff92009-08-18 13:16:10 -040025public:
srs56949ddc14b2010-08-22 22:44:42 -040026 Attributes(const uint64_t a = 0) {SetAttributes (a);}
srs5694e7b4ff92009-08-18 13:16:10 -040027 ~Attributes(void);
srs56949ddc14b2010-08-22 22:44:42 -040028 void SetAttributes(const uint64_t a) {attributes = a;}
srs5694e7b4ff92009-08-18 13:16:10 -040029 uint64_t GetAttributes(void) {return attributes;}
30 void DisplayAttributes(void);
31 void ChangeAttributes(void);
srs56949ddc14b2010-08-22 22:44:42 -040032 void ShowAttributes(const uint32_t partNum);
33 bool OperateOnAttributes(const uint32_t partNum, const string& attributeOperator, const string& attributeBits);
34
35 static const string& GetAttributeName(const uint32_t bitNum) {return atNames [bitNum];}
36 static void ListAttributes(void);
srs5694e7b4ff92009-08-18 13:16:10 -040037}; // class Attributes
38
39#endif