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

Diff for /pegasus/src/Pegasus/Common/XmlReader.cpp between version 1.92 and 1.95

version 1.92, 2003/10/16 23:25:03 version 1.95, 2004/04/19 22:09:17
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2003////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
 // The Open Group, Tivoli Systems  // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
   // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
   // IBM Corp.; EMC 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
Line 320 
Line 322 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
   // testStartTagOrEmptyTag()
   //
   //------------------------------------------------------------------------------
   
   Boolean XmlReader::testStartTagOrEmptyTag(
       XmlParser& parser,
       XmlEntry& entry)
   {
       if (!parser.next(entry) ||
           (entry.type != XmlEntry::START_TAG &&
            entry.type != XmlEntry::EMPTY_TAG))
       {
           parser.putBack(entry);
           return false;
       }
   
       return true;
   }
   
   //------------------------------------------------------------------------------
   //
 // testContentOrCData() // testContentOrCData()
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 902 
Line 925 
     return true;     return true;
 } }
  
 static inline Uint8 _hexCharToNumeric(const char c)  inline Uint8 _xmlReader_hexCharToNumeric(const char c)
 { {
     Uint8 n;     Uint8 n;
  
Line 943 
Line 966 
  
             }             }
  
             Uint8 digit1 = _hexCharToNumeric(char(uriString[++i]));              Uint8 digit1 = _xmlReader_hexCharToNumeric(char(uriString[++i]));
             Uint8 digit2 = _hexCharToNumeric(char(uriString[++i]));              Uint8 digit2 = _xmlReader_hexCharToNumeric(char(uriString[++i]));
             if ( (digit1 > 15) || (digit2 > 15) )             if ( (digit1 > 15) || (digit2 > 15) )
             {             {
               // l10n               // l10n
Line 1033 
Line 1056 
                 x = x << 4;                 x = x << 4;
  
                 // Make sure we don't overflow when we add the next digit                 // Make sure we don't overflow when we add the next digit
                 Sint64 newDigit = Sint64(_hexCharToNumeric(*p++));                  Sint64 newDigit = Sint64(_xmlReader_hexCharToNumeric(*p++));
                 if (PEGASUS_SINT64_MIN - x > -newDigit)                 if (PEGASUS_SINT64_MIN - x > -newDigit)
                 {                 {
                     return false;                     return false;
Line 1153 
Line 1176 
                 x = x << 4;                 x = x << 4;
  
                 // We can't overflow when we add the next digit                 // We can't overflow when we add the next digit
                 Uint64 newDigit = Uint64(_hexCharToNumeric(*p++));                  Uint64 newDigit = Uint64(_xmlReader_hexCharToNumeric(*p++));
                 if (PEGASUS_UINT64_MAX - x < newDigit)                 if (PEGASUS_UINT64_MAX - x < newDigit)
                 {                 {
                     return false;                     return false;
Line 1528 
Line 1551 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
   // skipElement()
   //
   //------------------------------------------------------------------------------
   void XmlReader::skipElement(
       XmlParser& parser,
       XmlEntry& entry)
   {
       const char * tag_name = entry.text;
   
       if (entry.type == XmlEntry::EMPTY_TAG)
       {
           return;
       }
   
       while (testStartTagOrEmptyTag(parser, entry))
       {
           skipElement(parser, entry);
       }
   
       if (testContentOrCData(parser, entry))
       {
           ; // skip
       }
   
       expectEndTag(parser, tag_name);
       return;
   }
   
   //------------------------------------------------------------------------------
   //
 // getValueElement() // getValueElement()
 // //
 //     <!ELEMENT VALUE (#PCDATA)> //     <!ELEMENT VALUE (#PCDATA)>
Line 3970 
Line 4023 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // getErrorElement()  //     DMTF CR Pending
 // //
 //     <!ELEMENT ERROR EMPTY>  //     <!ELEMENT ERROR (INSTANCE*)>
 //     <!ATTLIST ERROR //     <!ATTLIST ERROR
 //         CODE CDATA #REQUIRED //         CODE CDATA #REQUIRED
 //         DESCRIPTION CDATA #IMPLIED> //         DESCRIPTION CDATA #IMPLIED>
Line 4031 
Line 4084 
     entry.getAttributeValue("DESCRIPTION", tmpDescription);     entry.getAttributeValue("DESCRIPTION", tmpDescription);
  
     if (!empty)     if (!empty)
       {
           while (testStartTagOrEmptyTag(parser, entry))
           {
               skipElement(parser, entry);
           }
   
         expectEndTag(parser, "ERROR");         expectEndTag(parser, "ERROR");
       }
  
     cimException = PEGASUS_CIM_EXCEPTION(CIMStatusCode(tmpCode), tmpDescription);     cimException = PEGASUS_CIM_EXCEPTION(CIMStatusCode(tmpCode), tmpDescription);
     return true;     return true;
Line 4718 
Line 4778 
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
   


Legend:
Removed from v.1.92  
changed lines
  Added in v.1.95

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2