(file) Return to XmlReader.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/XmlReader.h between version 1.21 and 1.57

version 1.21, 2002/02/20 03:51:30 version 1.57, 2009/02/05 05:44:05
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 //  
 // 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 copy  // Licensed to The Open Group (TOG) under one or more contributor license
 // of this software and associated documentation files (the "Software"), to  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // deal in the Software without restriction, including without limitation the  // this work for additional information regarding copyright ownership.
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  // Each contributor licenses this file to you under the OpenPegasus Open
 // sell copies of the Software, and to permit persons to whom the Software is  // Source License; you may not use this file except in compliance with the
 // furnished to do so, subject to the following conditions:  // License.
 // //
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  // Permission is hereby granted, free of charge, to any person obtaining a
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  // copy of this software and associated documentation files (the "Software"),
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  // to deal in the Software without restriction, including without limitation
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  // and/or sell copies of the Software, and to permit persons to whom the
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  // Software is furnished to do so, subject to the following conditions:
 // 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.  
 // //
 //==============================================================================  // The above copyright notice and this permission notice shall be included
   // in all copies or substantial portions of the Software.
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 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.
 // //
 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company  //////////////////////////////////////////////////////////////////////////
 //                  (carolann_graves@hp.com)  
 //              Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)  
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 37 
Line 36 
 #include <Pegasus/Common/XmlParser.h> #include <Pegasus/Common/XmlParser.h>
 #include <Pegasus/Common/CIMFlavor.h> #include <Pegasus/Common/CIMFlavor.h>
 #include <Pegasus/Common/CIMScope.h> #include <Pegasus/Common/CIMScope.h>
 #include <Pegasus/Common/CIMReference.h>  #include <Pegasus/Common/CIMType.h>
   #include <Pegasus/Common/CIMObjectPath.h>
   #include <Pegasus/Common/Linkage.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 49 
Line 50 
 class CIMParameter; class CIMParameter;
 class CIMMethod; class CIMMethod;
 class CIMObject; class CIMObject;
 class CIMNamedInstance;  
 class CIMObjectWithPath;  
 class CIMParamValue; class CIMParamValue;
   class CIMValue;
   
   struct CharString
   {
       const char *value;
       Uint32 length;
       CharString(const char *value, Uint32 length) :
           value(value), length(length)
       {
       }
   };
  
 class PEGASUS_COMMON_LINKAGE XmlReader class PEGASUS_COMMON_LINKAGE XmlReader
 { {
 public: public:
  
     static void expectXmlDeclaration(      static void getXmlDeclaration(
           XmlParser& parser,
           const char*& xmlVersion,
           const char*& xmlEncoding);
   
       static Boolean testXmlDeclaration(
         XmlParser& parser,         XmlParser& parser,
         XmlEntry& entry);         XmlEntry& entry);
  
Line 75 
Line 90 
         XmlEntry& entry,         XmlEntry& entry,
         const char* tagName);         const char* tagName);
  
     static Boolean expectContentOrCData(      static void skipElement(
         XmlParser& parser,         XmlParser& parser,
         XmlEntry& entry);         XmlEntry& entry);
  
     static Boolean testXmlDeclaration (      static Boolean expectContentOrCData(
       XmlParser& parser,       XmlParser& parser,
       XmlEntry& entry);       XmlEntry& entry);
  
Line 97 
Line 112 
         XmlEntry& entry,         XmlEntry& entry,
         const char* tagName);         const char* tagName);
  
       static Boolean testStartTagOrEmptyTag(
           XmlParser& parser,
           XmlEntry& entry);
   
     static Boolean testContentOrCData(     static Boolean testContentOrCData(
         XmlParser& parser,         XmlParser& parser,
         XmlEntry& entry);         XmlEntry& entry);
  
     static void testCimStartTag(XmlParser& parser);      static void getCimStartTag(
           XmlParser& parser,
           const char*& cimVersion,
           const char*& dtdVersion);
  
     static String getCimNameAttribute(      static CIMName getCimNameAttribute(
         Uint32 lineNumber,         Uint32 lineNumber,
         const XmlEntry& entry,         const XmlEntry& entry,
         const char* elementName,         const char* elementName,
Line 114 
Line 136 
         const XmlEntry& entry,         const XmlEntry& entry,
         const char* elementName);         const char* elementName);
  
     static String getClassOriginAttribute(      static CIMName getClassOriginAttribute(
           Uint32 lineNumber,
           const XmlEntry& entry,
           const char* tagName);
   
       typedef enum _embeddedObjectAttributeType
       {
           NO_EMBEDDED_OBJECT     = 0,
           EMBEDDED_OBJECT_ATTR   = 1,
           EMBEDDED_INSTANCE_ATTR = 2
       } EmbeddedObjectAttributeType;
   
       static EmbeddedObjectAttributeType getEmbeddedObjectAttribute(
         Uint32 lineNumber,         Uint32 lineNumber,
         const XmlEntry& entry,         const XmlEntry& entry,
         const char* tagName);         const char* tagName);
  
     static String getReferenceClassAttribute(      static CIMName getReferenceClassAttribute(
         Uint32 lineNumber,         Uint32 lineNumber,
         const XmlEntry& entry,         const XmlEntry& entry,
         const char* elementName);         const char* elementName);
  
     static String getSuperClassAttribute(      static CIMName getSuperClassAttribute(
         Uint32 lineNumber,         Uint32 lineNumber,
         const XmlEntry& entry,         const XmlEntry& entry,
         const char* tagName);         const char* tagName);
  
     static CIMType getCimTypeAttribute(      static Boolean getCimTypeAttribute(
         Uint32 lineNumber,         Uint32 lineNumber,
         const XmlEntry& entry,         const XmlEntry& entry,
           CIMType& cimType,  // Output parameter
         const char* tagName,         const char* tagName,
         const char* attributeName = "TYPE",         const char* attributeName = "TYPE",
         Boolean required = true);         Boolean required = true);
Line 144 
Line 179 
         Boolean defaultValue,         Boolean defaultValue,
         Boolean required);         Boolean required);
  
     static Boolean stringToReal(      static String decodeURICharacters(String uriString);
         const char* stringValue,  
         Real64& x);  
  
     static Boolean stringToSignedInteger(     static Boolean stringToSignedInteger(
         const char* stringValue,         const char* stringValue,
Line 161 
Line 194 
         const char* valueString,         const char* valueString,
         CIMType type);         CIMType type);
  
       static CIMValue stringToValue(
           Uint32 lineNumber,
           const char* valueString,
           Uint32 valueStringLen,
           CIMType type);
   
   
     /* getValueElement - Gets the CIMType and CIMValue for a single     /* getValueElement - Gets the CIMType and CIMValue for a single
         XML Value element.  It expects <VALUE> as the start tag.         XML Value element.  It expects <VALUE> as the start tag.
         @return Returns True if the value element exists         @return Returns True if the value element exists
Line 185 
Line 225 
         CIMType type,         CIMType type,
         CIMValue& value);         CIMValue& value);
  
     static Uint32 getFlavor(      static CIMFlavor getFlavor(
         XmlEntry& entry,         XmlEntry& entry,
         Uint32 lineNumber,         Uint32 lineNumber,
         const char* tagName);         const char* tagName);
  
     static Uint32 getOptionalScope(      static CIMScope getOptionalScope(
         XmlParser& parser);         XmlParser& parser);
  
     static Boolean getQualifierElement(     static Boolean getQualifierElement(
Line 217 
Line 257 
  
     static Boolean getNameSpaceElement(     static Boolean getNameSpaceElement(
         XmlParser& parser,         XmlParser& parser,
         String& nameSpaceComponent);          CIMName& nameSpaceComponent);
  
     static Boolean getLocalNameSpacePathElement(     static Boolean getLocalNameSpacePathElement(
         XmlParser& parser,         XmlParser& parser,
Line 230 
Line 270 
  
     static Boolean getClassNameElement(     static Boolean getClassNameElement(
         XmlParser& parser,         XmlParser& parser,
         String& className,          CIMName& className,
         Boolean required = false);         Boolean required = false);
  
     static KeyBinding::Type getValueTypeAttribute(      static CIMKeyBinding::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::Type& type,          CIMKeyBinding::Type& type,
         String& value);         String& value);
  
     static Boolean getKeyBindingElement(     static Boolean getKeyBindingElement(
         XmlParser& parser,         XmlParser& parser,
         String& name,          CIMName& name,
         String& value,         String& value,
         KeyBinding::Type& type);          CIMKeyBinding::Type& type);
  
     static Boolean getInstanceNameElement(     static Boolean getInstanceNameElement(
         XmlParser& parser,         XmlParser& parser,
         String& className,         String& className,
         Array<KeyBinding>& keyBindings);          Array<CIMKeyBinding>& keyBindings);
  
     static Boolean getInstanceNameElement(     static Boolean getInstanceNameElement(
         XmlParser& parser,         XmlParser& parser,
         CIMReference& instanceName);          CIMObjectPath& instanceName);
  
     static Boolean getInstancePathElement(     static Boolean getInstancePathElement(
         XmlParser& parser,         XmlParser& parser,
         CIMReference& reference);          CIMObjectPath& reference);
  
     static Boolean getLocalInstancePathElement(     static Boolean getLocalInstancePathElement(
         XmlParser& parser,         XmlParser& parser,
         CIMReference& reference);          CIMObjectPath& reference);
  
     static Boolean getClassPathElement(     static Boolean getClassPathElement(
         XmlParser& parser,         XmlParser& parser,
         CIMReference& reference);          CIMObjectPath& reference);
  
     static Boolean getLocalClassPathElement(     static Boolean getLocalClassPathElement(
         XmlParser& parser,         XmlParser& parser,
         CIMReference& reference);          CIMObjectPath& reference);
  
     static Boolean getValueReferenceElement(     static Boolean getValueReferenceElement(
         XmlParser& parser,         XmlParser& parser,
         CIMReference& reference);          CIMObjectPath& reference);
   
       static Boolean getValueReferenceArrayElement(
           XmlParser& parser,
           CIMValue& value);
  
     static Boolean getPropertyReferenceElement(     static Boolean getPropertyReferenceElement(
         XmlParser& parser,         XmlParser& parser,
Line 316 
Line 360 
  
     static Boolean getNamedInstanceElement(     static Boolean getNamedInstanceElement(
         XmlParser& parser,         XmlParser& parser,
         CIMNamedInstance& namedInstance);          CIMInstance& namedInstance);
  
     static void getObject(XmlParser& parser, CIMClass& x);     static void getObject(XmlParser& parser, CIMClass& x);
  
Line 327 
Line 371 
     static Boolean getMessageStartTag(     static Boolean getMessageStartTag(
         XmlParser& parser,         XmlParser& parser,
         String& id,         String& id,
         const char*& protocolVersion);          String& protocolVersion);
  
     static Boolean getIMethodCallStartTag(     static Boolean getIMethodCallStartTag(
         XmlParser& parser,         XmlParser& parser,
Line 335 
Line 379 
  
     static Boolean getIMethodResponseStartTag(     static Boolean getIMethodResponseStartTag(
         XmlParser& parser,         XmlParser& parser,
         const char*& name);          const char*& name,
           Boolean& isEmptyTag);
  
     static Boolean getIParamValueTag(     static Boolean getIParamValueTag(
         XmlParser& parser,         XmlParser& parser,
         const char*& name);          const char*& name,
           Boolean& isEmptyTag);
   
       static void rejectNullIParamValue(
           XmlParser& parser,
           Boolean isEmptyTag,
           const char* paramName);
  
     static Boolean getPropertyValue(     static Boolean getPropertyValue(
         XmlParser& parser,         XmlParser& parser,
Line 352 
Line 403 
  
     static Boolean getErrorElement(     static Boolean getErrorElement(
         XmlParser& parser,         XmlParser& parser,
         CIMStatusCode& code,          CIMException& cimException,
         const char*& description,  
         Boolean required = false);         Boolean required = false);
  
     static Boolean getObjectWithPath(      static Boolean getValueObjectElement(
         XmlParser& parser,         XmlParser& parser,
         CIMObjectWithPath& objectWithPath);          CIMObject& object);
   
       static Boolean getValueObjectWithPathElement(
           XmlParser& parser,
           CIMObject& objectWithPath);
   
       static Boolean getValueObjectWithLocalPathElement(
           XmlParser& parser,
           CIMObject& objectWithPath);
   
       static void getObjectArray(
           XmlParser& parser,
           Array<CIMObject>& objectArray);
  
     static Boolean getObjectNameElement(     static Boolean getObjectNameElement(
         XmlParser& parser,         XmlParser& parser,
         CIMReference& objectName);          CIMObjectPath& objectName);
  
     static Boolean getObjectPathElement(     static Boolean getObjectPathElement(
         XmlParser& parser,         XmlParser& parser,
         CIMReference& objectPath);          CIMObjectPath& objectPath);
  
     static Boolean getEMethodCallStartTag(     static Boolean getEMethodCallStartTag(
         XmlParser& parser,         XmlParser& parser,
Line 374 
Line 436 
  
     static Boolean getEMethodResponseStartTag(     static Boolean getEMethodResponseStartTag(
         XmlParser& parser,         XmlParser& parser,
           const char*& name,
           Boolean& isEmptyTag);
   
       static Boolean getEParamValueTag(
           XmlParser& parser,
         const char*& name);         const char*& name);
  
     static Boolean getMethodCallStartTag(     static Boolean getMethodCallStartTag(
Line 382 
Line 449 
  
     static Boolean getMethodResponseStartTag(     static Boolean getMethodResponseStartTag(
         XmlParser& parser,         XmlParser& parser,
         const char*& name);          const char*& name,
           Boolean& isEmptyTag);
  
     static Boolean getParamValueElement(     static Boolean getParamValueElement(
         XmlParser& parser,         XmlParser& parser,
         CIMParamValue& paramValue);         CIMParamValue& paramValue);
  
       static Boolean getReturnValueElement(
           XmlParser& parser,
           CIMValue& returnValue);
   
       static Boolean isSupportedCIMVersion(
           const char* cimVersion);
   
       static Boolean isSupportedProtocolVersion(
           const String& protocolVersion);
   
       static Boolean isSupportedDTDVersion(
           const char* dtdVersion);
 private: private:
  
       static CIMValue _stringArrayToValue(
           Uint32 lineNumber,
           const Array<CharString>& array,
           CIMType type);
   
     XmlReader()     XmlReader()
     {     {
  


Legend:
Removed from v.1.21  
changed lines
  Added in v.1.57

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2