version 1.16, 2002/03/25 16:27:51
|
version 1.17, 2002/03/28 02:57:55
|
|
|
_flavor(flavor), | _flavor(flavor), |
_propagated(propagated) | _propagated(propagated) |
{ | { |
|
//cout << "KSTEST Qualifer create " << name << " Flavor " << flavor << endl; |
if (!CIMName::legal(name)) | if (!CIMName::legal(name)) |
throw IllegalName(); | throw IllegalName(); |
| |
|
|
_name = name; | _name = name; |
} | } |
| |
|
void CIMQualifierRep::resolveFlavor(Uint32 inheritedFlavor, Boolean inherited) |
|
{ |
|
// ATTN: KS P3 Needs more tests and expansion so we treate first different |
|
// from inheritance |
|
|
|
// if the turnoff flags set, reset the functions. |
|
if((inheritedFlavor & CIMFlavor::RESTRICTED) != 0) { |
|
unsetFlavor(CIMFlavor::TOSUBCLASS + CIMFlavor::TOINSTANCE); |
|
} |
|
if((inheritedFlavor & CIMFlavor::DISABLEOVERRIDE)) { |
|
unsetFlavor(CIMFlavor::ENABLEOVERRIDE); |
|
} |
|
|
|
_flavor = inheritedFlavor | _flavor; |
|
} |
|
|
static const char* _toString(Boolean x) | static const char* _toString(Boolean x) |
{ | { |
return x ? "true" : "false"; | return x ? "true" : "false"; |
|
|
| |
/* If the qualifier is Boolean, we do not put out a value. This is | /* If the qualifier is Boolean, we do not put out a value. This is |
the way MOF is shown. Note that we should really be checking | the way MOF is shown. Note that we should really be checking |
the qualifierdecl to compare with the default but the defaults |
the qualifierdecl to compare with the default. |
on the current ones are all false so the existence of the qualifier |
|
implies true. |
|
Also if the value is Null, we do not put out a value because | Also if the value is Null, we do not put out a value because |
no value has been set. Assumes that qualifiers are built | no value has been set. Assumes that qualifiers are built |
with NULL set if no value has been placed in the qualifier. | with NULL set if no value has been placed in the qualifier. |
*/ | */ |
Boolean hasValueField = false; | Boolean hasValueField = false; |
if (!_value.isNull() || !(_value.getType() == CIMType::BOOLEAN) ) |
if (!_value.isNull()) |
|
{ |
|
if (_value.getType() == CIMType::BOOLEAN) |
|
{ |
|
Boolean b; |
|
_value.get(b); |
|
if(!b) |
|
out << " (false)"; |
|
} |
|
else |
{ | { |
out << " ("; | out << " ("; |
hasValueField = true; | hasValueField = true; |
_value.toMof(out); | _value.toMof(out); |
|
out << ")"; |
|
} |
} | } |
| |
// output the flavors | // output the flavors |
// ATTN: KS P3 This is a poor test to see if flavor output exists |
|
String flavorString; | String flavorString; |
flavorString = FlavorToMof(_flavor); | flavorString = FlavorToMof(_flavor); |
if (flavorString.size()) | if (flavorString.size()) |
{ | { |
if (hasValueField == false) |
|
out << " ("; |
|
out << " : "; | out << " : "; |
out << flavorString; | out << flavorString; |
hasValueField = true; |
|
//FlavorToMof(out, _flavor); |
|
} | } |
|
|
if (hasValueField) |
|
out << ")"; |
|
} | } |
| |
void CIMQualifierRep::printMof(PEGASUS_STD(ostream) &os) const | void CIMQualifierRep::printMof(PEGASUS_STD(ostream) &os) const |