version 1.8, 2001/04/25 22:20:56
|
version 1.18.2.4, 2001/11/08 23:15:30
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM, |
|
// The Open Group, Tivoli Systems |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a |
// Permission is hereby granted, free of charge, to any person obtaining a copy |
// copy of this software and associated documentation files (the "Software"), |
// of this software and associated documentation files (the "Software"), to |
// to deal in the Software without restriction, including without limitation |
// deal in the Software without restriction, including without limitation the |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
// and/or sell copies of the Software, and to permit persons to whom the |
// sell copies of the Software, and to permit persons to whom the Software is |
// Software is furnished to do so, subject to the following conditions: |
// furnished to do so, subject to the following conditions: |
// | // |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
// DEALINGS IN THE SOFTWARE. |
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: |
// Modified By: Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// |
// Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
|
|
//////////////////////////////////////////////////////////////////////////////// |
|
// | // |
// XmlReader.h |
//%///////////////////////////////////////////////////////////////////////////// |
// |
|
//////////////////////////////////////////////////////////////////////////////// |
|
| |
#ifndef Pegasus_XmlReader_h | #ifndef Pegasus_XmlReader_h |
#define Pegasus_XmlReader_h | #define Pegasus_XmlReader_h |
|
|
class CIMProperty; | class CIMProperty; |
class CIMParameter; | class CIMParameter; |
class CIMMethod; | class CIMMethod; |
|
class CIMObject; |
|
class CIMObjectWithPath; |
|
class CIMParamValue; |
| |
class PEGASUS_COMMON_LINKAGE XmlReader | class PEGASUS_COMMON_LINKAGE XmlReader |
{ | { |
|
|
XmlParser& parser, | XmlParser& parser, |
XmlEntry& entry); | XmlEntry& entry); |
| |
|
static Boolean testXmlDeclaration ( |
|
XmlParser& parser, |
|
XmlEntry& entry); |
|
|
static Boolean testStartTag( | static Boolean testStartTag( |
XmlParser& parser, | XmlParser& parser, |
XmlEntry& entry, | XmlEntry& entry, |
|
|
| |
static void testCimStartTag(XmlParser& parser); | static void testCimStartTag(XmlParser& parser); |
| |
static Boolean getIsArrayAttribute( |
|
Uint32 lineNumber, |
|
const XmlEntry& entry, |
|
const char* tagName, |
|
Boolean& value); |
|
|
|
static String getCimNameAttribute( | static String getCimNameAttribute( |
Uint32 lineNumber, | Uint32 lineNumber, |
const XmlEntry& entry, | const XmlEntry& entry, |
|
|
CIMType type, | CIMType type, |
CIMValue& value); | CIMValue& value); |
| |
|
static Boolean getStringValueElement( |
|
XmlParser& parser, |
|
String& str, |
|
Boolean required); |
|
|
static CIMValue stringArrayToValue( | static CIMValue stringArrayToValue( |
Uint32 lineNumber, | Uint32 lineNumber, |
const Array<const char*>& array, | const Array<const char*>& array, |
|
|
String& className, | String& className, |
Boolean required = false); | Boolean required = false); |
| |
static KeyBinding::CIMType getValueTypeAttribute( |
static KeyBinding::Type getValueTypeAttribute( |
Uint32 lineNumber, | Uint32 lineNumber, |
const XmlEntry& entry, | const XmlEntry& entry, |
const char* elementName); | const char* elementName); |
| |
static Boolean getKeyValueElement( | static Boolean getKeyValueElement( |
XmlParser& parser, | XmlParser& parser, |
KeyBinding::CIMType& type, |
KeyBinding::Type& type, |
String& value); | String& value); |
| |
static Boolean getKeyBindingElement( | static Boolean getKeyBindingElement( |
XmlParser& parser, | XmlParser& parser, |
String& name, | String& name, |
String& value, | String& value, |
KeyBinding::CIMType& type); |
KeyBinding::Type& type); |
| |
static Boolean getInstanceNameElement( | static Boolean getInstanceNameElement( |
XmlParser& parser, | XmlParser& parser, |
String& className, | String& className, |
Array<KeyBinding>& keyBindings); | Array<KeyBinding>& keyBindings); |
| |
|
static Boolean getInstanceNameElement( |
|
XmlParser& parser, |
|
CIMReference& instanceName); |
|
|
static Boolean getInstancePathElement( | static Boolean getInstancePathElement( |
XmlParser& parser, | XmlParser& parser, |
CIMReference& reference); | CIMReference& reference); |
|
|
XmlParser& parser, | XmlParser& parser, |
CIMInstance& cimInstance); | CIMInstance& cimInstance); |
| |
static void getObject(XmlParser& parser, CIMClass& x) |
static void getObject(XmlParser& parser, CIMClass& x); |
{ |
|
if (!getClassElement(parser, x)) |
|
{ |
|
throw XmlValidationError(parser.getLine(), |
|
"expected CLASS element"); |
|
} |
|
} |
|
| |
static void getObject(XmlParser& parser, CIMInstance& x) |
static void getObject(XmlParser& parser, CIMInstance& x); |
{ |
|
if (!getInstanceElement(parser, x)) |
|
{ |
|
throw XmlValidationError(parser.getLine(), |
|
"expected INSTANCE element"); |
|
} |
|
} |
|
| |
static void getObject(XmlParser& parser, CIMQualifierDecl& x) |
static void getObject(XmlParser& parser, CIMQualifierDecl& x); |
{ |
|
if (!getQualifierDeclElement(parser, x)) |
|
{ |
|
throw XmlValidationError(parser.getLine(), |
|
"expected QUALIFIER.DECLARATION element"); |
|
} |
|
} |
|
| |
static Boolean getMessageStartTag( | static Boolean getMessageStartTag( |
XmlParser& parser, | XmlParser& parser, |
Uint32& id, |
String& id, |
const char*& protocolVersion); | const char*& protocolVersion); |
| |
static Boolean getIMethodCallStartTag( | static Boolean getIMethodCallStartTag( |
|
|
| |
static Boolean getErrorElement( | static Boolean getErrorElement( |
XmlParser& parser, | XmlParser& parser, |
CIMException::Code& code, |
CIMStatusCode& code, |
const char*& description, | const char*& description, |
Boolean required = false); | Boolean required = false); |
| |
|
static Boolean getObjectWithPath( |
|
XmlParser& parser, |
|
CIMObjectWithPath& objectWithPath); |
|
|
|
static Boolean getObjectNameElement( |
|
XmlParser& parser, |
|
CIMReference& objectName); |
|
|
|
static Boolean getObjectPathElement( |
|
XmlParser& parser, |
|
CIMReference& objectPath); |
|
|
|
static Boolean getEMethodCallStartTag( |
|
XmlParser& parser, |
|
const char*& name); |
|
|
|
static Boolean getEMethodResponseStartTag( |
|
XmlParser& parser, |
|
const char*& name); |
|
|
|
static Boolean getMethodCallStartTag( |
|
XmlParser& parser, |
|
const char*& name); |
|
|
|
static Boolean getMethodResponseStartTag( |
|
XmlParser& parser, |
|
const char*& name); |
|
|
|
static Boolean getParamValueTag( |
|
XmlParser& parser, |
|
const char*& name); |
|
|
private: | private: |
| |
XmlReader() | XmlReader() |