version 1.78, 2002/10/03 19:27:31
|
version 1.81.4.1, 2003/03/11 19:56:55
|
|
|
#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; |
|
|
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"; |
|
|
| |
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); |
|
|
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 |
|
|
| |
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) |
|
|
| |
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; |
|
|
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"); |
|
|
| |
//------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
// | // |
|
// 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() |
// | // |
//------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |