Convert from NULL macro to nullptr.
[shibboleth/cpp-xmltooling.git] / xmltooling / io / AbstractXMLObjectMarshaller.cpp
index 39b515c..c28bcbf 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright 2001-2009 Internet2
+*  Copyright 2001-2010 Internet2
  * 
 * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -99,11 +99,11 @@ DOMElement* AbstractXMLObjectMarshaller::marshall(
     // We may need to create our own document.
     bool bindDocument=false;
     if (!document) {
-        document=DOMImplementationRegistry::getDOMImplementation(NULL)->createDocument();
+        document=DOMImplementationRegistry::getDOMImplementation(nullptr)->createDocument();
         bindDocument=true;
     }
     
-    XercesJanitor<DOMDocument> janitor(bindDocument ? document : NULL);
+    XercesJanitor<DOMDocument> janitor(bindDocument ? document : nullptr);
 
     m_log.debug("creating root element to marshall");
     DOMElement* domElement = document->createElementNS(
@@ -203,7 +203,7 @@ void AbstractXMLObjectMarshaller::marshallInto(
             chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a,
             chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull
             };
-        if (targetElement->getParentNode()==NULL || targetElement->getParentNode()->getNodeType()==DOMNode::DOCUMENT_NODE) {
+        if (targetElement->getParentNode()==nullptr || targetElement->getParentNode()->getNodeType()==DOMNode::DOCUMENT_NODE) {
             if (m_schemaLocation)
                 targetElement->setAttributeNS(XSI_NS,schemaLocation,m_schemaLocation); 
             if (m_noNamespaceSchemaLocation)
@@ -313,12 +313,12 @@ public:
     }
 
     const XMLCh* lookupNamespaceURI(const DOMNode* n, const XMLCh* prefix) const {
-        // Return NULL if no declaration in effect. The empty string signifies the null namespace.
+        // Return nullptr if no declaration in effect. The empty string signifies the null namespace.
         if (!n || n->getNodeType()!=DOMNode::ELEMENT_NODE) {
             // At the root, the default namespace is set to the null namespace.
             if (!prefix || !*prefix)
                 return &chNull;
-            return NULL;    // we're done
+            return nullptr;    // we're done
         }
         DOMNamedNodeMap* attributes = static_cast<const DOMElement*>(n)->getAttributes();
         if (!attributes)
@@ -368,7 +368,7 @@ void AbstractXMLObjectMarshaller::marshallContent(
     for (list<XMLObject*>::const_iterator i=children.begin(); i!=children.end(); ++i) {
         if (*i) {
 #ifndef XMLTOOLING_NO_XMLSEC
-            (*i)->marshall(domElement,NULL,credential);
+            (*i)->marshall(domElement,nullptr,credential);
 #else
             (*i)->marshall(domElement);
 #endif