version 1.2.4.3, 2014/03/31 22:46:03
|
version 1.3, 2011/01/25 11:24:24
|
|
|
| |
#include "CIMInternalXmlEncoder.h" | #include "CIMInternalXmlEncoder.h" |
#include "XmlWriter.h" | #include "XmlWriter.h" |
#include "Tracer.h" |
|
|
|
/* |
|
FUTURE. The functions _putXMLInstance and _putXMLNamedInstance are the |
|
same except for the wrapper around the object path. First, in at |
|
least some cases, the xml output removes this (CIM CIMResponseData and |
|
second we could simplify by making one function with a flag to |
|
add the wrapper. However. Should coordinate functions names, etc. with |
|
SCMO. Finally, there is a XmlWriter::appendValueReferenceElement which |
|
does the same as the internal function |
|
KS 28 March 2014. I am not touching this until we sort out all the |
|
paths and get pull running correctly. This goes through to many |
|
paths adding and removing the value.reference entity. |
|
*/ |
|
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
Boolean includeClassOrigin, | Boolean includeClassOrigin, |
const CIMPropertyList& propertyList) | const CIMPropertyList& propertyList) |
{ | { |
|
|
PEG_METHOD_ENTER(TRC_PROVIDERAGENT, "_putXMLInstance"); |
|
if (ci.isUninitialized()) | if (ci.isUninitialized()) |
{ | { |
out.putUint32(0); | out.putUint32(0); |
|
|
} | } |
else | else |
{ | { |
// add ValueReferenceElement |
XmlWriter::appendValueReferenceElement(buf, cop, true); |
XmlWriter::appendValueReferenceElement(buf, cop, false); |
|
buf.append('\0'); | buf.append('\0'); |
| |
out.putUint32(buf.size()); | out.putUint32(buf.size()); |
|
|
out.putNamespaceName(cop.getNameSpace()); | out.putNamespaceName(cop.getNameSpace()); |
} | } |
} | } |
PEG_METHOD_EXIT(); |
|
} | } |
// Same as _putXMLInstance except this function maps the objectPath directly |
|
// appendInstanceNameElement whereas _putXMLInstance maps it to |
|
// appendValueReferenceElement |
|
void CIMInternalXmlEncoder::_putXMLNamedInstance( | void CIMInternalXmlEncoder::_putXMLNamedInstance( |
CIMBuffer& out, | CIMBuffer& out, |
const CIMInstance& ci, | const CIMInstance& ci, |
|
|
Boolean includeClassOrigin, | Boolean includeClassOrigin, |
const CIMPropertyList& propertyList) | const CIMPropertyList& propertyList) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERAGENT, "_putXMLNamedInstance"); |
|
if (ci.isUninitialized()) | if (ci.isUninitialized()) |
{ | { |
out.putUint32(0); | out.putUint32(0); |
|
|
out.putNamespaceName(cop.getNameSpace()); | out.putNamespaceName(cop.getNameSpace()); |
} | } |
} | } |
PEG_METHOD_EXIT(); |
|
} | } |
| |
void CIMInternalXmlEncoder::_putXMLObject( | void CIMInternalXmlEncoder::_putXMLObject( |
|
|
Boolean includeClassOrigin, | Boolean includeClassOrigin, |
const CIMPropertyList& propertyList) | const CIMPropertyList& propertyList) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERAGENT, "_putXMLObject"); |
|
if (co.isUninitialized()) | if (co.isUninitialized()) |
{ | { |
out.putUint32(0); | out.putUint32(0); |
|
|
out.putNamespaceName(cop.getNameSpace()); | out.putNamespaceName(cop.getNameSpace()); |
} | } |
} | } |
PEG_METHOD_EXIT(); |
|
} | } |
| |
// Calls appendInstanceName the other calls appendValueReference |
|
// This is a shortcut function that puts VALUE.REFERENCE around |
|
// InstanceNameElement directly. It bypasses host and namespace components |
|
// and assumes that it is an instance. Note mechanisms above to add |
|
// host and namespace info different per function |
|
void CIMInternalXmlEncoder::_appendValueReferenceElement( | void CIMInternalXmlEncoder::_appendValueReferenceElement( |
Buffer& out, | Buffer& out, |
const CIMObjectPath& reference) | const CIMObjectPath& reference) |