• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* This program is copyright (c) 2009-2011 by Roderick W. Smith. It is distributed
2   under the terms of the GNU GPL version 2, as detailed in the COPYING file. */
3 
4 #ifndef __GPT_ATTRIBUTES
5 #define __GPT_ATTRIBUTES
6 
7 #include <stdint.h>
8 #include <string>
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 
13 class Attributes {
14 protected:
15    static std::string atNames[NUM_ATR];
16    static int numAttrs;
17    void Setup(void);
18    uint64_t attributes;
19 
20 public:
21    Attributes(void);
22    Attributes(const uint64_t a);
23    ~Attributes(void);
24    void operator=(uint64_t a) {attributes = a;}
25 
GetAttributes(void)26    uint64_t GetAttributes(void) const {return attributes;}
27    void DisplayAttributes(void);
28    void ShowAttributes(const uint32_t partNum);
29 
30    void ChangeAttributes(void);
31    bool OperateOnAttributes(const uint32_t partNum, const std::string& attributeOperator, const std::string& attributeBits);
32 
GetAttributeName(const uint32_t bitNum)33    static const std::string& GetAttributeName(const uint32_t bitNum) {return atNames [bitNum];}
34    static void ListAttributes(void);
35 }; // class Attributes
36 
37 std::ostream & operator<<(std::ostream & os, const Attributes & data);
38 
39 #endif
40