Lines Matching full:attributes
1 // attributes.cc
19 #include "attributes.h"
24 string Attributes::atNames[NUM_ATR];
25 int Attributes::numAttrs = 0;
26 //Attributes::staticInit Attributes::staticInitializer;
29 Attributes::Attributes(void) { in Attributes() function in Attributes
33 attributes = 0; in Attributes()
37 Attributes::Attributes(const uint64_t a) { in Attributes() function in Attributes
41 attributes = a; in Attributes()
45 Attributes::~Attributes(void) { in ~Attributes()
47 } // Attributes destructor in ~Attributes()
49 void Attributes::Setup(void) { in Setup()
57 Attributes::atNames[i] = temp.str(); in Setup()
67 } // Attributes::Setup() in Setup()
69 // Display current attributes to user
70 void Attributes::DisplayAttributes(void) { in DisplayAttributes()
78 cout << hex << attributes << dec << ". Set fields are:\n"; in DisplayAttributes()
80 if ((UINT64_C(1) << i) & attributes) { in DisplayAttributes()
89 } // Attributes::DisplayAttributes() in DisplayAttributes()
91 // Display attributes for a partition. Note that partNum is just passed for
93 void Attributes::ShowAttributes(const uint32_t partNum) { in ShowAttributes()
98 bitset = (UINT64_C(1) << bitNum) & attributes; in ShowAttributes()
104 } // Attributes::ShowAttributes in ShowAttributes()
107 void Attributes::ChangeAttributes(void) { in ChangeAttributes()
111 cout << "Known attributes are:\n"; in ChangeAttributes()
121 if (bitValue & attributes) { // bit is set in ChangeAttributes()
122 attributes &= ~bitValue; // so unset it in ChangeAttributes()
125 attributes |= bitValue; // so set it in ChangeAttributes()
130 } // Attributes::ChangeAttributes() in ChangeAttributes()
132 // Display all defined attributes on the screen (omits undefined bits).
133 void Attributes::ListAttributes(void) { in ListAttributes()
140 cout << bitNum << ": " << Attributes::GetAttributeName(bitNum) << "\n"; in ListAttributes()
142 } // Attributes::ListAttributes in ListAttributes()
144 // multifaceted attributes access
146 bool Attributes::OperateOnAttributes(const uint32_t partNum, const string& attributeOperator, const… in OperateOnAttributes()
150 ao_or, ao_nand, ao_xor, ao_assignall, // operate on all attributes (bitmask) in OperateOnAttributes()
166 cerr << "Unknown attributes operator: " << attributeOperator << endl; in OperateOnAttributes()
190 // assign all attributes at once in OperateOnAttributes()
191 case ao_assignall: attributes = attributeBitMask; break; in OperateOnAttributes()
195 case ao_or: attributes |= attributeBitMask; break; in OperateOnAttributes()
199 case ao_nand: attributes &= ~attributeBitMask; break; in OperateOnAttributes()
203 case ao_xor: attributes ^= attributeBitMask; break; in OperateOnAttributes()
208 << bool (attributeBitMask & attributes) << endl; in OperateOnAttributes()
216 } // Attributes::OperateOnAttributes() in OperateOnAttributes()
224 // Display attributes
225 ostream & operator<<(ostream & os, const Attributes & data) { in operator <<()