VS10 solution files, convert from NULL macro to nullptr.
[shibboleth/cpp-sp.git] / shibsp / attribute / KeyInfoAttributeDecoder.cpp
index 741d5da..c9e966e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2009 Internet2
+ *  Copyright 2009-2010 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ namespace shibsp {
         }
 
         Attribute* decode(
-            const vector<string>& ids, const XMLObject* xmlObject, const char* assertingParty=NULL, const char* relyingParty=NULL
+            const vector<string>& ids, const XMLObject* xmlObject, const char* assertingParty=nullptr, const char* relyingParty=nullptr
             ) const;
 
     private:
@@ -59,7 +59,7 @@ namespace shibsp {
                 if (!alg || !*alg)
                     alg = "SHA1";
                 dest.push_back(string());
-                dest.back() = SecurityHelper::getDEREncoding(*cred.get(), m_hash ? alg : NULL);
+                dest.back() = SecurityHelper::getDEREncoding(*cred.get(), m_hash ? alg : nullptr);
                 if (dest.back().empty())
                     dest.pop_back();
             }
@@ -88,13 +88,13 @@ namespace shibsp {
 KeyInfoAttributeDecoder::KeyInfoAttributeDecoder(const DOMElement* e)
         : AttributeDecoder(e),
           m_hash(false),
-          m_keyInfoHashAlg(e ? e->getAttributeNS(NULL, keyInfoHashAlg) : NULL),
-          m_keyInfoResolver(NULL) {
-    const XMLCh* flag = e ? e->getAttributeNS(NULL, _hash) : NULL;
+          m_keyInfoHashAlg(e ? e->getAttributeNS(nullptr, keyInfoHashAlg) : nullptr),
+          m_keyInfoResolver(nullptr) {
+    const XMLCh* flag = e ? e->getAttributeNS(nullptr, _hash) : nullptr;
     m_hash = (flag && (*flag == chLatin_t || *flag == chDigit_1));
-    e = e ? XMLHelper::getFirstChildElement(e,_KeyInfoResolver) : NULL;
+    e = e ? XMLHelper::getFirstChildElement(e,_KeyInfoResolver) : nullptr;
     if (e) {
-        auto_ptr_char t(e->getAttributeNS(NULL, _type));
+        auto_ptr_char t(e->getAttributeNS(nullptr, _type));
         if (t.get() && *t.get())
             m_keyInfoResolver = XMLToolingConfig::getConfig().KeyInfoResolverManager.newPlugin(t.get(), e);
         else
@@ -110,7 +110,7 @@ Attribute* KeyInfoAttributeDecoder::decode(
 
     if (!xmlObject || !XMLString::equals(saml1::Attribute::LOCAL_NAME, xmlObject->getElementQName().getLocalPart())) {
         log.warn("XMLObject type not recognized by KeyInfoAttributeDecoder, no values returned");
-        return NULL;
+        return nullptr;
     }
 
     auto_ptr<SimpleAttribute> attr(new SimpleAttribute(ids));
@@ -146,7 +146,7 @@ Attribute* KeyInfoAttributeDecoder::decode(
         }
         else {
             log.warn("XMLObject type not recognized by KeyInfoAttributeDecoder, no values returned");
-            return NULL;
+            return nullptr;
         }
     }
 
@@ -165,5 +165,5 @@ Attribute* KeyInfoAttributeDecoder::decode(
         }
     }
 
-    return dest.empty() ? NULL : _decode(attr.release());
+    return dest.empty() ? nullptr : _decode(attr.release());
 }