version 1.7, 2001/04/13 21:53:47
|
version 1.10, 2001/04/26 01:34:11
|
|
|
//BEGIN_LICENSE |
//%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM | // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM |
// | // |
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
// DEALINGS IN THE SOFTWARE. | // DEALINGS IN THE SOFTWARE. |
// | // |
//END_LICENSE |
//============================================================================== |
//BEGIN_HISTORY |
|
// | // |
// Author: |
// Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// $Log$ |
// Modified By: |
// Revision 1.7 2001/04/13 21:53:47 karl |
|
// add get and set property |
|
// | // |
// Revision 1.6 2001/04/08 01:13:22 mike |
//%///////////////////////////////////////////////////////////////////////////// |
// Changed "ConstCIM" to "CIMConst" |
|
// |
|
// Revision 1.4 2001/02/26 04:33:28 mike |
|
// Fixed many places where cim names were be compared with operator==(String,String). |
|
// Changed all of these to use CIMName::equal() |
|
// |
|
// Revision 1.3 2001/02/19 01:47:16 mike |
|
// Renamed names of the form CIMConst to CIMConst. |
|
// |
|
// Revision 1.2 2001/02/16 02:06:07 mike |
|
// Renamed many classes and headers. |
|
// |
|
// Revision 1.1.1.1 2001/01/14 19:53:32 mike |
|
// Pegasus import |
|
// |
|
// |
|
//END_HISTORY |
|
| |
#include <cassert> | #include <cassert> |
#include <cctype> | #include <cctype> |
|
|
#include "CIMInstance.h" | #include "CIMInstance.h" |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
//debug |
|
#include <iostream> |
|
using namespace std; |
| |
static const Uint32 MESSAGE_SIZE = 128; | static const Uint32 MESSAGE_SIZE = 128; |
| |
|
|
// Get VALUE start tag: | // Get VALUE start tag: |
| |
XmlEntry entry; | XmlEntry entry; |
|
|
if (!testStartTagOrEmptyTag(parser, entry, "VALUE")) | if (!testStartTagOrEmptyTag(parser, entry, "VALUE")) |
return false; | return false; |
| |
|
|
// Get VALUE content: | // Get VALUE content: |
| |
const char* valueString = ""; | const char* valueString = ""; |
|
// cout << "DEBUG XMLReader:getValueElement " << __LINE__ ; |
| |
if (!empty) | if (!empty) |
{ | { |
if (testContentOrCData(parser, entry)) | if (testContentOrCData(parser, entry)) |
valueString = entry.text; | valueString = entry.text; |
|
//cout << "DEBUG XMLReader:getValueElement " << __LINE__ |
|
// << " valueString " << valueString ; |
| |
expectEndTag(parser, "VALUE"); | expectEndTag(parser, "VALUE"); |
} | } |
| |
value = stringToValue(parser.getLine(), valueString,type); | value = stringToValue(parser.getLine(), valueString,type); |
|
//cout << "DEBUG XMLReader:getValueElement " << __LINE__ |
|
// << " value " << value; |
return true; | return true; |
} | } |
| |
|
|
//---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- |
// | // |
// getPropertyValue | // getPropertyValue |
|
// Use: Decode property value from getPropertyResponse |
// Expect (ERROR|IRETURNVALUE).!ELEMENT VALUE (#PCDATA)> | // Expect (ERROR|IRETURNVALUE).!ELEMENT VALUE (#PCDATA)> |
// | // |
// PropertyValue: | // PropertyValue: |
|
|
{ | { |
//Test for Element value type | //Test for Element value type |
CIMType type = CIMType::STRING; | CIMType type = CIMType::STRING; |
|
|
if (XmlReader::getValueElement(parser, type, cimValue)) | if (XmlReader::getValueElement(parser, type, cimValue)) |
|
{ |
|
//cout << "DEBUG xmlReader::getPropertyValue " << __LINE__ |
|
// << " CimValue = " << cimValue.toString << endl; |
return true; | return true; |
|
} |
| |
//Test for Element.array value | //Test for Element.array value |
if(XmlReader::getValueArrayElement(parser, type, cimValue)) | if(XmlReader::getValueArrayElement(parser, type, cimValue)) |
|
|
// | // |
//------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
| |
KeyBinding::CIMType XmlReader::getValueTypeAttribute( |
KeyBinding::Type XmlReader::getValueTypeAttribute( |
Uint32 lineNumber, | Uint32 lineNumber, |
const XmlEntry& entry, | const XmlEntry& entry, |
const char* elementName) | const char* elementName) |
|
|
| |
Boolean XmlReader::getKeyValueElement( | Boolean XmlReader::getKeyValueElement( |
XmlParser& parser, | XmlParser& parser, |
KeyBinding::CIMType& type, |
KeyBinding::Type& type, |
String& value) | String& value) |
{ | { |
XmlEntry entry; | XmlEntry entry; |
|
|
XmlParser& parser, | XmlParser& parser, |
String& name, | String& name, |
String& value, | String& value, |
KeyBinding::CIMType& type) |
KeyBinding::Type& type) |
{ | { |
XmlEntry entry; | XmlEntry entry; |
| |
|
|
if (!empty) | if (!empty) |
{ | { |
String name; | String name; |
KeyBinding::CIMType type; |
KeyBinding::Type type; |
String value; | String value; |
| |
while (getKeyBindingElement(parser, name, value, type)) | while (getKeyBindingElement(parser, name, value, type)) |
|
|
return true; | return true; |
} | } |
| |
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
// | // |
// getErrorElement() | // getErrorElement() |