version 1.24.2.1, 2005/12/30 22:01:01
|
version 1.32, 2008/10/22 08:19:40
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
|
// |
|
// Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
|
// David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <cstdio> | #include <cstdio> |
#include "XmlWriter.h" |
|
#include "CIMParamValueRep.h" | #include "CIMParamValueRep.h" |
#include "StrLit.h" | #include "StrLit.h" |
| |
|
|
String parameterName, | String parameterName, |
CIMValue value, | CIMValue value, |
Boolean isTyped) | Boolean isTyped) |
: _parameterName(parameterName), _value(value), _isTyped(isTyped) |
: _parameterName(parameterName), _value(value), _isTyped(isTyped), |
|
_refCounter(1) |
{ | { |
// ensure parameterName is not null | // ensure parameterName is not null |
if(parameterName.size() == 0) | if(parameterName.size() == 0) |
|
|
} | } |
} | } |
| |
CIMParamValueRep::~CIMParamValueRep() |
|
{ |
|
} |
|
|
|
//------------------------------------------------------------------------------ |
|
// |
|
// <!ELEMENT PARAMVALUE (VALUE|VALUE.REFERENCE|VALUE.ARRAY|VALUE.REFARRAY)?> |
|
// <!ATTLIST PARAMVALUE |
|
// %CIMName; |
|
// %EmbeddedObject; #IMPLIED |
|
// %ParamType;> |
|
// |
|
//------------------------------------------------------------------------------ |
|
void CIMParamValueRep::toXml(Buffer& out) const |
|
{ |
|
out << STRLIT("<PARAMVALUE NAME=\"") << _parameterName; |
|
out.append('"'); |
|
|
|
CIMType type = _value.getType(); |
|
|
|
if (_isTyped) |
|
{ |
|
// If the property type is CIMObject, then |
|
// encode the property in CIM-XML as a string with the EMBEDDEDOBJECT attribute |
|
// (there is not currently a CIM-XML "object" datatype) |
|
// else |
|
// output the real type |
|
if (type == CIMTYPE_OBJECT) |
|
{ |
|
out << STRLIT(" PARAMTYPE=\"string\" EMBEDDEDOBJECT=\"object\""); |
|
} |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
else if (type == CIMTYPE_INSTANCE) |
|
{ |
|
out << STRLIT(" PARAMTYPE=\"string\""); |
|
out << STRLIT(" EMBEDDEDOBJECT=\"instance\""); |
|
} |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
else |
|
{ |
|
out << STRLIT(" PARAMTYPE=\"") << cimTypeToString (type); |
|
out.append('"'); |
|
} |
|
} |
|
|
|
out << STRLIT(">\n"); |
|
XmlWriter::appendValueElement(out, _value); |
|
|
|
out << STRLIT("</PARAMVALUE>\n"); |
|
} |
|
|
|
CIMParamValueRep::CIMParamValueRep() |
|
{ |
|
} |
|
|
|
CIMParamValueRep::CIMParamValueRep(const CIMParamValueRep& x) : | CIMParamValueRep::CIMParamValueRep(const CIMParamValueRep& x) : |
Sharable(), |
|
_parameterName(x._parameterName), | _parameterName(x._parameterName), |
_value(x._value), | _value(x._value), |
_isTyped(x._isTyped) |
_isTyped(x._isTyped), |
|
_refCounter(1) |
{ | { |
} | } |
| |