(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.78 and 1.81.4.1

version 1.78, 2002/10/03 19:27:31 version 1.81.4.1, 2003/03/11 19:56:55
Line 47 
Line 47 
 #include "CIMParamValue.h" #include "CIMParamValue.h"
 #include "System.h" #include "System.h"
  
 #define PEGASUS_SINT64_MIN (-PEGASUS_SINT64_LITERAL(0x8000000000000000))  #define PEGASUS_SINT64_MIN (PEGASUS_SINT64_LITERAL(0x8000000000000000))
 #define PEGASUS_UINT64_MAX PEGASUS_UINT64_LITERAL(0xFFFFFFFFFFFFFFFF) #define PEGASUS_UINT64_MAX PEGASUS_UINT64_LITERAL(0xFFFFFFFFFFFFFFFF)
  
 PEGASUS_USING_STD; PEGASUS_USING_STD;
Line 339 
Line 339 
     if (!CIMName::legal(name))     if (!CIMName::legal(name))
     {     {
 #ifdef PEGASUS_SNIA_INTEROP_TEST #ifdef PEGASUS_SNIA_INTEROP_TEST
       // This is not a Pegasus BUG.  It is a hack to protect against an error
       // from some servers.  In particular, the SNIA IBM server seems to be
       // sending a namespace component with "" as the string.  We cannot handle
       // this. This is probably because they are using the form /root/...
     // In testing, replace illegal CIMName with this value to avoid the     // In testing, replace illegal CIMName with this value to avoid the
     // exception and let xml parsing continue.  THIS IS TEMP.     // exception and let xml parsing continue.  THIS IS TEMP.
     name = "BADNAMESUBSTITUTEDBYPEGASUSCLIENT";     name = "BADNAMESUBSTITUTEDBYPEGASUSCLIENT";
Line 439 
Line 443 
  
     if (!CIMName::legal(name))     if (!CIMName::legal(name))
     {     {
   #ifdef PEGASUS_SNIA_INTEROP_TEST
       name = "PEGASUS_SUBSTITUED_THIS_FOR_BAD_NAME";
       return name;
   #endif
         char buffer[MESSAGE_SIZE];         char buffer[MESSAGE_SIZE];
         sprintf(buffer,         sprintf(buffer,
             "Illegal value for %s.REFERENCECLASS attribute", elementName);             "Illegal value for %s.REFERENCECLASS attribute", elementName);
Line 705 
Line 713 
     return n;     return n;
 } }
  
   // See http://www.ietf.org/rfc/rfc2396.txt section 2
   String XmlReader::decodeURICharacters(String uriString)
   {
       String decodedString;
       Uint32 i;
   
       for (i=0; i<uriString.size(); i++)
       {
           if (uriString[i] == '%')
           {
               if (i+2 >= uriString.size())
               {
                   throw ParseError("Invalid URI encoding");
               }
   
               Uint8 digit1 = _hexCharToNumeric(char(uriString[++i]));
               Uint8 digit2 = _hexCharToNumeric(char(uriString[++i]));
               if ( (digit1 > 15) || (digit2 > 15) )
               {
                   throw ParseError("Invalid URI encoding");
               }
   
               // ATTN: Handle non-UTF-8 character sets
               Uint16 decodedChar = Uint16(digit1<<4) + Uint16(digit2);
               decodedString.append(Char16(decodedChar));
           }
           else
           {
               decodedString.append(uriString[i]);
           }
       }
   
       return decodedString;
   }
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // stringToSignedInteger // stringToSignedInteger
Line 982 
Line 1025 
  
             if (!stringToUnsignedInteger(valueString, x))             if (!stringToUnsignedInteger(valueString, x))
             {             {
               char message[128];
               sprintf(message, "Illegal unsigned integer value - %s", valueString);
                 throw XmlSemanticError(                 throw XmlSemanticError(
                     lineNumber, "Invalid unsigned integer value");                      lineNumber, message);
             }             }
  
             switch (type)             switch (type)
Line 1150 
Line 1195 
  
         expectEndTag(parser, "VALUE");         expectEndTag(parser, "VALUE");
     }     }
   #ifdef PEGASUS_SNIA_INTEROP_TEST
       // KS 20021004 - tries to put value in even if empty.
       // Think this is general problem with empty value
       // Need to check meaning of (#PCDATA) - Does it allow empty.
       // Bugzilla tbd
       if (!empty)
   #endif
     value = stringToValue(parser.getLine(), valueString,type);     value = stringToValue(parser.getLine(), valueString,type);
  
     return true;     return true;
Line 1958 
Line 2009 
     Boolean empty = entry.type == XmlEntry::EMPTY_TAG;     Boolean empty = entry.type == XmlEntry::EMPTY_TAG;
  
     className = getCimNameAttribute(     className = getCimNameAttribute(
         parser.getLine(), entry, "CLASSNAME", true);          parser.getLine(), entry, "CLASSNAME", false);
  
     if (!empty)     if (!empty)
         expectEndTag(parser, "CLASSNAME");         expectEndTag(parser, "CLASSNAME");
Line 3574 
Line 3625 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
   // getEParamValueTag()
   //
   //------------------------------------------------------------------------------
   
   Boolean XmlReader::getEParamValueTag(
       XmlParser& parser,
       const char*& name)
   {
       XmlEntry entry;
   
       if (!testStartTag(parser, entry, "EXPPARAMVALUE"))
           return false;
   
       // Get EXPPARAMVALUE.NAME attribute:
   
       if (!entry.getAttributeValue("NAME", name))
           throw XmlValidationError(parser.getLine(),
               "Missing EXPPARAMVALUE.NAME attribute");
   
       return true;
   }
   
   //------------------------------------------------------------------------------
   //
 // getMethodCallStartTag() // getMethodCallStartTag()
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------


Legend:
Removed from v.1.78  
changed lines
  Added in v.1.81.4.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2