version 1.7, 2001/06/16 23:10:00
|
version 1.16, 2002/05/07 00:00:35
|
|
|
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
#include <Pegasus/Common/Config.h> |
#include <cstdio> | #include <cstdio> |
#include "CIMParameter.h" | #include "CIMParameter.h" |
|
#include "CIMParameterRep.h" |
#include "Indentor.h" | #include "Indentor.h" |
#include "CIMName.h" | #include "CIMName.h" |
#include "CIMScope.h" | #include "CIMScope.h" |
|
|
nameSpace, | nameSpace, |
CIMScope::PARAMETER, | CIMScope::PARAMETER, |
false, | false, |
dummy); |
dummy, |
|
true); |
} | } |
| |
void CIMParameterRep::toXml(Array<Sint8>& out) const | void CIMParameterRep::toXml(Array<Sint8>& out) const |
|
|
| |
out << "</PARAMETER.ARRAY>\n"; | out << "</PARAMETER.ARRAY>\n"; |
} | } |
|
else if (_type == CIMType::REFERENCE) |
|
{ |
|
out << "<PARAMETER.REFERENCE"; |
|
out << " NAME=\"" << _name << "\" "; |
|
out << " REFERENCECLASS=\"" << _referenceClassName << "\""; |
|
out << ">\n"; |
|
|
|
_qualifiers.toXml(out); |
|
|
|
out << "</PARAMETER.REFERENCE>\n"; |
|
} |
else | else |
{ | { |
out << "<PARAMETER"; | out << "<PARAMETER"; |
|
|
out << " NAME=\"" << _name << "\" "; | out << " NAME=\"" << _name << "\" "; |
|
|
out << " TYPE=\"" << TypeToString(_type) << "\""; | out << " TYPE=\"" << TypeToString(_type) << "\""; |
|
|
out << ">\n"; | out << ">\n"; |
| |
_qualifiers.toXml(out); | _qualifiers.toXml(out); |
|
|
} | } |
} | } |
| |
|
/** toMof - puts the Mof representation of teh Parameter object to |
|
the output parameter array |
|
The BNF for this conversion is: |
|
parameterList = parameter *( "," parameter ) |
|
|
|
parameter = [ qualifierList ] (dataType|objectRef) parameterName |
|
[ array ] |
|
|
|
parameterName= IDENTIFIER |
|
|
|
array = "[" [positiveDecimalValue] "]" |
|
|
|
Format on a single line. |
|
*/ |
|
void CIMParameterRep::toMof(Array<Sint8>& out) const |
|
{ |
|
// Output the qualifiers for the parameter |
|
_qualifiers.toMof(out); |
|
|
|
if (_qualifiers.getCount()) |
|
out << " "; |
|
|
|
// Output the data type and name |
|
out << TypeToString(_type) << " " << _name; |
|
|
|
if (_isArray) |
|
{ |
|
//Output the array indicator "[ [arraysize] ]" |
|
if (_arraySize) |
|
{ |
|
char buffer[32]; |
|
sprintf(buffer, "[%d]", _arraySize); |
|
out << buffer; |
|
} |
|
else |
|
out << "[]"; |
|
} |
|
} |
|
|
|
|
void CIMParameterRep::print(PEGASUS_STD(ostream) &os) const | void CIMParameterRep::print(PEGASUS_STD(ostream) &os) const |
{ | { |
Array<Sint8> tmp; | Array<Sint8> tmp; |
|
|
x._qualifiers.cloneTo(_qualifiers); | x._qualifiers.cloneTo(_qualifiers); |
} | } |
| |
CIMParameterRep& CIMParameterRep::operator=(const CIMParameterRep& x) |
|
{ |
|
return *this; |
|
} |
|
|
|
void CIMParameterRep::setType(CIMType type) | void CIMParameterRep::setType(CIMType type) |
{ | { |
_type = type; | _type = type; |