[cpp-xmltooling COMMIT] in /branches/REL_1/xmltooling: XMLObjectBuilder.cpp base.h util/DateTime.cpp util/XMLHelper.h

noreply at shibboleth.net noreply at shibboleth.net
Mon Sep 12 16:52:19 BST 2011


Author: scantor
Date: Mon Sep 12 16:52:18 2011
New Revision: 905

URL: http://svn.shibboleth.net/view/cpp-xmltooling?rev=905&view=rev
Log:
https://issues.shibboleth.net/jira/browse/SSPCPP-392

Modified:
    branches/REL_1/xmltooling/XMLObjectBuilder.cpp
    branches/REL_1/xmltooling/base.h
    branches/REL_1/xmltooling/util/DateTime.cpp
    branches/REL_1/xmltooling/util/XMLHelper.h

Modified: branches/REL_1/xmltooling/XMLObjectBuilder.cpp
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/XMLObjectBuilder.cpp?rev=905&r1=904&r2=905&view=diff
==============================================================================
--- branches/REL_1/xmltooling/XMLObjectBuilder.cpp (original)
+++ branches/REL_1/xmltooling/XMLObjectBuilder.cpp Mon Sep 12 16:52:18 2011
@@ -55,8 +55,9 @@
 
 XMLObject* XMLObjectBuilder::buildFromElement(DOMElement* element, bool bindDocument) const
 {
+    auto_ptr<QName> schemaType(XMLHelper::getXSIType(element));
     auto_ptr<XMLObject> ret(
-        buildObject(element->getNamespaceURI(),element->getLocalName(),element->getPrefix(),XMLHelper::getXSIType(element))
+        buildObject(element->getNamespaceURI(),element->getLocalName(),element->getPrefix(),schemaType.get())
         );
     ret->unmarshall(element,bindDocument);
     return ret.release();

Modified: branches/REL_1/xmltooling/base.h
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/base.h?rev=905&r1=904&r2=905&view=diff
==============================================================================
--- branches/REL_1/xmltooling/base.h (original)
+++ branches/REL_1/xmltooling/base.h Mon Sep 12 16:52:18 2011
@@ -1113,7 +1113,8 @@
  */
 #define PROC_QNAME_ATTRIB(proper,ucase,namespaceURI) \
     if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
-        set##proper(XMLHelper::getAttributeValueAsQName(attribute)); \
+        auto_ptr<xmltooling::QName> q(XMLHelper::getAttributeValueAsQName(attribute)); \
+        set##proper(q.get()); \
         return; \
     }
 

Modified: branches/REL_1/xmltooling/util/DateTime.cpp
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/util/DateTime.cpp?rev=905&r1=904&r2=905&view=diff
==============================================================================
--- branches/REL_1/xmltooling/util/DateTime.cpp (original)
+++ branches/REL_1/xmltooling/util/DateTime.cpp Mon Sep 12 16:52:18 2011
@@ -31,6 +31,7 @@
  */
 
 #include "internal.h"
+#include "unicode.h"
 #include "util/DateTime.h"
 
 #ifndef WIN32
@@ -1315,18 +1316,17 @@
     XMLString::copyNString(miliSecData, &(fBuffer[start-1]), miliSecLen);
     *(miliSecData + miliSecLen) = chNull;
 
-    char *nptr = XMLString::transcode(miliSecData);
-    ArrayJanitor<char> jan(nptr);
-    size_t   strLen = strlen(nptr);
+    auto_ptr_char nptr(miliSecData);
+    size_t   strLen = strlen(nptr.get());
     char *endptr = 0;
     errno = 0;
 
     //printf("milisec=<%s>\n", nptr);
 
-    double retVal = strtod(nptr, &endptr);
+    double retVal = strtod(nptr.get(), &endptr);
 
     // check if all chars are valid char
-    if ( (endptr - nptr) != strLen)
+    if ( (endptr - nptr.get()) != strLen)
         throw XMLParserException("Invalid non-numeric characters.");
 
     // we don't check underflow occurs since

Modified: branches/REL_1/xmltooling/util/XMLHelper.h
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/util/XMLHelper.h?rev=905&r1=904&r2=905&view=diff
==============================================================================
--- branches/REL_1/xmltooling/util/XMLHelper.h (original)
+++ branches/REL_1/xmltooling/util/XMLHelper.h Mon Sep 12 16:52:18 2011
@@ -104,6 +104,7 @@
 
         /**
          * Gets the XSI type for a given element if it has one.
+         * <p>The caller is responsible for freeing the result.
          *
          * @param e the element
          * @return the type or null
@@ -158,6 +159,7 @@
         /**
          * @deprecated
          * Constructs a QName from an attribute's value.
+         * <p>The caller is responsible for freeing the result.
          *
          * @param attribute the attribute with a QName value
          * @return a QName from an attribute's value, or null if the given attribute is null
@@ -166,6 +168,7 @@
 
         /**
          * Constructs a QName from a node's value.
+         * <p>The caller is responsible for freeing the result.
          *
          * @param domNode the DOM node with a QName value
          * @return a QName from a node's value, or null if the given node has no value



More information about the commits mailing list