From: Scott Cantor Date: Tue, 4 May 2010 19:01:28 +0000 (+0000) Subject: Convert from NULL macro to nullptr. X-Git-Tag: 1.4RC1~78 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=commitdiff_plain;h=a0d768778a8f5f539b909baf5b115e70ea765f0f Convert from NULL macro to nullptr. --- diff --git a/.cproject b/.cproject index ad088ae..04ab920 100644 --- a/.cproject +++ b/.cproject @@ -51,13 +51,13 @@ @@ -65,6 +65,25 @@ + + + + + + + + + + + @@ -169,6 +188,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -252,6 +354,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index 90a7dfe..273ced0 100644 --- a/.gitignore +++ b/.gitignore @@ -16,10 +16,10 @@ /.DS_store # Simulated Subversion default ignores end here # The contents of the svn:ignore property on the branch root. -/debug +/Debug /*.ncb /*.suo -/release +/Release /aclocal.m4 /autom4te.cache /config.guess diff --git a/config_win32.h b/config_win32.h index 924ccd5..f67756a 100644 --- a/config_win32.h +++ b/config_win32.h @@ -3,6 +3,11 @@ /* Define if C++ compiler supports covariant virtual methods. */ #define HAVE_COVARIANT_RETURNS 1 +/* Define to 1 if C++ compiler supports nullptr keyword. */ +#if _MSC_VER >= 1600 +# define HAVE_NULLPTR 1 +#endif + /* Define to 1 if you have the header file. */ /* #undef HAVE_DLFCN_H */ diff --git a/configure.ac b/configure.ac index 2a6b6c6..40dd161 100644 --- a/configure.ac +++ b/configure.ac @@ -90,10 +90,23 @@ AC_CXX_REQUIRE_STL AC_CXX_NAMESPACES # are covariant methods allowed? -AC_TRY_LINK( - [ class base { public: virtual base *GetPtr( void ) { return this; } }; ], - [ class derived: virtual public base { public: virtual derived *GetPtr( void ) { return this; } }; ], - [AC_DEFINE([HAVE_COVARIANT_RETURNS], [1], [Define to 1 if C++ compiler supports covariant virtual methods.])]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], + [[ + class base { public: virtual base *GetPtr( void ) { return this; } }; + class derived: virtual public base { public: virtual derived *GetPtr( void ) { return this; } }; + ]])], + [AC_DEFINE([HAVE_COVARIANT_RETURNS], [1], [Define to 1 if C++ compiler supports covariant virtual methods.])] + ) + +# is nullptr supported? +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], + [[ + const char* ptr = nullptr; + ]])], + [AC_DEFINE([HAVE_NULLPTR], [1], [Define to 1 if C++ compiler supports nullptr keyword.])] + ) # log4shib settings (favor this version over the log4cpp code) AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config) diff --git a/xmltooling/.gitignore b/xmltooling/.gitignore index 6808f70..6a4b553 100644 --- a/xmltooling/.gitignore +++ b/xmltooling/.gitignore @@ -11,3 +11,4 @@ /xmltooling-lite-Release /x64 /*.aps +/*.filters diff --git a/xmltooling/AbstractAttributeExtensibleXMLObject.cpp b/xmltooling/AbstractAttributeExtensibleXMLObject.cpp index 58c05c1..3c1f6c9 100644 --- a/xmltooling/AbstractAttributeExtensibleXMLObject.cpp +++ b/xmltooling/AbstractAttributeExtensibleXMLObject.cpp @@ -114,7 +114,7 @@ AbstractAttributeExtensibleXMLObject::~AbstractAttributeExtensibleXMLObject() const XMLCh* AbstractAttributeExtensibleXMLObject::getAttribute(const QName& qualifiedName) const { map::const_iterator i=m_attributeMap.find(qualifiedName); - return (i==m_attributeMap.end()) ? NULL : i->second; + return (i==m_attributeMap.end()) ? nullptr : i->second; } void AbstractAttributeExtensibleXMLObject::setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID) @@ -168,7 +168,7 @@ const map& AbstractAttributeExtensibleXMLObject::getExtensionAttri } const XMLCh* AbstractAttributeExtensibleXMLObject::getXMLID() const { - return (m_idAttribute == m_attributeMap.end()) ? NULL : m_idAttribute->second; + return (m_idAttribute == m_attributeMap.end()) ? nullptr : m_idAttribute->second; } void AbstractAttributeExtensibleXMLObject::unmarshallExtensionAttribute(const DOMAttr* attribute) diff --git a/xmltooling/AbstractComplexElement.cpp b/xmltooling/AbstractComplexElement.cpp index ea08e19..cc8f68d 100644 --- a/xmltooling/AbstractComplexElement.cpp +++ b/xmltooling/AbstractComplexElement.cpp @@ -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. @@ -32,7 +32,7 @@ using xercesc::XMLString; namespace { bool _nonnull(const XMLObject* ptr) { - return (ptr!=NULL); + return (ptr!=nullptr); } } @@ -71,7 +71,7 @@ void AbstractComplexElement::removeChild(XMLObject* child) const XMLCh* AbstractComplexElement::getTextContent(unsigned int position) const { - return (m_text.size() > position) ? m_text[position] : NULL; + return (m_text.size() > position) ? m_text[position] : nullptr; } void AbstractComplexElement::setTextContent(const XMLCh* value, unsigned int position) @@ -80,7 +80,7 @@ void AbstractComplexElement::setTextContent(const XMLCh* value, unsigned int pos throw XMLObjectException("Can't set text content relative to non-existent child position."); vector::size_type size = m_text.size(); while (position >= size) { - m_text.push_back(NULL); + m_text.push_back(nullptr); ++size; } m_text[position]=prepareForAssignment(m_text[position],value); diff --git a/xmltooling/AbstractDOMCachingXMLObject.cpp b/xmltooling/AbstractDOMCachingXMLObject.cpp index 87f02a4..775b4bc 100644 --- a/xmltooling/AbstractDOMCachingXMLObject.cpp +++ b/xmltooling/AbstractDOMCachingXMLObject.cpp @@ -33,12 +33,12 @@ using namespace xmltooling; using namespace xercesc; using namespace std; -AbstractDOMCachingXMLObject::AbstractDOMCachingXMLObject() : m_dom(NULL), m_document(NULL) +AbstractDOMCachingXMLObject::AbstractDOMCachingXMLObject() : m_dom(nullptr), m_document(nullptr) { } AbstractDOMCachingXMLObject::AbstractDOMCachingXMLObject(const AbstractDOMCachingXMLObject& src) - : AbstractXMLObject(src), m_dom(NULL), m_document(NULL) + : AbstractXMLObject(src), m_dom(nullptr), m_document(nullptr) { } @@ -79,7 +79,7 @@ void AbstractDOMCachingXMLObject::releaseDOM() const string qname=getElementQName().toString(); m_log.debug("releasing cached DOM representation for (%s)", qname.empty() ? "unknown" : qname.c_str()); } - setDOM(NULL); + setDOM(nullptr); } } @@ -126,7 +126,7 @@ DOMElement* AbstractDOMCachingXMLObject::cloneDOM(DOMDocument* doc) const if (getDOM()) { DOMDocument* cloneDoc = doc; if (!cloneDoc) - cloneDoc=DOMImplementationRegistry::getDOMImplementation(NULL)->createDocument(); + cloneDoc=DOMImplementationRegistry::getDOMImplementation(nullptr)->createDocument(); try { return static_cast(cloneDoc->importNode(getDOM(),true)); } @@ -137,7 +137,7 @@ DOMElement* AbstractDOMCachingXMLObject::cloneDOM(DOMDocument* doc) const m_log.error("DOM clone failed: %s", temp.get()); } } - return NULL; + return nullptr; } XMLObject* AbstractDOMCachingXMLObject::clone() const @@ -160,7 +160,7 @@ XMLObject* AbstractDOMCachingXMLObject::clone() const janitor.release(); // safely transferred return ret; } - return NULL; + return nullptr; } void AbstractDOMCachingXMLObject::detach() @@ -178,7 +178,7 @@ void AbstractDOMCachingXMLObject::detach() if (parent && parent->m_document) { // Transfer control of document to me... setDocument(parent->m_document); - parent->m_document = NULL; + parent->m_document = nullptr; } // The rest is done by the base. AbstractXMLObject::detach(); diff --git a/xmltooling/AbstractDOMCachingXMLObject.h b/xmltooling/AbstractDOMCachingXMLObject.h index 6f78d98..ed5862e 100644 --- a/xmltooling/AbstractDOMCachingXMLObject.h +++ b/xmltooling/AbstractDOMCachingXMLObject.h @@ -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. @@ -17,7 +17,7 @@ /** * @file xmltooling/AbstractDOMCachingXMLObject.h * - * AbstractXMLObject mixin that implements DOM caching + * AbstractXMLObject mixin that implements DOM caching. */ #ifndef __xmltooling_abstractdomxmlobj_h__ @@ -60,10 +60,10 @@ namespace xmltooling { /** * If a DOM representation exists, this clones it into a new document. * - * @param doc the document to clone into, or NULL, in which case a new document is created + * @param doc the document to clone into, or nullptr, in which case a new document is created * @return the cloned DOM */ - xercesc::DOMElement* cloneDOM(xercesc::DOMDocument* doc=NULL) const; + xercesc::DOMElement* cloneDOM(xercesc::DOMDocument* doc=nullptr) const; private: mutable xercesc::DOMElement* m_dom; diff --git a/xmltooling/AbstractSimpleElement.cpp b/xmltooling/AbstractSimpleElement.cpp index 43003dd..a6a29e7 100644 --- a/xmltooling/AbstractSimpleElement.cpp +++ b/xmltooling/AbstractSimpleElement.cpp @@ -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. @@ -17,7 +17,7 @@ /** * AbstractSimpleElement.cpp * - * Extension of AbstractXMLObject that implements simple elements + * Extension of AbstractXMLObject that implements simple elements. */ #include "internal.h" @@ -31,7 +31,7 @@ using namespace std; list AbstractSimpleElement::m_no_children; -AbstractSimpleElement::AbstractSimpleElement() : m_value(NULL) +AbstractSimpleElement::AbstractSimpleElement() : m_value(nullptr) { } @@ -62,7 +62,7 @@ void AbstractSimpleElement::removeChild(XMLObject* child) const XMLCh* AbstractSimpleElement::getTextContent(unsigned int position) const { - return (position==0) ? m_value : NULL; + return (position==0) ? m_value : nullptr; } void AbstractSimpleElement::setTextContent(const XMLCh* value, unsigned int position) diff --git a/xmltooling/AbstractXMLObject.cpp b/xmltooling/AbstractXMLObject.cpp index 3f6726a..10d5844 100644 --- a/xmltooling/AbstractXMLObject.cpp +++ b/xmltooling/AbstractXMLObject.cpp @@ -54,8 +54,8 @@ void XMLObject::releaseThisAndChildrenDOM() const AbstractXMLObject::AbstractXMLObject(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) : m_log(logging::Category::getInstance(XMLTOOLING_LOGCAT".XMLObject")), - m_schemaLocation(NULL), m_noNamespaceSchemaLocation(NULL), m_nil(xmlconstants::XML_BOOL_NULL), - m_parent(NULL), m_elementQname(nsURI, localName, prefix), m_typeQname(NULL) + m_schemaLocation(nullptr), m_noNamespaceSchemaLocation(nullptr), m_nil(xmlconstants::XML_BOOL_NULL), + m_parent(nullptr), m_elementQname(nsURI, localName, prefix), m_typeQname(nullptr) { addNamespace(Namespace(nsURI, prefix, false, Namespace::VisiblyUsed)); if (schemaType) { @@ -67,7 +67,7 @@ AbstractXMLObject::AbstractXMLObject(const XMLCh* nsURI, const XMLCh* localName, AbstractXMLObject::AbstractXMLObject(const AbstractXMLObject& src) : m_namespaces(src.m_namespaces), m_log(src.m_log), m_schemaLocation(XMLString::replicate(src.m_schemaLocation)), m_noNamespaceSchemaLocation(XMLString::replicate(src.m_noNamespaceSchemaLocation)), m_nil(src.m_nil), - m_parent(NULL), m_elementQname(src.m_elementQname), m_typeQname(NULL) + m_parent(nullptr), m_elementQname(src.m_elementQname), m_typeQname(nullptr) { if (src.m_typeQname) m_typeQname=new QName(*src.m_typeQname); @@ -90,7 +90,7 @@ void AbstractXMLObject::detach() // Pull ourselves out of the parent and then blast him. getParent()->removeChild(this); delete m_parent; - m_parent = NULL; + m_parent = nullptr; } const QName& AbstractXMLObject::getElementQName() const @@ -162,7 +162,7 @@ const QName* AbstractXMLObject::getSchemaType() const const XMLCh* AbstractXMLObject::getXMLID() const { - return NULL; + return nullptr; } xmlconstants::xmltooling_bool_t AbstractXMLObject::getNil() const @@ -180,7 +180,7 @@ void AbstractXMLObject::nil(xmlconstants::xmltooling_bool_t value) bool AbstractXMLObject::hasParent() const { - return m_parent != NULL; + return m_parent != nullptr; } XMLObject* AbstractXMLObject::getParent() const @@ -212,7 +212,7 @@ QName* AbstractXMLObject::prepareForAssignment(QName* oldValue, const QName* new addNamespace(Namespace(newValue->getNamespaceURI(), newValue->getPrefix(), false, Namespace::NonVisiblyUsed)); return new QName(*newValue); } - return NULL; + return nullptr; } delete oldValue; @@ -222,7 +222,7 @@ QName* AbstractXMLObject::prepareForAssignment(QName* oldValue, const QName* new addNamespace(Namespace(newValue->getNamespaceURI(), newValue->getPrefix(), false, Namespace::NonVisiblyUsed)); return new QName(*newValue); } - return NULL; + return nullptr; } DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const DateTime* newValue) @@ -232,12 +232,12 @@ DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const Date releaseThisandParentDOM(); return new DateTime(*newValue); } - return NULL; + return nullptr; } delete oldValue; releaseThisandParentDOM(); - return newValue ? new DateTime(*newValue) : NULL; + return newValue ? new DateTime(*newValue) : nullptr; } DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, time_t newValue, bool duration) @@ -257,7 +257,7 @@ DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const XMLC delete oldValue; releaseThisandParentDOM(); if (!newValue || !*newValue) - return NULL; + return nullptr; DateTime* ret = new DateTime(newValue); if (duration) ret->parseDuration(); diff --git a/xmltooling/AbstractXMLObject.h b/xmltooling/AbstractXMLObject.h index b7b22dc..ab06573 100644 --- a/xmltooling/AbstractXMLObject.h +++ b/xmltooling/AbstractXMLObject.h @@ -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. @@ -72,7 +72,7 @@ namespace xmltooling { * @param schemaType the xsi:type to use */ AbstractXMLObject( - const XMLCh* nsURI=NULL, const XMLCh* localName=NULL, const XMLCh* prefix=NULL, const QName* schemaType=NULL + const XMLCh* nsURI=nullptr, const XMLCh* localName=nullptr, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr ); /** Copy constructor. */ @@ -147,7 +147,7 @@ namespace xmltooling { * * It is indifferent to whether either the old or the new version of the value is null. * This method will do a safe compare of the objects and will also invalidate the DOM if appropriate. - * Note that since the new value (even if NULL) is always returned, it may be more efficient + * Note that since the new value (even if nullptr) is always returned, it may be more efficient * to discard the return value and just assign independently if a dynamic cast would be involved. * * @param oldValue current value diff --git a/xmltooling/AttributeExtensibleXMLObject.h b/xmltooling/AttributeExtensibleXMLObject.h index c01250f..79b0ca3 100644 --- a/xmltooling/AttributeExtensibleXMLObject.h +++ b/xmltooling/AttributeExtensibleXMLObject.h @@ -47,7 +47,7 @@ namespace xmltooling { * Gets the value of an XML attribute of the object. * * @param qualifiedName qualified name of the attribute - * @return the attribute value, or NULL + * @return the attribute value, or nullptr */ virtual const XMLCh* getAttribute(const QName& qualifiedName) const=0; @@ -55,7 +55,7 @@ namespace xmltooling { * Sets (or clears) an XML attribute of the object. * * @param qualifiedName qualified name of the attribute - * @param value value to set, or NULL to clear + * @param value value to set, or nullptr to clear * @param ID true iff the attribute is an XML ID */ virtual void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false)=0; diff --git a/xmltooling/Lockable.cpp b/xmltooling/Lockable.cpp index 4d9c5a4..3f692a9 100644 --- a/xmltooling/Lockable.cpp +++ b/xmltooling/Lockable.cpp @@ -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. @@ -36,20 +36,20 @@ Lockable::~Lockable() Locker::Locker(Lockable* lockee, bool lock) { if (lockee && lock) - m_lockee=lockee->lock(); + m_lockee = lockee->lock(); else - m_lockee=lockee; + m_lockee = lockee; } void Locker::assign(Lockable* lockee, bool lock) { if (m_lockee) m_lockee->unlock(); - m_lockee=NULL; + m_lockee = nullptr; if (lockee && lock) - m_lockee=lockee->lock(); + m_lockee = lockee->lock(); else - m_lockee=lockee; + m_lockee = lockee; } Locker::~Locker() diff --git a/xmltooling/Lockable.h b/xmltooling/Lockable.h index a244d2d..ced79d3 100644 --- a/xmltooling/Lockable.h +++ b/xmltooling/Lockable.h @@ -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. @@ -63,7 +63,7 @@ namespace xmltooling { * @param lockee pointer to an object to hold, and optionally lock * @param lock true iff object is not yet locked */ - Locker(Lockable* lockee=NULL, bool lock=true); + Locker(Lockable* lockee=nullptr, bool lock=true); /** * Optionally locks an object and stores it for later release. @@ -72,7 +72,7 @@ namespace xmltooling { * @param lockee pointer to an object to hold, and optionally lock * @param lock true iff object is not yet locked */ - void assign(Lockable* lockee=NULL, bool lock=true); + void assign(Lockable* lockee=nullptr, bool lock=true); /** * Destructor releases lock on held pointer, if any. diff --git a/xmltooling/Namespace.h b/xmltooling/Namespace.h index d711cdd..de17cb0 100644 --- a/xmltooling/Namespace.h +++ b/xmltooling/Namespace.h @@ -54,7 +54,7 @@ namespace xmltooling { * @param alwaysDeclare true iff the namespace should always be declared regardless of in-scope declarations * @param usage indicates usage of namespace in the context of an XMLObject */ - Namespace(const XMLCh* uri=NULL, const XMLCh* prefix=NULL, bool alwaysDeclare=false, namespace_usage_t usage=Indeterminate); + Namespace(const XMLCh* uri=nullptr, const XMLCh* prefix=nullptr, bool alwaysDeclare=false, namespace_usage_t usage=Indeterminate); ~Namespace(); diff --git a/xmltooling/QName.h b/xmltooling/QName.h index a8bdd57..0f75b82 100644 --- a/xmltooling/QName.h +++ b/xmltooling/QName.h @@ -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. @@ -47,7 +47,7 @@ namespace xmltooling { * @param localPart local name * @param prefix namespace prefix (without the colon) */ - QName(const XMLCh* uri=NULL, const XMLCh* localPart=NULL, const XMLCh* prefix=NULL); + QName(const XMLCh* uri=nullptr, const XMLCh* localPart=nullptr, const XMLCh* prefix=nullptr); /** * Constructor @@ -56,7 +56,7 @@ namespace xmltooling { * @param localPart local name * @param prefix namespace prefix (without the colon) */ - QName(const char* uri, const char* localPart, const char* prefix=NULL); + QName(const char* uri, const char* localPart, const char* prefix=nullptr); ~QName(); diff --git a/xmltooling/XMLObject.h b/xmltooling/XMLObject.h index d61ac84..636d575 100644 --- a/xmltooling/XMLObject.h +++ b/xmltooling/XMLObject.h @@ -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. @@ -122,7 +122,7 @@ namespace xmltooling { /** * Gets the value of the ID attribute set on this object, if any. * - * @return an ID value or NULL + * @return an ID value or nullptr */ virtual const XMLCh* getXMLID() const=0; @@ -234,7 +234,7 @@ namespace xmltooling { /** * Sets (or clears) text content relative to a child element's position. * - * @param value value to set, or NULL to clear + * @param value value to set, or nullptr to clear * @param position position relative to child element */ virtual void setTextContent(const XMLCh* value, unsigned int position=0)=0; @@ -299,7 +299,7 @@ namespace xmltooling { * a new document will be created and bound to the lifetime of the root object being * marshalled, unless an existing DOM can be reused without creating a new document. * - * @param document the DOM document the marshalled element will be placed in, or NULL + * @param document the DOM document the marshalled element will be placed in, or nullptr * @param sigs ordered array of signatures to create after marshalling is complete * @param credential optional credential to supply signing key and related info * @return the DOM element representing this XMLObject @@ -308,10 +308,10 @@ namespace xmltooling { * @throws SignatureException thrown if a problem occurs during signature creation */ virtual xercesc::DOMElement* marshall( - xercesc::DOMDocument* document=NULL + xercesc::DOMDocument* document=nullptr #ifndef XMLTOOLING_NO_XMLSEC - ,const std::vector* sigs=NULL - ,const Credential* credential=NULL + ,const std::vector* sigs=nullptr + ,const Credential* credential=nullptr #endif ) const=0; @@ -332,8 +332,8 @@ namespace xmltooling { virtual xercesc::DOMElement* marshall( xercesc::DOMElement* parentElement #ifndef XMLTOOLING_NO_XMLSEC - ,const std::vector* sigs=NULL - ,const Credential* credential=NULL + ,const std::vector* sigs=nullptr + ,const Credential* credential=nullptr #endif ) const=0; diff --git a/xmltooling/XMLObjectBuilder.cpp b/xmltooling/XMLObjectBuilder.cpp index c8eeda8..5b6c17e 100644 --- a/xmltooling/XMLObjectBuilder.cpp +++ b/xmltooling/XMLObjectBuilder.cpp @@ -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. @@ -34,7 +34,7 @@ using xercesc::DOMDocument; using xercesc::DOMElement; map XMLObjectBuilder::m_map; -XMLObjectBuilder* XMLObjectBuilder::m_default=NULL; +XMLObjectBuilder* XMLObjectBuilder::m_default = nullptr; XMLObjectBuilder::XMLObjectBuilder() { @@ -66,13 +66,13 @@ XMLObject* XMLObjectBuilder::buildFromDocument(DOMDocument* doc, bool bindDocume XMLObject* XMLObjectBuilder::buildOneFromElement(xercesc::DOMElement* element, bool bindDocument) { const XMLObjectBuilder* b=getBuilder(element); - return b ? b->buildFromElement(element,bindDocument) : NULL; + return b ? b->buildFromElement(element,bindDocument) : nullptr; } const XMLObjectBuilder* XMLObjectBuilder::getBuilder(const QName& key) { map::const_iterator i=m_map.find(key); - return (i==m_map.end()) ? NULL : i->second; + return (i==m_map.end()) ? nullptr : i->second; } const XMLObjectBuilder* XMLObjectBuilder::getBuilder(const DOMElement* domElement) @@ -83,7 +83,7 @@ const XMLObjectBuilder* XMLObjectBuilder::getBuilder(const DOMElement* domElemen Category& log=Category::getInstance(XMLTOOLING_LOGCAT".XMLObject.Builder"); auto_ptr schemaType(XMLHelper::getXSIType(domElement)); - const XMLObjectBuilder* xmlObjectBuilder = schemaType.get() ? getBuilder(*(schemaType.get())) : NULL; + const XMLObjectBuilder* xmlObjectBuilder = schemaType.get() ? getBuilder(*(schemaType.get())) : nullptr; if (xmlObjectBuilder) { if (log.isDebugEnabled()) { log.debug("located XMLObjectBuilder for schema type: %s", schemaType->toString().c_str()); @@ -137,7 +137,7 @@ void XMLObjectBuilder::deregisterBuilder(const QName& builderKey) void XMLObjectBuilder::deregisterDefaultBuilder() { delete m_default; - m_default=NULL; + m_default = nullptr; } void XMLObjectBuilder::destroyBuilders() diff --git a/xmltooling/XMLObjectBuilder.h b/xmltooling/XMLObjectBuilder.h index df3ca18..5ad4394 100644 --- a/xmltooling/XMLObjectBuilder.h +++ b/xmltooling/XMLObjectBuilder.h @@ -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. @@ -49,7 +49,7 @@ namespace xmltooling { /** * Creates an empty XMLObject with a particular element name. - *

The results are undefined if localName is NULL or empty. + *

The results are undefined if localName is nullptr or empty. * * @param nsURI namespace URI for element * @param localName local name of element @@ -58,7 +58,7 @@ namespace xmltooling { * @return the empty XMLObject */ virtual XMLObject* buildObject( - const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr ) const=0; /** @@ -92,7 +92,7 @@ namespace xmltooling { * * @param element the unmarshalling source * @param bindDocument true iff the new XMLObject should take ownership of the DOM Document - * @return the unmarshalled object or NULL if no builder is available + * @return the unmarshalled object or nullptr if no builder is available */ static XMLObject* buildOneFromElement(xercesc::DOMElement* element, bool bindDocument=false); @@ -100,7 +100,7 @@ namespace xmltooling { * Retrieves an XMLObjectBuilder using the key it was registered with. * * @param key the key used to register the builder - * @return the builder or NULL + * @return the builder or nullptr */ static const XMLObjectBuilder* getBuilder(const QName& key); @@ -109,14 +109,14 @@ namespace xmltooling { * If no match is found, the default builder is returned, if any. * * @param element the element for which to locate a builder - * @return the builder or NULL + * @return the builder or nullptr */ static const XMLObjectBuilder* getBuilder(const xercesc::DOMElement* element); /** * Retrieves the default XMLObjectBuilder for DOM elements * - * @return the default builder or NULL + * @return the default builder or nullptr */ static const XMLObjectBuilder* getDefaultBuilder(); diff --git a/xmltooling/XMLToolingConfig.cpp b/xmltooling/XMLToolingConfig.cpp index cadf7bc..be6d53a 100644 --- a/xmltooling/XMLToolingConfig.cpp +++ b/xmltooling/XMLToolingConfig.cpp @@ -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. @@ -118,10 +118,10 @@ namespace xmltooling { PSID lpUserSid, LPCSTR message) { - LPCSTR messages[] = {message, NULL}; + LPCSTR messages[] = {message, nullptr}; HANDLE hElog = RegisterEventSource(lpUNCServerName, "OpenSAML XMLTooling Library"); - BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, NULL); + BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, nullptr); return (DeregisterEventSource(hElog) && res); } #endif @@ -139,10 +139,10 @@ XMLToolingInternalConfig& XMLToolingInternalConfig::getInternalConfig() #ifndef XMLTOOLING_NO_XMLSEC XMLToolingConfig::XMLToolingConfig() - : m_keyInfoResolver(NULL), m_replayCache(NULL), m_pathResolver(NULL), m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) + : m_keyInfoResolver(nullptr), m_replayCache(nullptr), m_pathResolver(nullptr), m_templateEngine(nullptr), m_urlEncoder(nullptr), clock_skew_secs(180) #else XMLToolingConfig::XMLToolingConfig() - : m_pathResolver(NULL), m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) + : m_pathResolver(nullptr), m_templateEngine(nullptr), m_urlEncoder(nullptr), clock_skew_secs(180) #endif { } @@ -209,7 +209,7 @@ bool XMLToolingInternalConfig::log_config(const char* config) string msg = string("failed to configure logging: ") + e.what(); Category::getInstance(XMLTOOLING_LOGCAT".Logging").crit(msg); #ifdef WIN32 - LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg.c_str()); + LogEvent(nullptr, EVENTLOG_ERROR_TYPE, 2100, nullptr, msg.c_str()); #endif return false; } @@ -307,7 +307,7 @@ bool XMLToolingInternalConfig::init() // Load catalogs from path. if (!catalog_path.empty()) { char* catpath=strdup(catalog_path.c_str()); - char* sep=NULL; + char* sep=nullptr; char* start=catpath; while (start && *start) { sep=strchr(start,PATH_SEPARATOR_CHAR); @@ -315,7 +315,7 @@ bool XMLToolingInternalConfig::init() *sep=0; auto_ptr_XMLCh temp(start); m_validatingPool->loadCatalog(temp.get()); - start = sep ? sep + 1 : NULL; + start = sep ? sep + 1 : nullptr; } free(catpath); } @@ -348,7 +348,7 @@ bool XMLToolingInternalConfig::init() registerSOAPTransports(); initSOAPTransports(); registerStorageServices(); - m_keyInfoResolver = KeyInfoResolverManager.newPlugin(INLINE_KEYINFO_RESOLVER,NULL); + m_keyInfoResolver = KeyInfoResolverManager.newPlugin(INLINE_KEYINFO_RESOLVER,nullptr); #endif m_pathResolver = new PathResolver(); @@ -386,7 +386,7 @@ bool XMLToolingInternalConfig::init() void XMLToolingInternalConfig::term() { #ifndef XMLTOOLING_NO_XMLSEC - CRYPTO_set_locking_callback(NULL); + CRYPTO_set_locking_callback(nullptr); for_each(g_openssl_locks.begin(), g_openssl_locks.end(), xmltooling::cleanup()); g_openssl_locks.clear(); #endif @@ -406,20 +406,20 @@ void XMLToolingInternalConfig::term() m_algorithmMap.clear(); delete m_keyInfoResolver; - m_keyInfoResolver = NULL; + m_keyInfoResolver = nullptr; delete m_replayCache; - m_replayCache = NULL; + m_replayCache = nullptr; #endif delete m_pathResolver; - m_pathResolver = NULL; + m_pathResolver = nullptr; delete m_templateEngine; - m_templateEngine = NULL; + m_templateEngine = nullptr; delete m_urlEncoder; - m_urlEncoder = NULL; + m_urlEncoder = nullptr; for (vector::reverse_iterator i=m_libhandles.rbegin(); i!=m_libhandles.rend(); i++) { #if defined(WIN32) @@ -439,18 +439,18 @@ void XMLToolingInternalConfig::term() m_libhandles.clear(); delete m_parserPool; - m_parserPool=NULL; + m_parserPool=nullptr; delete m_validatingPool; - m_validatingPool=NULL; + m_validatingPool=nullptr; #ifndef XMLTOOLING_NO_XMLSEC delete m_xsecProvider; - m_xsecProvider=NULL; + m_xsecProvider=nullptr; XSECPlatformUtils::Terminate(); #endif XMLPlatformUtils::closeMutex(m_lock); - m_lock=NULL; + m_lock=nullptr; XMLPlatformUtils::Terminate(); #ifndef XMLTOOLING_NO_XMLSEC @@ -487,16 +487,16 @@ bool XMLToolingInternalConfig::load_library(const char* path, void* context) m_pathResolver->resolve(resolved, PathResolver::XMLTOOLING_LIB_FILE); #if defined(WIN32) - HMODULE handle=NULL; + HMODULE handle=nullptr; for (string::iterator i = resolved.begin(); i != resolved.end(); ++i) if (*i == '/') *i = '\\'; UINT em=SetErrorMode(SEM_FAILCRITICALERRORS); try { - handle=LoadLibraryEx(resolved.c_str(),NULL,LOAD_WITH_ALTERED_SEARCH_PATH); + handle=LoadLibraryEx(resolved.c_str(),nullptr,LOAD_WITH_ALTERED_SEARCH_PATH); if (!handle) - handle=LoadLibraryEx(resolved.c_str(),NULL,0); + handle=LoadLibraryEx(resolved.c_str(),nullptr,0); if (!handle) throw runtime_error(string("unable to load extension library: ") + resolved); FARPROC fn=GetProcAddress(handle,"xmltooling_extension_init"); diff --git a/xmltooling/XMLToolingConfig.h b/xmltooling/XMLToolingConfig.h index 9333bce..2bdc59b 100644 --- a/xmltooling/XMLToolingConfig.h +++ b/xmltooling/XMLToolingConfig.h @@ -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. @@ -123,7 +123,7 @@ namespace xmltooling { * @param context arbitrary data to pass to library initialization hook * @return true iff library was loaded successfully */ - virtual bool load_library(const char* path, void* context=NULL)=0; + virtual bool load_library(const char* path, void* context=nullptr)=0; /** * Configure logging system. @@ -135,7 +135,7 @@ namespace xmltooling { * (DEBUG, INFO, NOTICE, WARN, ERROR, CRIT, ALERT, FATAL, EMERG) * @return true iff configuration was successful */ - virtual bool log_config(const char* config=NULL)=0; + virtual bool log_config(const char* config=nullptr)=0; /** * Obtains a non-validating parser pool. @@ -158,14 +158,14 @@ namespace xmltooling { /** * Returns the global KeyInfoResolver instance. * - * @return global KeyInfoResolver or NULL + * @return global KeyInfoResolver or nullptr */ const KeyInfoResolver* getKeyInfoResolver() const; /** * Returns the global ReplayCache instance. * - * @return global ReplayCache or NULL + * @return global ReplayCache or nullptr */ ReplayCache* getReplayCache() const; @@ -191,21 +191,21 @@ namespace xmltooling { /** * Returns the global PathResolver instance. * - * @return global PathResolver or NULL + * @return global PathResolver or nullptr */ PathResolver* getPathResolver() const; /** * Returns the global TemplateEngine instance. * - * @return global TemplateEngine or NULL + * @return global TemplateEngine or nullptr */ TemplateEngine* getTemplateEngine() const; /** * Returns the global URLEncoder instance. * - * @return global URLEncoder or NULL + * @return global URLEncoder or nullptr */ const URLEncoder* getURLEncoder() const; diff --git a/xmltooling/base.h b/xmltooling/base.h index d1192dc..0bd9062 100644 --- a/xmltooling/base.h +++ b/xmltooling/base.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 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. @@ -17,8 +17,8 @@ /** * @file xmltooling/base.h * - * Base header file definitions - * Must be included prior to including any other header + * Base header file definitions. + * Must be included prior to including any other header. */ #ifndef __xmltooling_base_h__ @@ -39,6 +39,10 @@ # define XMLTOOLING_NO_XMLSEC 1 #endif +#ifndef HAVE_NULLPTR +# define nullptr 0 +#endif + #if defined(XMLTOOLING_NO_XMLSEC) || !defined(HAVE_XSECSIZE_T) # ifdef XMLTOOLING_XERCESC_64BITSAFE # include @@ -683,7 +687,7 @@ XMLCh* m_##proper; \ public: \ pair get##proper() const { \ - return make_pair((m_##proper!=NULL),(m_##proper!=NULL ? xercesc::XMLString::parseInt(m_##proper): 0)); \ + return make_pair((m_##proper!=nullptr),(m_##proper!=nullptr ? xercesc::XMLString::parseInt(m_##proper): 0)); \ } \ void set##proper(const XMLCh* proper) { \ m_##proper = prepareForAssignment(m_##proper,proper); \ @@ -731,7 +735,7 @@ void set##proper(const type* proper) { \ m_##proper = prepareForAssignment(m_##proper,proper); \ XMLString::release(&m_##proper##Prefix); \ - m_##proper##Prefix = NULL; \ + m_##proper##Prefix = nullptr; \ } /** @@ -1237,7 +1241,7 @@ #define DECL_INTEGER_CONTENT(proper) \ XMLTOOLING_DOXYGEN(Returns proper in integer form after a NULL indicator.) \ std::pair get##proper() const { \ - return std::make_pair((getTextContent()!=NULL), (getTextContent()!=NULL ? xercesc::XMLString::parseInt(getTextContent()) : 0)); \ + return std::make_pair((getTextContent()!=nullptr), (getTextContent()!=nullptr ? xercesc::XMLString::parseInt(getTextContent()) : 0)); \ } \ XMLTOOLING_DOXYGEN(Sets proper.) \ void set##proper(int proper) { \ @@ -1334,7 +1338,7 @@ } \ XMLTOOLING_DOXYGEN(Builder that allows element/type override.) \ virtual cname* buildObject( \ - const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL \ + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const xmltooling::QName* schemaType=nullptr \ ) const /** @@ -1399,7 +1403,7 @@ } \ XMLTOOLING_DOXYGEN(Builder that allows element/type override.) \ virtual xmltooling::XMLObject* buildObject( \ - const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL \ + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const xmltooling::QName* schemaType=nullptr \ ) const /** @@ -1561,11 +1565,11 @@ */ #define XMLOBJECTVALIDATOR_ONLYONEOF3(cname,proper1,proper2,proper3) \ int c##proper1##proper2##proper3=0; \ - if (ptr->get##proper1()!=NULL) \ + if (ptr->get##proper1()!=nullptr) \ c##proper1##proper2##proper3++; \ - if (ptr->get##proper2()!=NULL) \ + if (ptr->get##proper2()!=nullptr) \ c##proper1##proper2##proper3++; \ - if (ptr->get##proper3()!=NULL) \ + if (ptr->get##proper3()!=nullptr) \ c##proper1##proper2##proper3++; \ if (c##proper1##proper2##proper3 != 1) \ throw xmltooling::ValidationException(#cname" must have only one of "#proper1", "#proper2", or "#proper3".") diff --git a/xmltooling/config_pub.h.in b/xmltooling/config_pub.h.in index 736d7ec..144a1f8 100644 --- a/xmltooling/config_pub.h.in +++ b/xmltooling/config_pub.h.in @@ -1,6 +1,9 @@ /* Define if C++ compiler supports covariant virtual methods. */ #undef HAVE_COVARIANT_RETURNS +/* Define to 1 if C++ compiler supports nullptr keyword. */ +#undef HAVE_NULLPTR + /* Define to 1 if you have an STL implementation that supports useful string specialization. */ #undef HAVE_GOOD_STL diff --git a/xmltooling/config_pub_win32.h b/xmltooling/config_pub_win32.h index 2652bb9..ae1db58 100644 --- a/xmltooling/config_pub_win32.h +++ b/xmltooling/config_pub_win32.h @@ -1,6 +1,11 @@ /* Define if C++ compiler supports covariant virtual methods. */ #define HAVE_COVARIANT_RETURNS 1 +/* Define to 1 if C++ compiler supports nullptr keyword. */ +#if _MSC_VER >= 1600 +# define HAVE_NULLPTR 1 +#endif + /* Define to 1 if you have an STL implementation that supports useful string specialization. */ #define HAVE_GOOD_STL 1 diff --git a/xmltooling/encryption/Decrypter.h b/xmltooling/encryption/Decrypter.h index d8e2586..1a3ddc0 100644 --- a/xmltooling/encryption/Decrypter.h +++ b/xmltooling/encryption/Decrypter.h @@ -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. @@ -53,9 +53,9 @@ namespace xmlencryption { * @param EKResolver locates an EncryptedKey pertaining to the EncryptedData */ Decrypter( - const xmltooling::CredentialResolver* credResolver=NULL, - xmltooling::CredentialCriteria* criteria=NULL, - const EncryptedKeyResolver* EKResolver=NULL + const xmltooling::CredentialResolver* credResolver=nullptr, + xmltooling::CredentialCriteria* criteria=nullptr, + const EncryptedKeyResolver* EKResolver=nullptr ); virtual ~Decrypter(); @@ -70,7 +70,7 @@ namespace xmlencryption { /** * Replace the current CredentialResolver interface, if any, with a new one. * - * @param resolver the locked CredentialResolver to attach, or NULL to clear + * @param resolver the locked CredentialResolver to attach, or nullptr to clear * @param criteria optional external criteria to use with resolver */ void setKEKResolver(const xmltooling::CredentialResolver* resolver, xmltooling::CredentialCriteria* criteria); @@ -107,7 +107,7 @@ namespace xmlencryption { * @param recipient identifier of decrypting entity for use in identifying multi-cast keys * @return the decrypted DOM fragment */ - xercesc::DOMDocumentFragment* decryptData(const EncryptedData& encryptedData, const XMLCh* recipient=NULL); + xercesc::DOMDocumentFragment* decryptData(const EncryptedData& encryptedData, const XMLCh* recipient=nullptr); /** * Decrypts the supplied information to an output stream. @@ -125,7 +125,7 @@ namespace xmlencryption { * @param encryptedData the data to decrypt * @param recipient identifier of decrypting entity for use in identifying multi-cast keys */ - void decryptData(std::ostream& out, const EncryptedData& encryptedData, const XMLCh* recipient=NULL); + void decryptData(std::ostream& out, const EncryptedData& encryptedData, const XMLCh* recipient=nullptr); /** * Decrypts the supplied information and returns the resulting key. diff --git a/xmltooling/encryption/EncryptedKeyResolver.h b/xmltooling/encryption/EncryptedKeyResolver.h index a93a825..3cd7a90 100644 --- a/xmltooling/encryption/EncryptedKeyResolver.h +++ b/xmltooling/encryption/EncryptedKeyResolver.h @@ -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. @@ -43,7 +43,7 @@ namespace xmlencryption { * @param recipient identifier of recipient of encrypted key * @return the resolved EncryptedKey object */ - virtual const EncryptedKey* resolveKey(const EncryptedData& encryptedData, const XMLCh* recipient=NULL) const; + virtual const EncryptedKey* resolveKey(const EncryptedData& encryptedData, const XMLCh* recipient=nullptr) const; }; }; diff --git a/xmltooling/encryption/Encrypter.h b/xmltooling/encryption/Encrypter.h index a195585..140a860 100644 --- a/xmltooling/encryption/Encrypter.h +++ b/xmltooling/encryption/Encrypter.h @@ -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. @@ -82,9 +82,9 @@ namespace xmlencryption { */ EncryptionParams( const XMLCh* algorithm=DSIGConstants::s_unicodeStrURIAES128_CBC, - const unsigned char* keyBuffer=NULL, + const unsigned char* keyBuffer=nullptr, unsigned int keyBufferSize=0, - const xmltooling::Credential* credential=NULL, + const xmltooling::Credential* credential=nullptr, bool compact=false ); @@ -118,7 +118,7 @@ namespace xmlencryption { * @param recipient optional name of recipient of encrypted key */ KeyEncryptionParams( - const xmltooling::Credential& credential, const XMLCh* algorithm=NULL, const XMLCh* recipient=NULL + const xmltooling::Credential& credential, const XMLCh* algorithm=nullptr, const XMLCh* recipient=nullptr ); ~KeyEncryptionParams(); @@ -149,11 +149,11 @@ namespace xmlencryption { * * @param element the DOM element to encrypt * @param encParams primary encryption settings - * @param kencParams key encryption settings, or NULL + * @param kencParams key encryption settings, or nullptr * @return a stand-alone EncryptedData object, unconnected to the source DOM */ EncryptedData* encryptElement( - xercesc::DOMElement* element, EncryptionParams& encParams, KeyEncryptionParams* kencParams=NULL + xercesc::DOMElement* element, EncryptionParams& encParams, KeyEncryptionParams* kencParams=nullptr ); /** @@ -168,11 +168,11 @@ namespace xmlencryption { * * @param element parent element of children to encrypt * @param encParams primary encryption settings - * @param kencParams key encryption settings, or NULL + * @param kencParams key encryption settings, or nullptr * @return a stand-alone EncryptedData object, unconnected to the source DOM */ EncryptedData* encryptElementContent( - xercesc::DOMElement* element, EncryptionParams& encParams, KeyEncryptionParams* kencParams=NULL + xercesc::DOMElement* element, EncryptionParams& encParams, KeyEncryptionParams* kencParams=nullptr ); /** @@ -187,10 +187,10 @@ namespace xmlencryption { * * @param input the stream to encrypt * @param encParams primary encryption settings - * @param kencParams key encryption settings, or NULL + * @param kencParams key encryption settings, or nullptr * @return a stand-alone EncryptedData object, unconnected to any DOM */ - EncryptedData* encryptStream(std::istream& input, EncryptionParams& encParams, KeyEncryptionParams* kencParams=NULL); + EncryptedData* encryptStream(std::istream& input, EncryptionParams& encParams, KeyEncryptionParams* kencParams=nullptr); /** * Encrypts the supplied key and returns the resulting object. diff --git a/xmltooling/encryption/impl/Decrypter.cpp b/xmltooling/encryption/impl/Decrypter.cpp index aeacbbc..3f4adb9 100644 --- a/xmltooling/encryption/impl/Decrypter.cpp +++ b/xmltooling/encryption/impl/Decrypter.cpp @@ -45,7 +45,7 @@ using namespace xercesc; using namespace std; Decrypter::Decrypter(const CredentialResolver* credResolver, CredentialCriteria* criteria, const EncryptedKeyResolver* EKResolver) - : m_cipher(NULL), m_credResolver(credResolver), m_criteria(criteria), m_EKResolver(EKResolver) + : m_cipher(nullptr), m_credResolver(credResolver), m_criteria(criteria), m_EKResolver(EKResolver) { } @@ -68,14 +68,14 @@ void Decrypter::setKEKResolver(const CredentialResolver* resolver, CredentialCri DOMDocumentFragment* Decrypter::decryptData(const EncryptedData& encryptedData, XSECCryptoKey* key) { - if (encryptedData.getDOM()==NULL) + if (encryptedData.getDOM()==nullptr) throw DecryptionException("The object must be marshalled before decryption."); // We can reuse the cipher object if the document hasn't changed. if (m_cipher && m_cipher->getDocument()!=encryptedData.getDOM()->getOwnerDocument()) { XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher); - m_cipher=NULL; + m_cipher=nullptr; } if (!m_cipher) @@ -141,12 +141,12 @@ DOMDocumentFragment* Decrypter::decryptData(const EncryptedData& encryptedData, // We need to find an encrypted decryption key somewhere. We'll need the underlying algorithm... const XMLCh* algorithm= - encryptedData.getEncryptionMethod() ? encryptedData.getEncryptionMethod()->getAlgorithm() : NULL; + encryptedData.getEncryptionMethod() ? encryptedData.getEncryptionMethod()->getAlgorithm() : nullptr; if (!algorithm) throw DecryptionException("No EncryptionMethod/@Algorithm set, key decryption cannot proceed."); // Check for external resolver. - const EncryptedKey* encKey=NULL; + const EncryptedKey* encKey=nullptr; if (m_EKResolver) encKey = m_EKResolver->resolveKey(encryptedData, recipient); else { @@ -165,14 +165,14 @@ DOMDocumentFragment* Decrypter::decryptData(const EncryptedData& encryptedData, void Decrypter::decryptData(ostream& out, const EncryptedData& encryptedData, XSECCryptoKey* key) { - if (encryptedData.getDOM()==NULL) + if (encryptedData.getDOM()==nullptr) throw DecryptionException("The object must be marshalled before decryption."); // We can reuse the cipher object if the document hasn't changed. if (m_cipher && m_cipher->getDocument()!=encryptedData.getDOM()->getOwnerDocument()) { XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher); - m_cipher=NULL; + m_cipher=nullptr; } if (!m_cipher) @@ -238,12 +238,12 @@ void Decrypter::decryptData(ostream& out, const EncryptedData& encryptedData, co // We need to find an encrypted decryption key somewhere. We'll need the underlying algorithm... const XMLCh* algorithm= - encryptedData.getEncryptionMethod() ? encryptedData.getEncryptionMethod()->getAlgorithm() : NULL; + encryptedData.getEncryptionMethod() ? encryptedData.getEncryptionMethod()->getAlgorithm() : nullptr; if (!algorithm) throw DecryptionException("No EncryptionMethod/@Algorithm set, key decryption cannot proceed."); // Check for external resolver. - const EncryptedKey* encKey=NULL; + const EncryptedKey* encKey=nullptr; if (m_EKResolver) encKey = m_EKResolver->resolveKey(encryptedData, recipient); else { @@ -265,7 +265,7 @@ XSECCryptoKey* Decrypter::decryptKey(const EncryptedKey& encryptedKey, const XML if (!m_credResolver) throw DecryptionException("No CredentialResolver supplied to provide decryption keys."); - if (encryptedKey.getDOM()==NULL) + if (encryptedKey.getDOM()==nullptr) throw DecryptionException("The object must be marshalled before decryption."); XSECAlgorithmHandler* handler; @@ -286,7 +286,7 @@ XSECCryptoKey* Decrypter::decryptKey(const EncryptedKey& encryptedKey, const XML if (m_cipher && m_cipher->getDocument()!=encryptedKey.getDOM()->getOwnerDocument()) { XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher); - m_cipher=NULL; + m_cipher=nullptr; } if (!m_cipher) diff --git a/xmltooling/encryption/impl/EncryptedKeyResolver.cpp b/xmltooling/encryption/impl/EncryptedKeyResolver.cpp index 421bec6..da657e7 100644 --- a/xmltooling/encryption/impl/EncryptedKeyResolver.cpp +++ b/xmltooling/encryption/impl/EncryptedKeyResolver.cpp @@ -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. @@ -40,7 +40,7 @@ EncryptedKeyResolver::~EncryptedKeyResolver() const EncryptedKey* EncryptedKeyResolver::resolveKey(const EncryptedData& encryptedData, const XMLCh* recipient) const { if (!encryptedData.getKeyInfo()) - return NULL; + return nullptr; const vector& others=const_cast(encryptedData.getKeyInfo())->getUnknownXMLObjects(); for (vector::const_iterator i=others.begin(); i!=others.end(); i++) { @@ -49,5 +49,5 @@ const EncryptedKey* EncryptedKeyResolver::resolveKey(const EncryptedData& encryp return encKey; } - return NULL; + return nullptr; } diff --git a/xmltooling/encryption/impl/Encrypter.cpp b/xmltooling/encryption/impl/Encrypter.cpp index a6996c0..3ee5da8 100644 --- a/xmltooling/encryption/impl/Encrypter.cpp +++ b/xmltooling/encryption/impl/Encrypter.cpp @@ -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. @@ -59,7 +59,7 @@ Encrypter::KeyEncryptionParams::~KeyEncryptionParams() { } -Encrypter::Encrypter() : m_cipher(NULL) +Encrypter::Encrypter() : m_cipher(nullptr) { } @@ -88,7 +88,7 @@ void Encrypter::checkParams(EncryptionParams& encParams, KeyEncryptionParams* ke } } - XSECCryptoKey* key=NULL; + XSECCryptoKey* key=nullptr; if (encParams.m_credential) { key = encParams.m_credential->getPrivateKey(); if (!key) @@ -99,7 +99,7 @@ void Encrypter::checkParams(EncryptionParams& encParams, KeyEncryptionParams* ke else { // We have to have a raw key now, so we need to build a wrapper around it. XSECAlgorithmHandler* handler =XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(encParams.m_algorithm); - if (handler != NULL) + if (handler != nullptr) key = handler->createKeyForURI( encParams.m_algorithm,const_cast(encParams.m_keyBuffer),encParams.m_keyBufferSize ); @@ -132,7 +132,7 @@ EncryptedData* Encrypter::encryptElement(DOMElement* element, EncryptionParams& if (m_cipher && m_cipher->getDocument()!=element->getOwnerDocument()) { XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher); - m_cipher=NULL; + m_cipher=nullptr; } if (!m_cipher) { @@ -160,7 +160,7 @@ EncryptedData* Encrypter::encryptElementContent(DOMElement* element, EncryptionP if (m_cipher && m_cipher->getDocument()!=element->getOwnerDocument()) { XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher); - m_cipher=NULL; + m_cipher=nullptr; } if (!m_cipher) { @@ -188,10 +188,10 @@ EncryptedData* Encrypter::encryptStream(istream& input, EncryptionParams& encPar if (m_cipher) { XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher); - m_cipher=NULL; + m_cipher=nullptr; } - DOMDocument* doc=NULL; + DOMDocument* doc=nullptr; try { doc=XMLToolingConfig::getConfig().getParser().newDocument(); XercesJanitor janitor(doc); @@ -219,7 +219,7 @@ EncryptedData* Encrypter::decorateAndUnmarshall(EncryptionParams& encParams, Key throw EncryptionException("No EncryptedData element found?"); // Unmarshall a tooling version of EncryptedData around the DOM. - EncryptedData* xmlEncData=NULL; + EncryptedData* xmlEncData=nullptr; auto_ptr xmlObject(XMLObjectBuilder::buildOneFromElement(encData->getElement())); if (!(xmlObject.get()) || !(xmlEncData=dynamic_cast(xmlObject.get()))) throw EncryptionException("Unable to unmarshall into EncryptedData object."); @@ -228,7 +228,7 @@ EncryptedData* Encrypter::decorateAndUnmarshall(EncryptionParams& encParams, Key xmlEncData->releaseThisAndChildrenDOM(); // KeyInfo? - KeyInfo* kinfo = encParams.m_credential ? encParams.m_credential->getKeyInfo(encParams.m_compact) : NULL; + KeyInfo* kinfo = encParams.m_credential ? encParams.m_credential->getKeyInfo(encParams.m_compact) : nullptr; if (kinfo) xmlEncData->setKeyInfo(kinfo); @@ -245,7 +245,7 @@ EncryptedData* Encrypter::decorateAndUnmarshall(EncryptionParams& encParams, Key auto_ptr encKey( m_cipher->encryptKey(encParams.m_keyBuffer, encParams.m_keyBufferSize, ENCRYPT_NONE, kencParams->m_algorithm) ); - EncryptedKey* xmlEncKey=NULL; + EncryptedKey* xmlEncKey=nullptr; auto_ptr xmlObjectKey(XMLObjectBuilder::buildOneFromElement(encKey->getElement())); if (!(xmlObjectKey.get()) || !(xmlEncKey=dynamic_cast(xmlObjectKey.get()))) throw EncryptionException("Unable to unmarshall into EncryptedKey object."); @@ -280,14 +280,14 @@ EncryptedKey* Encrypter::encryptKey( if (m_cipher) { XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher); - m_cipher=NULL; + m_cipher=nullptr; } XSECCryptoKey* kek = kencParams.m_credential.getPublicKey(); if (!kek) throw EncryptionException("Credential in KeyEncryptionParams structure did not supply a public key."); - DOMDocument* doc=NULL; + DOMDocument* doc=nullptr; try { doc=XMLToolingConfig::getConfig().getParser().newDocument(); XercesJanitor janitor(doc); @@ -296,7 +296,7 @@ EncryptedKey* Encrypter::encryptKey( m_cipher->setKEK(kek->clone()); auto_ptr encKey(m_cipher->encryptKey(keyBuffer, keyBufferSize, ENCRYPT_NONE, kencParams.m_algorithm)); - EncryptedKey* xmlEncKey=NULL; + EncryptedKey* xmlEncKey=nullptr; auto_ptr xmlObjectKey(XMLObjectBuilder::buildOneFromElement(encKey->getElement())); if (!(xmlObjectKey.get()) || !(xmlEncKey=dynamic_cast(xmlObjectKey.get()))) throw EncryptionException("Unable to unmarshall into EncryptedKey object."); @@ -347,5 +347,5 @@ const XMLCh* Encrypter::getKeyTransportAlgorithm(const Credential& credential, c return DSIGConstants::s_unicodeStrURIKW_3DES; } - return NULL; + return nullptr; } diff --git a/xmltooling/encryption/impl/EncryptionImpl.cpp b/xmltooling/encryption/impl/EncryptionImpl.cpp index 6843b4a..ab5223e 100644 --- a/xmltooling/encryption/impl/EncryptionImpl.cpp +++ b/xmltooling/encryption/impl/EncryptionImpl.cpp @@ -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. @@ -59,11 +59,11 @@ namespace xmlencryption { public AbstractXMLObjectUnmarshaller { void init() { - m_Algorithm=NULL; - m_KeySize=NULL; - m_OAEPparams=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); + m_Algorithm=nullptr; + m_KeySize=nullptr; + m_OAEPparams=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_KeySize=m_children.begin(); m_pos_OAEPparams=m_pos_KeySize; ++m_pos_OAEPparams; @@ -99,7 +99,7 @@ namespace xmlencryption { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Algorithm,ALGORITHM,NULL); + MARSHALL_STRING_ATTRIB(Algorithm,ALGORITHM,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -117,7 +117,7 @@ namespace xmlencryption { } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(Algorithm,ALGORITHM,NULL); + PROC_STRING_ATTRIB(Algorithm,ALGORITHM,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -162,9 +162,9 @@ namespace xmlencryption { public AbstractXMLObjectUnmarshaller { void init() { - m_URI=NULL; - m_Transforms=NULL; - m_children.push_back(NULL); + m_URI=nullptr; + m_Transforms=nullptr; + m_children.push_back(nullptr); m_pos_Transforms=m_children.begin(); } public: @@ -191,7 +191,7 @@ namespace xmlencryption { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(URI,URI,NULL); + MARSHALL_STRING_ATTRIB(URI,URI,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -200,7 +200,7 @@ namespace xmlencryption { } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(URI,URI,NULL); + PROC_STRING_ATTRIB(URI,URI,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -212,10 +212,10 @@ namespace xmlencryption { public AbstractXMLObjectUnmarshaller { void init() { - m_CipherValue=NULL; - m_CipherReference=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); + m_CipherValue=nullptr; + m_CipherReference=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_CipherValue=m_children.begin(); m_pos_CipherReference=m_pos_CipherValue; ++m_pos_CipherReference; @@ -257,7 +257,7 @@ namespace xmlencryption { public AbstractXMLObjectUnmarshaller { void init() { - m_Id=m_Target=NULL; + m_Id=m_Target=nullptr; } public: virtual ~EncryptionPropertyImpl() { @@ -284,7 +284,7 @@ namespace xmlencryption { } IMPL_XMLOBJECT_CLONE(EncryptionProperty); - IMPL_ID_ATTRIB_EX(Id,ID,NULL); + IMPL_ID_ATTRIB_EX(Id,ID,nullptr); IMPL_STRING_ATTRIB(Target); IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject, m_children.end()); @@ -304,8 +304,8 @@ namespace xmlencryption { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_ID_ATTRIB(Id,ID,NULL); - MARSHALL_STRING_ATTRIB(Target,TARGET,NULL); + MARSHALL_ID_ATTRIB(Id,ID,nullptr); + MARSHALL_STRING_ATTRIB(Target,TARGET,nullptr); marshallExtensionAttributes(domElement); } @@ -314,7 +314,7 @@ namespace xmlencryption { } void processAttribute(const DOMAttr* attribute) { - PROC_ID_ATTRIB(Id,ID,NULL); + PROC_ID_ATTRIB(Id,ID,nullptr); unmarshallExtensionAttribute(attribute); } }; @@ -326,7 +326,7 @@ namespace xmlencryption { public AbstractXMLObjectUnmarshaller { void init() { - m_Id=NULL; + m_Id=nullptr; } public: virtual ~EncryptionPropertiesImpl() { @@ -351,12 +351,12 @@ namespace xmlencryption { } IMPL_XMLOBJECT_CLONE(EncryptionProperties); - IMPL_ID_ATTRIB_EX(Id,ID,NULL); + IMPL_ID_ATTRIB_EX(Id,ID,nullptr); IMPL_TYPED_CHILDREN(EncryptionProperty,m_children.end()); protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_ID_ATTRIB(Id,ID,NULL); + MARSHALL_ID_ATTRIB(Id,ID,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -365,7 +365,7 @@ namespace xmlencryption { } void processAttribute(const DOMAttr* attribute) { - PROC_ID_ATTRIB(Id,ID,NULL); + PROC_ID_ATTRIB(Id,ID,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -377,7 +377,7 @@ namespace xmlencryption { public AbstractXMLObjectUnmarshaller { void init() { - m_URI=NULL; + m_URI=nullptr; } protected: @@ -410,7 +410,7 @@ namespace xmlencryption { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(URI,URI,NULL); + MARSHALL_STRING_ATTRIB(URI,URI,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -418,7 +418,7 @@ namespace xmlencryption { } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(URI,URI,NULL); + PROC_STRING_ATTRIB(URI,URI,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -506,15 +506,15 @@ namespace xmlencryption { public AbstractXMLObjectUnmarshaller { void init() { - m_Id=m_Type=m_MimeType=m_Encoding=NULL; - m_EncryptionMethod=NULL; - m_KeyInfo=NULL; - m_CipherData=NULL; - m_EncryptionProperties=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); + m_Id=m_Type=m_MimeType=m_Encoding=nullptr; + m_EncryptionMethod=nullptr; + m_KeyInfo=nullptr; + m_CipherData=nullptr; + m_EncryptionProperties=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_EncryptionMethod=m_children.begin(); m_pos_KeyInfo=m_pos_EncryptionMethod; ++m_pos_KeyInfo; @@ -559,7 +559,7 @@ namespace xmlencryption { } IMPL_XMLOBJECT_CLONE(EncryptedType); - IMPL_ID_ATTRIB_EX(Id,ID,NULL); + IMPL_ID_ATTRIB_EX(Id,ID,nullptr); IMPL_STRING_ATTRIB(Type); IMPL_STRING_ATTRIB(MimeType); IMPL_STRING_ATTRIB(Encoding); @@ -570,10 +570,10 @@ namespace xmlencryption { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_ID_ATTRIB(Id,ID,NULL); - MARSHALL_STRING_ATTRIB(Type,TYPE,NULL); - MARSHALL_STRING_ATTRIB(MimeType,MIMETYPE,NULL); - MARSHALL_STRING_ATTRIB(Encoding,ENCODING,NULL); + MARSHALL_ID_ATTRIB(Id,ID,nullptr); + MARSHALL_STRING_ATTRIB(Type,TYPE,nullptr); + MARSHALL_STRING_ATTRIB(MimeType,MIMETYPE,nullptr); + MARSHALL_STRING_ATTRIB(Encoding,ENCODING,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -585,10 +585,10 @@ namespace xmlencryption { } void processAttribute(const DOMAttr* attribute) { - PROC_ID_ATTRIB(Id,ID,NULL); - PROC_STRING_ATTRIB(Type,TYPE,NULL); - PROC_STRING_ATTRIB(MimeType,MIMETYPE,NULL); - PROC_STRING_ATTRIB(Encoding,ENCODING,NULL); + PROC_ID_ATTRIB(Id,ID,nullptr); + PROC_STRING_ATTRIB(Type,TYPE,nullptr); + PROC_STRING_ATTRIB(MimeType,MIMETYPE,nullptr); + PROC_STRING_ATTRIB(Encoding,ENCODING,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -612,11 +612,11 @@ namespace xmlencryption { class XMLTOOL_DLLLOCAL EncryptedKeyImpl : public virtual EncryptedKey, public EncryptedTypeImpl { void init() { - m_Recipient=NULL; - m_ReferenceList=NULL; - m_CarriedKeyName=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); + m_Recipient=nullptr; + m_ReferenceList=nullptr; + m_CarriedKeyName=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_ReferenceList=m_pos_EncryptionProperties; ++m_pos_ReferenceList; m_pos_CarriedKeyName=m_pos_ReferenceList; @@ -647,7 +647,7 @@ namespace xmlencryption { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL); + MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,nullptr); EncryptedTypeImpl::marshallAttributes(domElement); } @@ -658,7 +658,7 @@ namespace xmlencryption { } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL); + PROC_STRING_ATTRIB(Recipient,RECIPIENT,nullptr); EncryptedTypeImpl::processAttribute(attribute); } }; diff --git a/xmltooling/exceptions.cpp b/xmltooling/exceptions.cpp index 8304297..8f39ddc 100644 --- a/xmltooling/exceptions.cpp +++ b/xmltooling/exceptions.cpp @@ -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. @@ -177,13 +177,13 @@ const char* XMLToolingException::getProperty(unsigned int index) const { char buf[20]; map::const_iterator i=m_params.find(unsigned_integer_to_string(buf,sizeof(buf),index)); - return (i==m_params.end()) ? NULL : i->second.c_str(); + return (i==m_params.end()) ? nullptr : i->second.c_str(); } const char* XMLToolingException::getProperty(const char* name) const { map::const_iterator i=m_params.find(name); - return (i==m_params.end()) ? NULL : i->second.c_str(); + return (i==m_params.end()) ? nullptr : i->second.c_str(); } const char* XMLToolingException::getMessage() const @@ -287,7 +287,7 @@ XMLToolingException* XMLToolingException::fromStream(std::istream& in) throw XMLToolingException("Invalid root element on serialized exception."); } - auto_ptr_char classname(root->getAttributeNS(NULL,type)); + auto_ptr_char classname(root->getAttributeNS(nullptr,type)); auto_ptr excep(XMLToolingException::getInstance(classname.get())); DOMElement* child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,message); @@ -299,7 +299,7 @@ XMLToolingException* XMLToolingException::fromStream(std::istream& in) const URLEncoder* encoder = XMLToolingConfig::getConfig().getURLEncoder(); child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,param); while (child && child->hasChildNodes()) { - auto_ptr_char n(child->getAttributeNS(NULL,name)); + auto_ptr_char n(child->getAttributeNS(nullptr,name)); char* encoded = XMLString::transcode(child->getFirstChild()->getNodeValue()); if (n.get() && encoded) { encoder->decode(encoded); diff --git a/xmltooling/exceptions.h b/xmltooling/exceptions.h index 7ed53d7..67baa82 100644 --- a/xmltooling/exceptions.h +++ b/xmltooling/exceptions.h @@ -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. @@ -44,7 +44,7 @@ class linkage name : public base { \ public: \ XMLTOOLING_DOXYGEN(Constructor) \ - name(const char* msg=NULL, const xmltooling::params& p=xmltooling::params()) : base(msg,p) {} \ + name(const char* msg=nullptr, const xmltooling::params& p=xmltooling::params()) : base(msg,p) {} \ XMLTOOLING_DOXYGEN(Constructor) \ name(const char* msg, const xmltooling::namedparams& p) : base(msg,p) {} \ XMLTOOLING_DOXYGEN(Constructor) \ @@ -148,7 +148,7 @@ namespace xmltooling { * @param msg error message * @param p an ordered set of positional parameter strings */ - XMLToolingException(const char* msg=NULL, const params& p=params()); + XMLToolingException(const char* msg=nullptr, const params& p=params()); /** * Constructs an exception using a message and named parameters. @@ -241,7 +241,7 @@ namespace xmltooling { * Returns the parameter property with the designated position (based from one). * * @param index position to access - * @return the parameter property or NULL + * @return the parameter property or nullptr */ const char* getProperty(unsigned int index) const; @@ -249,7 +249,7 @@ namespace xmltooling { * Returns the parameter property with the designated name. * * @param name named parameter to access - * @return the parameter property or NULL + * @return the parameter property or nullptr */ const char* getProperty(const char* name) const; diff --git a/xmltooling/impl/AnyElement.h b/xmltooling/impl/AnyElement.h index 4151cd3..0dc1c78 100644 --- a/xmltooling/impl/AnyElement.h +++ b/xmltooling/impl/AnyElement.h @@ -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. @@ -51,7 +51,7 @@ namespace xmltooling { public: virtual ~AnyElementImpl(); - AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL); + AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr); XMLObject* clone() const; @@ -76,7 +76,7 @@ namespace xmltooling { { public: XMLObject* buildObject( - const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr ) const; }; diff --git a/xmltooling/impl/MemoryStorageService.cpp b/xmltooling/impl/MemoryStorageService.cpp index 7fa702b..7592ce8 100644 --- a/xmltooling/impl/MemoryStorageService.cpp +++ b/xmltooling/impl/MemoryStorageService.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -44,17 +44,17 @@ namespace xmltooling { virtual ~MemoryStorageService(); bool createString(const char* context, const char* key, const char* value, time_t expiration); - int readString(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0); - int updateString(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0); + int readString(const char* context, const char* key, string* pvalue=nullptr, time_t* pexpiration=nullptr, int version=0); + int updateString(const char* context, const char* key, const char* value=nullptr, time_t expiration=0, int version=0); bool deleteString(const char* context, const char* key); bool createText(const char* context, const char* key, const char* value, time_t expiration) { return createString(context, key, value, expiration); } - int readText(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0) { + int readText(const char* context, const char* key, string* pvalue=nullptr, time_t* pexpiration=nullptr, int version=0) { return readString(context, key, pvalue, pexpiration, version); } - int updateText(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0) { + int updateText(const char* context, const char* key, const char* value=nullptr, time_t expiration=0, int version=0) { return updateString(context, key, value, expiration, version); } bool deleteText(const char* context, const char* key) { @@ -121,10 +121,10 @@ namespace xmltooling { static const XMLCh cleanupInterval[] = UNICODE_LITERAL_15(c,l,e,a,n,u,p,I,n,t,e,r,v,a,l); MemoryStorageService::MemoryStorageService(const DOMElement* e) - : m_lock(NULL), shutdown_wait(NULL), cleanup_thread(NULL), shutdown(false), m_cleanupInterval(0), + : m_lock(nullptr), shutdown_wait(nullptr), cleanup_thread(nullptr), shutdown(false), m_cleanupInterval(0), m_log(Category::getInstance(XMLTOOLING_LOGCAT".StorageService")) { - const XMLCh* tag=e ? e->getAttributeNS(NULL,cleanupInterval) : NULL; + const XMLCh* tag=e ? e->getAttributeNS(nullptr,cleanupInterval) : nullptr; if (tag && *tag) { m_cleanupInterval = XMLString::parseInt(tag); } @@ -141,7 +141,7 @@ MemoryStorageService::~MemoryStorageService() // Shut down the cleanup thread and let it know... shutdown = true; shutdown_wait->signal(); - cleanup_thread->join(NULL); + cleanup_thread->join(nullptr); delete cleanup_thread; delete shutdown_wait; @@ -172,7 +172,7 @@ void* MemoryStorageService::cleanup_fn(void* pv) break; unsigned long count=0; - time_t now = time(NULL); + time_t now = time(nullptr); cache->m_lock->wrlock(); SharedLock locker(cache->m_lock, false); for (map::iterator i=cache->m_contextMap.begin(); i!=cache->m_contextMap.end(); ++i) @@ -185,14 +185,14 @@ void* MemoryStorageService::cleanup_fn(void* pv) cache->m_log.info("cleanup thread finished"); mutex->unlock(); - return NULL; + return nullptr; } void MemoryStorageService::reap(const char* context) { Context& ctx = writeContext(context); SharedLock locker(m_lock, false); - ctx.reap(time(NULL)); + ctx.reap(time(nullptr)); } unsigned long MemoryStorageService::Context::reap(time_t exp) @@ -223,7 +223,7 @@ bool MemoryStorageService::createString(const char* context, const char* key, co map::iterator i=ctx.m_dataMap.find(key); if (i!=ctx.m_dataMap.end()) { // Not yet expired? - if (time(NULL) < i->second.expiration) + if (time(nullptr) < i->second.expiration) return false; // It's dead, so we can just remove it now and create the new record. ctx.m_dataMap.erase(i); @@ -243,7 +243,7 @@ int MemoryStorageService::readString(const char* context, const char* key, strin map::iterator i=ctx.m_dataMap.find(key); if (i==ctx.m_dataMap.end()) return 0; - else if (time(NULL) >= i->second.expiration) + else if (time(nullptr) >= i->second.expiration) return 0; if (pexpiration) *pexpiration = i->second.expiration; @@ -262,7 +262,7 @@ int MemoryStorageService::updateString(const char* context, const char* key, con map::iterator i=ctx.m_dataMap.find(key); if (i==ctx.m_dataMap.end()) return 0; - else if (time(NULL) >= i->second.expiration) + else if (time(nullptr) >= i->second.expiration) return 0; if (version > 0 && version != i->second.version) @@ -302,7 +302,7 @@ void MemoryStorageService::updateContext(const char* context, time_t expiration) Context& ctx = writeContext(context); SharedLock locker(m_lock, false); - time_t now = time(NULL); + time_t now = time(nullptr); map::iterator stop=ctx.m_dataMap.end(); for (map::iterator i = ctx.m_dataMap.begin(); i!=stop; ++i) { if (now < i->second.expiration) diff --git a/xmltooling/impl/UnknownElement.h b/xmltooling/impl/UnknownElement.h index d88d281..90d9a67 100644 --- a/xmltooling/impl/UnknownElement.h +++ b/xmltooling/impl/UnknownElement.h @@ -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. @@ -42,7 +42,7 @@ namespace xmltooling { class XMLTOOL_DLLLOCAL UnknownElementImpl : public AbstractSimpleElement, public AbstractDOMCachingXMLObject { public: - UnknownElementImpl(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL); + UnknownElementImpl(const XMLCh* namespaceURI=nullptr, const XMLCh* elementLocalName=nullptr, const XMLCh* namespacePrefix=nullptr); virtual ~UnknownElementImpl(); @@ -52,18 +52,18 @@ namespace xmltooling { void setTextContent(const XMLCh*, unsigned int position=0); xercesc::DOMElement* marshall( - xercesc::DOMDocument* document=NULL + xercesc::DOMDocument* document=nullptr #ifndef XMLTOOLING_NO_XMLSEC - ,const std::vector* sigs=NULL - ,const Credential* credential=NULL + ,const std::vector* sigs=nullptr + ,const Credential* credential=nullptr #endif ) const; xercesc::DOMElement* marshall( xercesc::DOMElement* parentElement #ifndef XMLTOOLING_NO_XMLSEC - ,const std::vector* sigs=NULL - ,const Credential* credential=NULL + ,const std::vector* sigs=nullptr + ,const Credential* credential=nullptr #endif ) const; XMLObject* unmarshall(xercesc::DOMElement* element, bool bindDocument=false); @@ -85,7 +85,7 @@ namespace xmltooling { { public: XMLObject* buildObject( - const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr ) const; }; diff --git a/xmltooling/internal.h b/xmltooling/internal.h index 6760ace..189617e 100644 --- a/xmltooling/internal.h +++ b/xmltooling/internal.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -78,9 +78,9 @@ namespace xmltooling { class XMLToolingInternalConfig : public XMLToolingConfig { public: - XMLToolingInternalConfig() : m_lock(NULL), m_parserPool(NULL), m_validatingPool(NULL) { + XMLToolingInternalConfig() : m_lock(nullptr), m_parserPool(nullptr), m_validatingPool(nullptr) { #ifndef XMLTOOLING_NO_XMLSEC - m_xsecProvider=NULL; + m_xsecProvider=nullptr; #endif } @@ -95,8 +95,8 @@ namespace xmltooling { void unlock(); // configuration - bool load_library(const char* path, void* context=NULL); - bool log_config(const char* config=NULL); + bool load_library(const char* path, void* context=nullptr); + bool log_config(const char* config=nullptr); // parser access ParserPool& getParser() const { @@ -118,7 +118,7 @@ namespace xmltooling { algmap_t::const_iterator i = m_algorithmMap.find(alg.get()); # endif if (i==m_algorithmMap.end()) - return std::pair(NULL,0); + return std::pair(nullptr,0); return std::make_pair(i->second.first.c_str(), i->second.second); } diff --git a/xmltooling/io/AbstractXMLObjectMarshaller.cpp b/xmltooling/io/AbstractXMLObjectMarshaller.cpp index 39b515c..c28bcbf 100644 --- a/xmltooling/io/AbstractXMLObjectMarshaller.cpp +++ b/xmltooling/io/AbstractXMLObjectMarshaller.cpp @@ -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 janitor(bindDocument ? document : NULL); + XercesJanitor 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(n)->getAttributes(); if (!attributes) @@ -368,7 +368,7 @@ void AbstractXMLObjectMarshaller::marshallContent( for (list::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 diff --git a/xmltooling/io/AbstractXMLObjectMarshaller.h b/xmltooling/io/AbstractXMLObjectMarshaller.h index bffe944..16eb776 100644 --- a/xmltooling/io/AbstractXMLObjectMarshaller.h +++ b/xmltooling/io/AbstractXMLObjectMarshaller.h @@ -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. @@ -41,18 +41,18 @@ namespace xmltooling { virtual ~AbstractXMLObjectMarshaller(); xercesc::DOMElement* marshall( - xercesc::DOMDocument* document=NULL + xercesc::DOMDocument* document=nullptr #ifndef XMLTOOLING_NO_XMLSEC - ,const std::vector* sigs=NULL - ,const Credential* credential=NULL + ,const std::vector* sigs=nullptr + ,const Credential* credential=nullptr #endif ) const; xercesc::DOMElement* marshall( xercesc::DOMElement* parentElement #ifndef XMLTOOLING_NO_XMLSEC - ,const std::vector* sigs=NULL - ,const Credential* credential=NULL + ,const std::vector* sigs=nullptr + ,const Credential* credential=nullptr #endif ) const; @@ -81,7 +81,7 @@ namespace xmltooling { * @throws SignatureException thrown if a problem occurs during signature creation */ void marshallInto( - xercesc::DOMElement* targetElement, const std::vector* sigs, const Credential* credential=NULL + xercesc::DOMElement* targetElement, const std::vector* sigs, const Credential* credential=nullptr ) const; #else /** diff --git a/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp b/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp index 2297b6a..e33a673 100644 --- a/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp +++ b/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp @@ -106,7 +106,7 @@ void AbstractXMLObjectUnmarshaller::unmarshallAttributes(const DOMElement* domEl if (XMLString::equals(nsuri,XMLNS_NS)) { if (XMLString::equals(attribute->getLocalName(),XMLNS_PREFIX)) { m_log.debug("found default namespace declaration, adding it to the list of namespaces on the XMLObject"); - addNamespace(Namespace(attribute->getValue(), NULL, true)); + addNamespace(Namespace(attribute->getValue(), nullptr, true)); } else if (XMLString::equals(attribute->getLocalName(),XML_PREFIX) && XMLString::equals(attribute->getNodeValue(),XML_NS)) { m_log.debug("found standard xml prefix declaration, ignoring as superfluous"); diff --git a/xmltooling/io/GenericRequest.h b/xmltooling/io/GenericRequest.h index a874040..cbf6e2f 100644 --- a/xmltooling/io/GenericRequest.h +++ b/xmltooling/io/GenericRequest.h @@ -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. @@ -91,7 +91,7 @@ namespace xmltooling { /** * Returns the raw request body. * - * @return the request body, or NULL + * @return the request body, or nullptr */ virtual const char* getRequestBody() const=0; @@ -100,7 +100,7 @@ namespace xmltooling { * If a parameter has multiple values, only one will be returned. * * @param name the name of the parameter to return - * @return a single parameter value or NULL + * @return a single parameter value or nullptr */ virtual const char* getParameter(const char* name) const=0; @@ -127,7 +127,7 @@ namespace xmltooling { /** * Gets the authentication type associated with the request. * - * @return the authentication type or NULL + * @return the authentication type or nullptr */ virtual std::string getAuthType() const { return ""; diff --git a/xmltooling/io/GenericResponse.h b/xmltooling/io/GenericResponse.h index 6b0d55c..5655762 100644 --- a/xmltooling/io/GenericResponse.h +++ b/xmltooling/io/GenericResponse.h @@ -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. @@ -43,9 +43,9 @@ namespace xmltooling { /** * Sets or clears the MIME type of the response. * - * @param type the MIME type, or NULL to clear + * @param type the MIME type, or nullptr to clear */ - virtual void setContentType(const char* type=NULL)=0; + virtual void setContentType(const char* type=nullptr)=0; /** * Sends a completed response to the client along with a diff --git a/xmltooling/io/HTTPRequest.cpp b/xmltooling/io/HTTPRequest.cpp index 2a71c30..8ca93c3 100644 --- a/xmltooling/io/HTTPRequest.cpp +++ b/xmltooling/io/HTTPRequest.cpp @@ -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. @@ -75,5 +75,5 @@ const char* HTTPRequest::getCookie(const char* name) const } } map::const_iterator lookup=m_cookieMap.find(name); - return (lookup==m_cookieMap.end()) ? NULL : lookup->second.c_str(); + return (lookup==m_cookieMap.end()) ? nullptr : lookup->second.c_str(); } diff --git a/xmltooling/io/HTTPRequest.h b/xmltooling/io/HTTPRequest.h index b2c65f5..5eb454f 100644 --- a/xmltooling/io/HTTPRequest.h +++ b/xmltooling/io/HTTPRequest.h @@ -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. @@ -94,7 +94,7 @@ namespace xmltooling { * Get a cookie value supplied by the client. * * @param name name of cookie - * @return cookie value or NULL + * @return cookie value or nullptr */ virtual const char* getCookie(const char* name) const; diff --git a/xmltooling/io/HTTPResponse.h b/xmltooling/io/HTTPResponse.h index 3810cf3..6e4514f 100644 --- a/xmltooling/io/HTTPResponse.h +++ b/xmltooling/io/HTTPResponse.h @@ -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. @@ -56,7 +56,7 @@ namespace xmltooling { * Sets or clears a response header. * * @param name header name - * @param value value to set, or NULL to clear + * @param value value to set, or nullptr to clear */ virtual void setResponseHeader(const char* name, const char* value); @@ -64,7 +64,7 @@ namespace xmltooling { * Sets a client cookie. * * @param name cookie name - * @param value value to set, or NULL to clear + * @param value value to set, or nullptr to clear */ virtual void setCookie(const char* name, const char* value); diff --git a/xmltooling/security/AbstractPKIXTrustEngine.h b/xmltooling/security/AbstractPKIXTrustEngine.h index 5d1a0d8..43bc661 100644 --- a/xmltooling/security/AbstractPKIXTrustEngine.h +++ b/xmltooling/security/AbstractPKIXTrustEngine.h @@ -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. @@ -52,7 +52,7 @@ namespace xmltooling { * * @param e DOM to supply configuration for provider */ - AbstractPKIXTrustEngine(const xercesc::DOMElement* e=NULL); + AbstractPKIXTrustEngine(const xercesc::DOMElement* e=nullptr); /** Flag controls whether every issuer in the trust path must have a CRL loaded. */ bool m_fullCRLChain; @@ -75,7 +75,7 @@ namespace xmltooling { bool validate( xmlsignature::Signature& sig, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; bool validate( @@ -85,21 +85,21 @@ namespace xmltooling { const char* in, unsigned int in_len, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; bool validate( XSECCryptoX509* certEE, const std::vector& certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; bool validate( X509* certEE, STACK_OF(X509)* certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; /** @@ -163,7 +163,7 @@ namespace xmltooling { * @return interface for obtaining validation data */ virtual PKIXValidationInfoIterator* getPKIXValidationInfoIterator( - const CredentialResolver& pkixSource, CredentialCriteria* criteria=NULL + const CredentialResolver& pkixSource, CredentialCriteria* criteria=nullptr ) const=0; private: @@ -171,8 +171,8 @@ namespace xmltooling { X509* certEE, STACK_OF(X509)* certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL, - const std::vector* inlineCRLs=NULL + CredentialCriteria* criteria=nullptr, + const std::vector* inlineCRLs=nullptr ) const; }; }; diff --git a/xmltooling/security/BasicX509Credential.h b/xmltooling/security/BasicX509Credential.h index 09d9ffe..1bfe2ec 100644 --- a/xmltooling/security/BasicX509Credential.h +++ b/xmltooling/security/BasicX509Credential.h @@ -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. @@ -55,7 +55,7 @@ namespace xmltooling { * @param certs array of X.509 certificates, the first entry being the entity certificate * @param crl optional CRL */ - BasicX509Credential(XSECCryptoKey* key, const std::vector& certs, XSECCryptoX509CRL* crl=NULL); + BasicX509Credential(XSECCryptoKey* key, const std::vector& certs, XSECCryptoX509CRL* crl=nullptr); /** * Constructor. diff --git a/xmltooling/security/ChainingTrustEngine.h b/xmltooling/security/ChainingTrustEngine.h index ebee77e..80e5849 100644 --- a/xmltooling/security/ChainingTrustEngine.h +++ b/xmltooling/security/ChainingTrustEngine.h @@ -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. @@ -48,7 +48,7 @@ namespace xmltooling { * * @param e DOM to supply configuration for provider */ - ChainingTrustEngine(const xercesc::DOMElement* e=NULL); + ChainingTrustEngine(const xercesc::DOMElement* e=nullptr); /** * Destructor will delete any embedded engines. @@ -73,7 +73,7 @@ namespace xmltooling { bool validate( xmlsignature::Signature& sig, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; bool validate( const XMLCh* sigAlgorithm, @@ -82,19 +82,19 @@ namespace xmltooling { const char* in, unsigned int in_len, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; bool validate( XSECCryptoX509* certEE, const std::vector& certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; bool validate( X509* certEE, STACK_OF(X509)* certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; private: std::vector m_engines; diff --git a/xmltooling/security/Credential.h b/xmltooling/security/Credential.h index 781c3d8..0d2362f 100644 --- a/xmltooling/security/Credential.h +++ b/xmltooling/security/Credential.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -90,7 +90,7 @@ namespace xmltooling { /** * Returns an algorithm identifier for the Credential. * - * @return the Credential algorithm, or NULL if indeterminate + * @return the Credential algorithm, or nullptr if indeterminate */ virtual const char* getAlgorithm() const=0; diff --git a/xmltooling/security/CredentialResolver.h b/xmltooling/security/CredentialResolver.h index 5cd31fc..2ad4ffc 100644 --- a/xmltooling/security/CredentialResolver.h +++ b/xmltooling/security/CredentialResolver.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -46,9 +46,9 @@ namespace xmltooling { * Returns a single Credential according to the supplied criteria. * * @param criteria an optional CredentialCriteria object - * @return a Credential, or NULL if none could be found + * @return a Credential, or nullptr if none could be found */ - virtual const Credential* resolve(const CredentialCriteria* criteria=NULL) const=0; + virtual const Credential* resolve(const CredentialCriteria* criteria=nullptr) const=0; /** * Returns all matching Credentials according to the supplied criteria. @@ -58,7 +58,7 @@ namespace xmltooling { * @return number of credentials found */ virtual std::vector::size_type resolve( - std::vector& results, const CredentialCriteria* criteria=NULL + std::vector& results, const CredentialCriteria* criteria=nullptr ) const=0; }; diff --git a/xmltooling/security/KeyInfoCredentialContext.h b/xmltooling/security/KeyInfoCredentialContext.h index 56d927a..3f244a3 100644 --- a/xmltooling/security/KeyInfoCredentialContext.h +++ b/xmltooling/security/KeyInfoCredentialContext.h @@ -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. @@ -44,7 +44,7 @@ namespace xmltooling { * * @param keyInfo surrounding KeyInfo context object */ - KeyInfoCredentialContext(const xmlsignature::KeyInfo* keyInfo=NULL); + KeyInfoCredentialContext(const xmlsignature::KeyInfo* keyInfo=nullptr); /** * Constructor diff --git a/xmltooling/security/KeyInfoResolver.h b/xmltooling/security/KeyInfoResolver.h index 06163b8..042ccd3 100644 --- a/xmltooling/security/KeyInfoResolver.h +++ b/xmltooling/security/KeyInfoResolver.h @@ -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. @@ -60,7 +60,7 @@ namespace xmltooling { * * @param keyInfo the key information * @param types types of credentials to resolve, or 0 for any/all - * @return the resolved credential, or NULL + * @return the resolved credential, or nullptr */ virtual Credential* resolve(const xmlsignature::KeyInfo* keyInfo, int types=0) const=0; @@ -70,7 +70,7 @@ namespace xmltooling { * * @param keyInfo the key information * @param types types of credentials to resolve, or 0 for any/all - * @return the resolved credential, or NULL + * @return the resolved credential, or nullptr */ virtual Credential* resolve(DSIGKeyInfoList* keyInfo, int types=0) const=0; @@ -82,7 +82,7 @@ namespace xmltooling { * * @param context context containing the key information * @param types types of credentials to resolve, or 0 for any/all - * @return the resolved credential, or NULL + * @return the resolved credential, or nullptr */ virtual Credential* resolve(KeyInfoCredentialContext* context, int types=0) const=0; @@ -92,7 +92,7 @@ namespace xmltooling { * * @param sig signature containing the key information * @param types types of credentials to resolve, or 0 for any/all - * @return the resolved credential, or NULL + * @return the resolved credential, or nullptr */ Credential* resolve(const xmlsignature::Signature* sig, int types=0) const; @@ -102,7 +102,7 @@ namespace xmltooling { * * @param criteria criteria containing the key information * @param types types of credentials to resolve, or 0 for any/all - * @return the resolved credential, or NULL + * @return the resolved credential, or nullptr */ Credential* resolve(const CredentialCriteria& criteria, int types=0) const; }; diff --git a/xmltooling/security/OpenSSLCryptoX509CRL.h b/xmltooling/security/OpenSSLCryptoX509CRL.h index 1328420..8a93dd3 100644 --- a/xmltooling/security/OpenSSLCryptoX509CRL.h +++ b/xmltooling/security/OpenSSLCryptoX509CRL.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009 The Apache Software Foundation. + * Copyright 2001-2010 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ namespace xmltooling { /** * Returns native CRL object. * - * @return native CRL object, or NULL + * @return native CRL object, or nullptr */ X509_CRL* getOpenSSLX509CRL(); diff --git a/xmltooling/security/OpenSSLTrustEngine.h b/xmltooling/security/OpenSSLTrustEngine.h index 46f68f1..6f3bacf 100644 --- a/xmltooling/security/OpenSSLTrustEngine.h +++ b/xmltooling/security/OpenSSLTrustEngine.h @@ -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. @@ -49,7 +49,7 @@ namespace xmltooling { * * @param e DOM to supply configuration for provider */ - OpenSSLTrustEngine(const xercesc::DOMElement* e=NULL); + OpenSSLTrustEngine(const xercesc::DOMElement* e=nullptr); public: virtual ~OpenSSLTrustEngine(); @@ -77,7 +77,7 @@ namespace xmltooling { virtual bool validate( X509* certEE, STACK_OF(X509)* certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const=0; }; diff --git a/xmltooling/security/SecurityHelper.h b/xmltooling/security/SecurityHelper.h index 9e2398c..2650013 100644 --- a/xmltooling/security/SecurityHelper.h +++ b/xmltooling/security/SecurityHelper.h @@ -58,7 +58,7 @@ namespace xmltooling { * @param password optional password to decrypt key * @return a populated key object */ - static XSECCryptoKey* loadKeyFromFile(const char* pathname, const char* format=NULL, const char* password=NULL); + static XSECCryptoKey* loadKeyFromFile(const char* pathname, const char* format=nullptr, const char* password=nullptr); /** * Loads certificate(s) from a local file. @@ -70,7 +70,7 @@ namespace xmltooling { * @return size of the resulting array */ static std::vector::size_type loadCertificatesFromFile( - std::vector& certs, const char* pathname, const char* format=NULL, const char* password=NULL + std::vector& certs, const char* pathname, const char* format=nullptr, const char* password=nullptr ); /** @@ -82,7 +82,7 @@ namespace xmltooling { * @return size of the resulting array */ static std::vector::size_type loadCRLsFromFile( - std::vector& crls, const char* pathname, const char* format=NULL + std::vector& crls, const char* pathname, const char* format=nullptr ); /** @@ -94,7 +94,7 @@ namespace xmltooling { * @param password optional password to decrypt key * @return a populated key object */ - static XSECCryptoKey* loadKeyFromURL(SOAPTransport& transport, const char* backing, const char* format=NULL, const char* password=NULL); + static XSECCryptoKey* loadKeyFromURL(SOAPTransport& transport, const char* backing, const char* format=nullptr, const char* password=nullptr); /** * Loads certificate(s) from a URL. @@ -107,7 +107,7 @@ namespace xmltooling { * @return size of the resulting array */ static std::vector::size_type loadCertificatesFromURL( - std::vector& certs, SOAPTransport& transport, const char* backing, const char* format=NULL, const char* password=NULL + std::vector& certs, SOAPTransport& transport, const char* backing, const char* format=nullptr, const char* password=nullptr ); /** @@ -120,7 +120,7 @@ namespace xmltooling { * @return size of the resulting array */ static std::vector::size_type loadCRLsFromURL( - std::vector& crls, SOAPTransport& transport, const char* backing, const char* format=NULL + std::vector& crls, SOAPTransport& transport, const char* backing, const char* format=nullptr ); /** diff --git a/xmltooling/security/SignatureTrustEngine.h b/xmltooling/security/SignatureTrustEngine.h index fe17c16..8d72820 100644 --- a/xmltooling/security/SignatureTrustEngine.h +++ b/xmltooling/security/SignatureTrustEngine.h @@ -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. @@ -53,7 +53,7 @@ namespace xmltooling { * * @param e DOM to supply configuration for provider */ - SignatureTrustEngine(const xercesc::DOMElement* e=NULL); + SignatureTrustEngine(const xercesc::DOMElement* e=nullptr); public: virtual ~SignatureTrustEngine(); @@ -79,7 +79,7 @@ namespace xmltooling { virtual bool validate( xmlsignature::Signature& sig, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const=0; /** @@ -115,7 +115,7 @@ namespace xmltooling { const char* in, unsigned int in_len, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const=0; }; }; diff --git a/xmltooling/security/TrustEngine.h b/xmltooling/security/TrustEngine.h index 1e50c43..6c25ec4 100644 --- a/xmltooling/security/TrustEngine.h +++ b/xmltooling/security/TrustEngine.h @@ -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. @@ -51,7 +51,7 @@ namespace xmltooling { * * @param e DOM to supply configuration for provider */ - TrustEngine(const xercesc::DOMElement* e=NULL); + TrustEngine(const xercesc::DOMElement* e=nullptr); /** Custom KeyInfoResolver instance. */ KeyInfoResolver* m_keyInfoResolver; diff --git a/xmltooling/security/X509TrustEngine.h b/xmltooling/security/X509TrustEngine.h index 40590ee..4c29c6d 100644 --- a/xmltooling/security/X509TrustEngine.h +++ b/xmltooling/security/X509TrustEngine.h @@ -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. @@ -52,7 +52,7 @@ namespace xmltooling { * * @param e DOM to supply configuration for provider */ - X509TrustEngine(const xercesc::DOMElement* e=NULL); + X509TrustEngine(const xercesc::DOMElement* e=nullptr); public: virtual ~X509TrustEngine(); @@ -79,7 +79,7 @@ namespace xmltooling { XSECCryptoX509* certEE, const std::vector& certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const=0; }; diff --git a/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp b/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp index 1f0f8fc..0798115 100644 --- a/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp +++ b/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp @@ -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. @@ -58,7 +58,7 @@ namespace { STACK_OF(X509)* untrusted, AbstractPKIXTrustEngine::PKIXValidationInfoIterator* pkixInfo, bool fullCRLChain, - const vector* inlineCRLs=NULL + const vector* inlineCRLs=nullptr ) { Category& log=Category::getInstance(XMLTOOLING_LOGCAT".TrustEngine"); @@ -174,7 +174,7 @@ AbstractPKIXTrustEngine::PKIXValidationInfoIterator::~PKIXValidationInfoIterator AbstractPKIXTrustEngine::AbstractPKIXTrustEngine(const xercesc::DOMElement* e) : TrustEngine(e), m_fullCRLChain(false) { static XMLCh fullCRLChain[] = UNICODE_LITERAL_12(f,u,l,l,C,R,L,C,h,a,i,n); - const XMLCh* flag = e ? e->getAttributeNS(NULL, fullCRLChain) : NULL; + const XMLCh* flag = e ? e->getAttributeNS(nullptr, fullCRLChain) : nullptr; m_fullCRLChain = (flag && (*flag == xercesc::chLatin_t || *flag == xercesc::chDigit_1)); } @@ -211,8 +211,8 @@ bool AbstractPKIXTrustEngine::checkEntityNames( X509_NAME_print_ex(b2,subject,0,XN_FLAG_RFC2253 + XN_FLAG_SEP_CPLUS_SPC - XN_FLAG_SEP_COMMA_PLUS); BIO_flush(b2); - BUF_MEM* bptr=NULL; - BUF_MEM* bptr2=NULL; + BUF_MEM* bptr=nullptr; + BUF_MEM* bptr2=nullptr; BIO_get_mem_ptr(b, &bptr); BIO_get_mem_ptr(b2, &bptr2); @@ -240,7 +240,7 @@ bool AbstractPKIXTrustEngine::checkEntityNames( BIO_free(b2); log.debug("unable to match DN, trying TLS subjectAltName match"); - STACK_OF(GENERAL_NAME)* altnames=(STACK_OF(GENERAL_NAME)*)X509_get_ext_d2i(certEE, NID_subject_alt_name, NULL, NULL); + STACK_OF(GENERAL_NAME)* altnames=(STACK_OF(GENERAL_NAME)*)X509_get_ext_d2i(certEE, NID_subject_alt_name, nullptr, nullptr); if (altnames) { int numalts = sk_GENERAL_NAME_num(altnames); for (int an=0; an= 0) i = j; @@ -431,7 +431,7 @@ bool AbstractPKIXTrustEngine::validate( // Find and save off a pointer to the certificate that unlocks the object. // Most of the time, this will be the first one anyway. - XSECCryptoX509* certEE=NULL; + XSECCryptoX509* certEE=nullptr; SignatureValidator keyValidator; for (vector::const_iterator i=certs.begin(); !certEE && i!=certs.end(); ++i) { try { @@ -509,7 +509,7 @@ bool AbstractPKIXTrustEngine::validate( // Find and save off a pointer to the certificate that unlocks the object. // Most of the time, this will be the first one anyway. - XSECCryptoX509* certEE=NULL; + XSECCryptoX509* certEE=nullptr; for (vector::const_iterator i=certs.begin(); !certEE && i!=certs.end(); ++i) { try { auto_ptr key((*i)->clonePublicKey()); diff --git a/xmltooling/security/impl/BasicX509Credential.cpp b/xmltooling/security/impl/BasicX509Credential.cpp index fc51df8..a18cdc4 100644 --- a/xmltooling/security/impl/BasicX509Credential.cpp +++ b/xmltooling/security/impl/BasicX509Credential.cpp @@ -45,7 +45,7 @@ Credential::~Credential() const CredentialContext* Credential::getCredentalContext() const { - return NULL; + return nullptr; } X509Credential::X509Credential() @@ -72,11 +72,11 @@ CredentialContext::~CredentialContext() { } -KeyInfoCredentialContext::KeyInfoCredentialContext(const KeyInfo* keyInfo) : m_keyInfo(keyInfo), m_nativeKeyInfo(NULL) +KeyInfoCredentialContext::KeyInfoCredentialContext(const KeyInfo* keyInfo) : m_keyInfo(keyInfo), m_nativeKeyInfo(nullptr) { } -KeyInfoCredentialContext::KeyInfoCredentialContext(DSIGKeyInfoList* keyInfo) : m_keyInfo(NULL), m_nativeKeyInfo(keyInfo) +KeyInfoCredentialContext::KeyInfoCredentialContext(DSIGKeyInfoList* keyInfo) : m_keyInfo(nullptr), m_nativeKeyInfo(keyInfo) { } @@ -94,19 +94,19 @@ DSIGKeyInfoList* KeyInfoCredentialContext::getNativeKeyInfo() const return m_nativeKeyInfo; } -BasicX509Credential::BasicX509Credential(bool ownCerts) : m_key(NULL), m_ownCerts(ownCerts), m_keyInfo(NULL), m_compactKeyInfo(NULL) +BasicX509Credential::BasicX509Credential(bool ownCerts) : m_key(nullptr), m_ownCerts(ownCerts), m_keyInfo(nullptr), m_compactKeyInfo(nullptr) { } BasicX509Credential::BasicX509Credential(XSECCryptoKey* key, const vector& certs, XSECCryptoX509CRL* crl) - : m_key(key), m_xseccerts(certs), m_ownCerts(true), m_keyInfo(NULL), m_compactKeyInfo(NULL) + : m_key(key), m_xseccerts(certs), m_ownCerts(true), m_keyInfo(nullptr), m_compactKeyInfo(nullptr) { if (crl) m_crls.push_back(crl); } BasicX509Credential::BasicX509Credential(XSECCryptoKey* key, const vector& certs, const vector& crls) - : m_key(key), m_xseccerts(certs), m_ownCerts(true), m_crls(crls), m_keyInfo(NULL), m_compactKeyInfo(NULL) + : m_key(key), m_xseccerts(certs), m_ownCerts(true), m_crls(crls), m_keyInfo(nullptr), m_compactKeyInfo(nullptr) { } @@ -123,9 +123,9 @@ BasicX509Credential::~BasicX509Credential() void BasicX509Credential::initKeyInfo(unsigned int types) { delete m_keyInfo; - m_keyInfo = NULL; + m_keyInfo = nullptr; delete m_compactKeyInfo; - m_compactKeyInfo = NULL; + m_compactKeyInfo = nullptr; if (types == 0) types = KEYINFO_KEY_VALUE | KEYINFO_KEY_NAME | KEYINFO_X509_CERTIFICATE | KEYINFO_X509_SUBJECTNAME | KEYINFO_X509_ISSUERSERIAL; @@ -223,7 +223,7 @@ const char* BasicX509Credential::getAlgorithm() const } } } - return NULL; + return nullptr; } unsigned int BasicX509Credential::getKeySize() const @@ -261,7 +261,7 @@ XSECCryptoKey* BasicX509Credential::getPrivateKey() const if (type!=XSECCryptoKey::KEY_RSA_PUBLIC && type!=XSECCryptoKey::KEY_DSA_PUBLIC) return m_key; } - return NULL; + return nullptr; } XSECCryptoKey* BasicX509Credential::getPublicKey() const @@ -271,7 +271,7 @@ XSECCryptoKey* BasicX509Credential::getPublicKey() const if (type!=XSECCryptoKey::KEY_RSA_PRIVATE && type!=XSECCryptoKey::KEY_DSA_PRIVATE) return m_key; } - return NULL; + return nullptr; } const set& BasicX509Credential::getKeyNames() const @@ -282,7 +282,7 @@ const set& BasicX509Credential::getKeyNames() const KeyInfo* BasicX509Credential::getKeyInfo(bool compact) const { if (compact || !m_keyInfo) - return m_compactKeyInfo ? m_compactKeyInfo->cloneKeyInfo() : NULL; + return m_compactKeyInfo ? m_compactKeyInfo->cloneKeyInfo() : nullptr; return m_keyInfo->cloneKeyInfo(); } @@ -293,7 +293,7 @@ const vector& BasicX509Credential::getEntityCertificateChain() XSECCryptoX509CRL* BasicX509Credential::getCRL() const { - return m_crls.empty() ? NULL : m_crls.front(); + return m_crls.empty() ? nullptr : m_crls.front(); } const vector& BasicX509Credential::getCRLs() const @@ -318,7 +318,7 @@ const char* BasicX509Credential::getSerialNumber() const void BasicX509Credential::extract() { - XSECCryptoX509* x509 = m_xseccerts.empty() ? NULL : m_xseccerts.front(); + XSECCryptoX509* x509 = m_xseccerts.empty() ? nullptr : m_xseccerts.front(); if (!x509 || x509->getProviderName()!=DSIGConstants::s_unicodeStrPROVOpenSSL) return; X509* cert = static_cast(x509)->getOpenSSLX509(); @@ -330,7 +330,7 @@ void BasicX509Credential::extract() BIO* b = BIO_new(BIO_s_mem()); X509_NAME_print_ex(b,issuer,0,XN_FLAG_RFC2253); BIO_flush(b); - BUF_MEM* bptr=NULL; + BUF_MEM* bptr=nullptr; BIO_get_mem_ptr(b, &bptr); m_issuerName.erase(); m_issuerName.append(bptr->data, bptr->length); @@ -338,7 +338,7 @@ void BasicX509Credential::extract() } ASN1_INTEGER* serialASN = X509_get_serialNumber(cert); - BIGNUM* serialBN = ASN1_INTEGER_to_BN(serialASN, NULL); + BIGNUM* serialBN = ASN1_INTEGER_to_BN(serialASN, nullptr); if (serialBN) { char* serial = BN_bn2dec(serialBN); if (serial) { @@ -353,7 +353,7 @@ void BasicX509Credential::extract() BIO* b = BIO_new(BIO_s_mem()); X509_NAME_print_ex(b,subject,0,XN_FLAG_RFC2253); BIO_flush(b); - BUF_MEM* bptr=NULL; + BUF_MEM* bptr=nullptr; BIO_get_mem_ptr(b, &bptr); m_subjectName.erase(); m_subjectName.append(bptr->data, bptr->length); @@ -361,7 +361,7 @@ void BasicX509Credential::extract() BIO_free(b); // Fetch the last CN RDN. - char* peer_CN = NULL; + char* peer_CN = nullptr; int j,i = -1; while ((j=X509_NAME_get_index_by_NID(subject, NID_commonName, i)) >= 0) i = j; @@ -389,7 +389,7 @@ void BasicX509Credential::extract() OPENSSL_free(peer_CN); } - STACK_OF(GENERAL_NAME)* altnames=(STACK_OF(GENERAL_NAME)*)X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); + STACK_OF(GENERAL_NAME)* altnames=(STACK_OF(GENERAL_NAME)*)X509_get_ext_d2i(cert, NID_subject_alt_name, nullptr, nullptr); if (altnames) { int numalts = sk_GENERAL_NAME_num(altnames); for (int an=0; an::const_iterator cr = m_resolvers.begin(); !cred && cr!=m_resolvers.end(); ++cr) cred = (*cr)->resolve(criteria); return cred; } virtual vector::size_type resolve( - vector& results, const CredentialCriteria* criteria=NULL + vector& results, const CredentialCriteria* criteria=nullptr ) const { for (vector::const_iterator cr = m_resolvers.begin(); cr!=m_resolvers.end(); ++cr) (*cr)->resolve(results, criteria); @@ -87,9 +87,9 @@ ChainingCredentialResolver::ChainingCredentialResolver(const DOMElement* e) Category& log=Category::getInstance(XMLTOOLING_LOGCAT".CredentialResolver."CHAINING_CREDENTIAL_RESOLVER); // Load up the chain of resolvers. - e = e ? XMLHelper::getFirstChildElement(e, _CredentialResolver) : NULL; + e = e ? XMLHelper::getFirstChildElement(e, _CredentialResolver) : nullptr; while (e) { - auto_ptr_char type(e->getAttributeNS(NULL,_type)); + auto_ptr_char type(e->getAttributeNS(nullptr,_type)); if (type.get() && *(type.get())) { log.info("building CredentialResolver of type %s", type.get()); try { diff --git a/xmltooling/security/impl/ChainingTrustEngine.cpp b/xmltooling/security/impl/ChainingTrustEngine.cpp index dbf9cc7..f1a92fc 100644 --- a/xmltooling/security/impl/ChainingTrustEngine.cpp +++ b/xmltooling/security/impl/ChainingTrustEngine.cpp @@ -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. @@ -48,10 +48,10 @@ static const XMLCh type[] = UNICODE_LITERAL_4(t,y,p,e); ChainingTrustEngine::ChainingTrustEngine(const DOMElement* e) : TrustEngine(e) { Category& log=Category::getInstance(XMLTOOLING_LOGCAT".TrustEngine."CHAINING_TRUSTENGINE); - e = e ? XMLHelper::getFirstChildElement(e, _TrustEngine) : NULL; + e = e ? XMLHelper::getFirstChildElement(e, _TrustEngine) : nullptr; while (e) { try { - auto_ptr_char temp(e->getAttributeNS(NULL,type)); + auto_ptr_char temp(e->getAttributeNS(nullptr,type)); if (temp.get() && *temp.get()) { log.info("building TrustEngine of type %s", temp.get()); TrustEngine* engine = XMLToolingConfig::getConfig().TrustEngineManager.newPlugin(temp.get(), e); @@ -91,7 +91,7 @@ TrustEngine* ChainingTrustEngine::removeTrustEngine(TrustEngine* oldEngine) return oldEngine; } } - return NULL; + return nullptr; } bool ChainingTrustEngine::validate(Signature& sig, const CredentialResolver& credResolver, CredentialCriteria* criteria) const diff --git a/xmltooling/security/impl/CredentialCriteria.cpp b/xmltooling/security/impl/CredentialCriteria.cpp index 6fbcd92..8003bc5 100644 --- a/xmltooling/security/impl/CredentialCriteria.cpp +++ b/xmltooling/security/impl/CredentialCriteria.cpp @@ -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. @@ -42,8 +42,8 @@ using namespace xmltooling; using namespace std; CredentialCriteria::CredentialCriteria() - : m_keyUsage(Credential::UNSPECIFIED_CREDENTIAL), m_keySize(0), m_key(NULL), - m_keyInfo(NULL), m_nativeKeyInfo(NULL), m_credential(NULL) + : m_keyUsage(Credential::UNSPECIFIED_CREDENTIAL), m_keySize(0), m_key(nullptr), + m_keyInfo(nullptr), m_nativeKeyInfo(nullptr), m_credential(nullptr) { } @@ -104,7 +104,7 @@ void CredentialCriteria::setXMLAlgorithm(const XMLCh* algorithm) setKeySize(mapped.second); } else { - setKeyAlgorithm(NULL); + setKeyAlgorithm(nullptr); setKeySize(0); } } @@ -137,7 +137,7 @@ const KeyInfo* CredentialCriteria::getKeyInfo() const void CredentialCriteria::setKeyInfo(const KeyInfo* keyInfo, int extraction) { delete m_credential; - m_credential = NULL; + m_credential = nullptr; m_keyInfo = keyInfo; if (!keyInfo || !extraction) return; @@ -162,7 +162,7 @@ DSIGKeyInfoList* CredentialCriteria::getNativeKeyInfo() const void CredentialCriteria::setNativeKeyInfo(DSIGKeyInfoList* keyInfo, int extraction) { delete m_credential; - m_credential = NULL; + m_credential = nullptr; m_nativeKeyInfo = keyInfo; if (!keyInfo || !extraction) return; diff --git a/xmltooling/security/impl/ExplicitKeyTrustEngine.cpp b/xmltooling/security/impl/ExplicitKeyTrustEngine.cpp index 21af839..09ee002 100644 --- a/xmltooling/security/impl/ExplicitKeyTrustEngine.cpp +++ b/xmltooling/security/impl/ExplicitKeyTrustEngine.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -53,7 +53,7 @@ namespace xmltooling { virtual bool validate( Signature& sig, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; virtual bool validate( const XMLCh* sigAlgorithm, @@ -62,19 +62,19 @@ namespace xmltooling { const char* in, unsigned int in_len, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; virtual bool validate( XSECCryptoX509* certEE, const vector& certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; virtual bool validate( X509* certEE, STACK_OF(X509)* certChain, const CredentialResolver& credResolver, - CredentialCriteria* criteria=NULL + CredentialCriteria* criteria=nullptr ) const; }; @@ -204,7 +204,7 @@ bool ExplicitKeyTrustEngine::validate( return false; } - return validate(static_cast(certEE)->getOpenSSLX509(), NULL, credResolver, criteria); + return validate(static_cast(certEE)->getOpenSSLX509(), nullptr, credResolver, criteria); } bool ExplicitKeyTrustEngine::validate( diff --git a/xmltooling/security/impl/FilesystemCredentialResolver.cpp b/xmltooling/security/impl/FilesystemCredentialResolver.cpp index c3250e0..7009214 100644 --- a/xmltooling/security/impl/FilesystemCredentialResolver.cpp +++ b/xmltooling/security/impl/FilesystemCredentialResolver.cpp @@ -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. @@ -73,7 +73,7 @@ namespace xmltooling { } public: - bool stale(Category& log, RWLock* lock=NULL) { + bool stale(Category& log, RWLock* lock=nullptr) { if (local) { #ifdef WIN32 struct _stat stat_buf; @@ -106,7 +106,7 @@ namespace xmltooling { log.info("change detected, reloading local resource..."); } else { - time_t now = time(NULL); + time_t now = time(nullptr); // Time to reload? if (now - filestamp < reloadInterval) @@ -139,12 +139,12 @@ namespace xmltooling { class XMLTOOL_DLLLOCAL ManagedKey : public ManagedResource { public: - ManagedKey() : key(NULL) {} + ManagedKey() : key(nullptr) {} ~ManagedKey() { delete key; } void load(Category& log, const char* password) { if (source.empty()) return; - XSECCryptoKey* nkey=NULL; + XSECCryptoKey* nkey=nullptr; if (local) { nkey = SecurityHelper::loadKeyFromFile(source.c_str(), format.c_str(), password); } @@ -222,10 +222,10 @@ namespace xmltooling { m_lock->unlock(); } - const Credential* resolve(const CredentialCriteria* criteria=NULL) const; + const Credential* resolve(const CredentialCriteria* criteria=nullptr) const; virtual vector::size_type resolve( - vector& results, const CredentialCriteria* criteria=NULL + vector& results, const CredentialCriteria* criteria=nullptr ) const; private: @@ -258,7 +258,7 @@ namespace xmltooling { XSECCryptoKey* key, const vector& xseccerts, const vector& crls - ) : BasicX509Credential(key ? key : (xseccerts.empty() ? NULL : xseccerts.front()->clonePublicKey()), xseccerts, crls), m_resolver(resolver) { + ) : BasicX509Credential(key ? key : (xseccerts.empty() ? nullptr : xseccerts.front()->clonePublicKey()), xseccerts, crls), m_resolver(resolver) { if (m_resolver->m_extractNames) extract(); m_keyNames.insert(m_resolver->m_keynames.begin(), m_resolver->m_keynames.end()); @@ -312,7 +312,7 @@ namespace xmltooling { }; FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) - : m_lock(NULL), m_credential(NULL), m_usage(Credential::UNSPECIFIED_CREDENTIAL), m_extractNames(true) + : m_lock(nullptr), m_credential(nullptr), m_usage(Credential::UNSPECIFIED_CREDENTIAL), m_extractNames(true) { #ifdef _DEBUG NDC ndc("FilesystemCredentialResolver"); @@ -325,36 +325,36 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) Credential::KEYINFO_KEY_VALUE | X509Credential::KEYINFO_X509_CERTIFICATE | X509Credential::KEYINFO_X509_SUBJECTNAME; - if (e && e->hasAttributeNS(NULL,keyInfoMask)) - m_keyinfomask = XMLString::parseInt(e->getAttributeNS(NULL,keyInfoMask)); + if (e && e->hasAttributeNS(nullptr,keyInfoMask)) + m_keyinfomask = XMLString::parseInt(e->getAttributeNS(nullptr,keyInfoMask)); - if (e && (e->hasAttributeNS(NULL,_certificate) || e->hasAttributeNS(NULL,_key))) { + if (e && (e->hasAttributeNS(nullptr,_certificate) || e->hasAttributeNS(nullptr,_key))) { // Dummy up a simple file resolver config using these attributes. - DOMElement* dummy = e->getOwnerDocument()->createElementNS(NULL,_CredentialResolver); + DOMElement* dummy = e->getOwnerDocument()->createElementNS(nullptr,_CredentialResolver); DOMElement* child; DOMElement* path; - if (e->hasAttributeNS(NULL,_key)) { - child = e->getOwnerDocument()->createElementNS(NULL,Key); + if (e->hasAttributeNS(nullptr,_key)) { + child = e->getOwnerDocument()->createElementNS(nullptr,Key); dummy->appendChild(child); - path = e->getOwnerDocument()->createElementNS(NULL,Path); + path = e->getOwnerDocument()->createElementNS(nullptr,Path); child->appendChild(path); - path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(NULL,_key))); - if (e->hasAttributeNS(NULL,password)) - child->setAttributeNS(NULL,password,e->getAttributeNS(NULL,password)); - if (e->hasAttributeNS(NULL,keyName)) { - path = e->getOwnerDocument()->createElementNS(NULL,Name); + path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(nullptr,_key))); + if (e->hasAttributeNS(nullptr,password)) + child->setAttributeNS(nullptr,password,e->getAttributeNS(nullptr,password)); + if (e->hasAttributeNS(nullptr,keyName)) { + path = e->getOwnerDocument()->createElementNS(nullptr,Name); child->appendChild(path); - path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(NULL,keyName))); + path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(nullptr,keyName))); } } - if (e->hasAttributeNS(NULL,_certificate)) { - child = e->getOwnerDocument()->createElementNS(NULL,Certificate); + if (e->hasAttributeNS(nullptr,_certificate)) { + child = e->getOwnerDocument()->createElementNS(nullptr,Certificate); dummy->appendChild(child); - path = e->getOwnerDocument()->createElementNS(NULL,Path); + path = e->getOwnerDocument()->createElementNS(nullptr,Path); child->appendChild(path); - path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(NULL,_certificate))); - if (e->hasAttributeNS(NULL, extractNames)) - child->setAttributeNS(NULL, extractNames, e->getAttributeNS(NULL, extractNames)); + path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(nullptr,_certificate))); + if (e->hasAttributeNS(nullptr, extractNames)) + child->setAttributeNS(nullptr, extractNames, e->getAttributeNS(nullptr, extractNames)); } e = dummy; // reset "root" to the dummy config element } @@ -363,7 +363,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) const DOMElement* root = e; // Save off usage bits. - const XMLCh* usage = root->getAttributeNS(NULL,_use); + const XMLCh* usage = root->getAttributeNS(nullptr,_use); if (usage && *usage) { auto_ptr_char u(usage); if (!strcmp(u.get(), "signing")) @@ -377,13 +377,13 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) // Move to Key. const DOMElement* keynode = XMLHelper::getFirstChildElement(root,Key); if (keynode) { - prop = keynode->getAttributeNS(NULL,_format); + prop = keynode->getAttributeNS(nullptr,_format); if (prop && *prop) { auto_ptr_char f(prop); m_key.format = f.get(); } - prop = keynode->getAttributeNS(NULL,password); + prop = keynode->getAttributeNS(nullptr,password); if (prop && *prop) { auto_ptr_char kp(prop); m_keypass = kp.get(); @@ -395,7 +395,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) m_key.source = kpath.get(); XMLToolingConfig::getConfig().getPathResolver()->resolve(m_key.source, PathResolver::XMLTOOLING_CFG_FILE); m_key.local = true; - prop = e->getAttributeNS(NULL,_reloadChanges); + prop = e->getAttributeNS(nullptr,_reloadChanges); if (prop && (*prop==chLatin_f) || (*prop==chDigit_0)) m_key.reloadChanges = false; } @@ -404,13 +404,13 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) auto_ptr_char kpath(prop); m_key.source = kpath.get(); m_key.local = false; - prop = e->getAttributeNS(NULL,backingFilePath); + prop = e->getAttributeNS(nullptr,backingFilePath); if (!prop || !*prop) throw XMLSecurityException("FilesystemCredentialResolver can't access key, backingFilePath missing from URL element."); auto_ptr_char b(prop); m_key.backing = b.get(); XMLToolingConfig::getConfig().getPathResolver()->resolve(m_key.backing, PathResolver::XMLTOOLING_RUN_FILE); - prop = e->getAttributeNS(NULL,_reloadInterval); + prop = e->getAttributeNS(nullptr,_reloadInterval); if (prop && *prop) m_key.reloadInterval = XMLString::parseInt(prop); } @@ -433,7 +433,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) // Check for CRL. const DOMElement* crlnode = XMLHelper::getFirstChildElement(root,CRL); if (crlnode) { - const XMLCh* crlformat = crlnode->getAttributeNS(NULL,_format); + const XMLCh* crlformat = crlnode->getAttributeNS(nullptr,_format); e = XMLHelper::getFirstChildElement(crlnode,Path); while (e) { if (e->hasChildNodes()) { @@ -448,7 +448,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) crl.source = crlpath.get(); XMLToolingConfig::getConfig().getPathResolver()->resolve(crl.source, PathResolver::XMLTOOLING_CFG_FILE); crl.local = true; - prop = e->getAttributeNS(NULL,_reloadChanges); + prop = e->getAttributeNS(nullptr,_reloadChanges); if (prop && (*prop==chLatin_f) || (*prop==chDigit_0)) crl.reloadChanges = false; } @@ -468,13 +468,13 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) auto_ptr_char crlpath(prop); crl.source = crlpath.get(); crl.local = false; - prop = e->getAttributeNS(NULL,backingFilePath); + prop = e->getAttributeNS(nullptr,backingFilePath); if (!prop || !*prop) throw XMLSecurityException("FilesystemCredentialResolver can't access CRL, backingFilePath missing from URL element."); auto_ptr_char b(prop); crl.backing = b.get(); XMLToolingConfig::getConfig().getPathResolver()->resolve(crl.backing, PathResolver::XMLTOOLING_RUN_FILE); - prop = e->getAttributeNS(NULL,_reloadInterval); + prop = e->getAttributeNS(nullptr,_reloadInterval); if (prop && *prop) crl.reloadInterval = XMLString::parseInt(prop); } @@ -489,15 +489,15 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) // Check for Certificate DOMElement* certnode = XMLHelper::getFirstChildElement(root,Certificate); if (certnode) { - prop = certnode->getAttributeNS(NULL,password); + prop = certnode->getAttributeNS(nullptr,password); if (prop && *prop) { auto_ptr_char certpass(prop); m_certpass = certpass.get(); } - const XMLCh* certformat = certnode->getAttributeNS(NULL,_format); + const XMLCh* certformat = certnode->getAttributeNS(nullptr,_format); - const XMLCh* extractFlag = certnode->getAttributeNS(NULL, extractNames); + const XMLCh* extractFlag = certnode->getAttributeNS(nullptr, extractNames); if (extractFlag && (*extractFlag == chLatin_f || *extractFlag == chDigit_0)) m_extractNames = false; @@ -515,7 +515,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) cert.source = certpath.get(); XMLToolingConfig::getConfig().getPathResolver()->resolve(cert.source, PathResolver::XMLTOOLING_CFG_FILE); cert.local = true; - prop = e->getAttributeNS(NULL,_reloadChanges); + prop = e->getAttributeNS(nullptr,_reloadChanges); if (prop && (*prop==chLatin_f) || (*prop==chDigit_0)) cert.reloadChanges = false; } @@ -530,13 +530,13 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) auto_ptr_char certpath(prop); cert.source = certpath.get(); cert.local = false; - prop = e->getAttributeNS(NULL,backingFilePath); + prop = e->getAttributeNS(nullptr,backingFilePath); if (!prop || !*prop) throw XMLSecurityException("FilesystemCredentialResolver can't access certificate, backingFilePath missing from URL element."); auto_ptr_char b(prop); cert.backing = b.get(); XMLToolingConfig::getConfig().getPathResolver()->resolve(cert.backing, PathResolver::XMLTOOLING_RUN_FILE); - prop = e->getAttributeNS(NULL,_reloadInterval); + prop = e->getAttributeNS(nullptr,_reloadInterval); if (prop && *prop) cert.reloadInterval = XMLString::parseInt(prop); } @@ -550,11 +550,11 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e) // Do an initial load of all the objects. If anything blows up here, whatever's // been loaded should be freed during teardown of the embedded objects. - time_t now = time(NULL); + time_t now = time(nullptr); m_key.filestamp = now; m_key.load(log, m_keypass.c_str()); for (vector::iterator i = m_certs.begin(); i != m_certs.end(); ++i) { - i->load(log, (i==m_certs.begin()) ? m_certpass.c_str() : NULL); + i->load(log, (i==m_certs.begin()) ? m_certpass.c_str() : nullptr); i->filestamp = now; } for (vector::iterator j = m_crls.begin(); j != m_crls.end(); ++j) { @@ -585,8 +585,8 @@ Credential* FilesystemCredentialResolver::getCredential() // We (unfortunately) need to duplicate all the objects and put them in one set of arrays // in order to create the credential wrapper. - FilesystemCredential* credential=NULL; - auto_ptr xseckey(m_key.key ? m_key.key->clone() : NULL); + FilesystemCredential* credential=nullptr; + auto_ptr xseckey(m_key.key ? m_key.key->clone() : nullptr); vector xseccerts; vector xseccrls; try { @@ -657,10 +657,10 @@ Lockable* FilesystemCredentialResolver::lock() } for (vector::iterator i = m_certs.begin(); i != m_certs.end(); ++i) { - if (i->stale(log, writelock ? NULL : m_lock)) { + if (i->stale(log, writelock ? nullptr : m_lock)) { writelock = true; try { - i->load(log, (i==m_certs.begin()) ? m_certpass.c_str() : NULL); + i->load(log, (i==m_certs.begin()) ? m_certpass.c_str() : nullptr); updated = true; } catch (long& ex) { @@ -679,7 +679,7 @@ Lockable* FilesystemCredentialResolver::lock() } for (vector::iterator j = m_crls.begin(); j != m_crls.end(); ++j) { - if (j->stale(log, writelock ? NULL : m_lock)) { + if (j->stale(log, writelock ? nullptr : m_lock)) { writelock = true; try { j->load(log); @@ -720,7 +720,7 @@ Lockable* FilesystemCredentialResolver::lock() const Credential* FilesystemCredentialResolver::resolve(const CredentialCriteria* criteria) const { - return (criteria ? (criteria->matches(*m_credential) ? m_credential : NULL) : m_credential); + return (criteria ? (criteria->matches(*m_credential) ? m_credential : nullptr) : m_credential); } vector::size_type FilesystemCredentialResolver::resolve( @@ -773,11 +773,11 @@ void FilesystemCredential::attach(SSL_CTX* ctx) const else if (m_resolver->m_key.format == "PKCS12") { BIO* in=BIO_new(BIO_s_file_internal()); if (in && BIO_read_filename(in,path)>0) { - PKCS12* p12 = d2i_PKCS12_bio(in, NULL); + PKCS12* p12 = d2i_PKCS12_bio(in, nullptr); if (p12) { - EVP_PKEY* pkey=NULL; - X509* x=NULL; - PKCS12_parse(p12, const_cast(m_resolver->m_keypass.c_str()), &pkey, &x, NULL); + EVP_PKEY* pkey=nullptr; + X509* x=nullptr; + PKCS12_parse(p12, const_cast(m_resolver->m_keypass.c_str()), &pkey, &x, nullptr); PKCS12_free(p12); if (x) X509_free(x); diff --git a/xmltooling/security/impl/InlineKeyResolver.cpp b/xmltooling/security/impl/InlineKeyResolver.cpp index 589245b..f3e654d 100644 --- a/xmltooling/security/impl/InlineKeyResolver.cpp +++ b/xmltooling/security/impl/InlineKeyResolver.cpp @@ -53,24 +53,24 @@ namespace xmltooling { class XMLTOOL_DLLLOCAL InlineCredential : public BasicX509Credential { public: - InlineCredential(const KeyInfo* keyInfo=NULL) : BasicX509Credential(keyInfo!=NULL), m_credctx(new KeyInfoCredentialContext(keyInfo)) { + InlineCredential(const KeyInfo* keyInfo=nullptr) : BasicX509Credential(keyInfo!=nullptr), m_credctx(new KeyInfoCredentialContext(keyInfo)) { } InlineCredential(DSIGKeyInfoList* keyInfo) : BasicX509Credential(false), m_credctx(new KeyInfoCredentialContext(keyInfo)) { } - InlineCredential(KeyInfoCredentialContext* context) : BasicX509Credential(context->getKeyInfo()!=NULL), m_credctx(NULL) { + InlineCredential(KeyInfoCredentialContext* context) : BasicX509Credential(context->getKeyInfo()!=nullptr), m_credctx(nullptr) { } virtual ~InlineCredential() { delete m_credctx; } XSECCryptoKey* getPrivateKey() const { - return NULL; + return nullptr; } KeyInfo* getKeyInfo(bool compact=false) const { - KeyInfo* ret = m_credctx->getKeyInfo() ? m_credctx->getKeyInfo()->cloneKeyInfo() : NULL; + KeyInfo* ret = m_credctx->getKeyInfo() ? m_credctx->getKeyInfo()->cloneKeyInfo() : nullptr; if (ret) { - ret->setId(NULL); + ret->setId(nullptr); ret->getRetrievalMethods().clear(); if (compact) { ret->getKeyValues().clear(); @@ -91,7 +91,7 @@ namespace xmltooling { } if (!ret->hasChildren()) { delete ret; - ret = NULL; + ret = nullptr; } return ret; } @@ -123,7 +123,7 @@ namespace xmltooling { Credential* resolve(const KeyInfo* keyInfo, int types=0) const { if (!keyInfo) - return NULL; + return nullptr; if (types == 0) types = Credential::RESOLVE_KEYS|X509Credential::RESOLVE_CERTS|X509Credential::RESOLVE_CRLS; auto_ptr credential(new InlineCredential(keyInfo)); @@ -132,7 +132,7 @@ namespace xmltooling { } Credential* resolve(DSIGKeyInfoList* keyInfo, int types=0) const { if (!keyInfo) - return NULL; + return nullptr; if (types == 0) types = Credential::RESOLVE_KEYS|X509Credential::RESOLVE_CERTS|X509Credential::RESOLVE_CRLS; auto_ptr credential(new InlineCredential(keyInfo)); @@ -141,7 +141,7 @@ namespace xmltooling { } Credential* resolve(KeyInfoCredentialContext* context, int types=0) const { if (!context) - return NULL; + return nullptr; if (types == 0) types = Credential::RESOLVE_KEYS|X509Credential::RESOLVE_CERTS|X509Credential::RESOLVE_CRLS; auto_ptr credential(new InlineCredential(context)); @@ -420,7 +420,7 @@ void InlineCredential::resolve(DSIGKeyInfoList* keyInfo, int types) // The current xmlsec API is limited to one CRL per KeyInfo. // For now, I'm going to process the DOM directly. DOMNode* x509Node = keyInfo->item(i)->getKeyInfoDOMNode(); - DOMElement* crlElement = x509Node ? XMLHelper::getFirstChildElement(x509Node, xmlconstants::XMLSIG_NS, X509CRL::LOCAL_NAME) : NULL; + DOMElement* crlElement = x509Node ? XMLHelper::getFirstChildElement(x509Node, xmlconstants::XMLSIG_NS, X509CRL::LOCAL_NAME) : nullptr; while (crlElement) { if (crlElement->hasChildNodes()) { auto_ptr_char buf(crlElement->getFirstChild()->getNodeValue()); diff --git a/xmltooling/security/impl/KeyInfoResolver.cpp b/xmltooling/security/impl/KeyInfoResolver.cpp index 0700fb8..649e3e0 100644 --- a/xmltooling/security/impl/KeyInfoResolver.cpp +++ b/xmltooling/security/impl/KeyInfoResolver.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -53,7 +53,7 @@ Credential* KeyInfoResolver::resolve(const Signature* sig, int types) const if (keyInfo) return resolve(keyInfo, types); DSIGSignature* native = sig->getXMLSignature(); - return resolve(native ? native->getKeyInfoList() : (DSIGKeyInfoList*)NULL, types); + return resolve(native ? native->getKeyInfoList() : (DSIGKeyInfoList*)nullptr, types); } Credential* KeyInfoResolver::resolve(const CredentialCriteria& criteria, int types) const @@ -62,5 +62,5 @@ Credential* KeyInfoResolver::resolve(const CredentialCriteria& criteria, int typ if (keyInfo) return resolve(keyInfo, types); DSIGKeyInfoList* native = criteria.getNativeKeyInfo(); - return native ? resolve(native, types) : NULL; + return native ? resolve(native, types) : nullptr; } diff --git a/xmltooling/security/impl/OpenSSLCryptoX509CRL.cpp b/xmltooling/security/impl/OpenSSLCryptoX509CRL.cpp index 54dd804..bd95c60 100644 --- a/xmltooling/security/impl/OpenSSLCryptoX509CRL.cpp +++ b/xmltooling/security/impl/OpenSSLCryptoX509CRL.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009 The Apache Software Foundation. + * Copyright 2001-2010 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ XSEC_USING_XERCES(Janitor); using namespace xmltooling; -OpenSSLCryptoX509CRL::OpenSSLCryptoX509CRL() : mp_X509CRL(NULL), m_DERX509CRL("") +OpenSSLCryptoX509CRL::OpenSSLCryptoX509CRL() : mp_X509CRL(nullptr), m_DERX509CRL("") { } @@ -105,14 +105,14 @@ void OpenSSLCryptoX509CRL::loadX509CRLBase64Bin(const char* buf, unsigned int le if (bufLen > 0) { #if defined(XSEC_OPENSSL_D2IX509_CONST_BUFFER) - mp_X509CRL= d2i_X509_CRL(NULL, (const unsigned char **) (&outBuf), bufLen); + mp_X509CRL= d2i_X509_CRL(nullptr, (const unsigned char **) (&outBuf), bufLen); #else - mp_X509CRL= d2i_X509_CRL(NULL, &outBuf, bufLen); + mp_X509CRL= d2i_X509_CRL(nullptr, &outBuf, bufLen); #endif } // Check to see if we have a CRL.... - if (mp_X509CRL == NULL) { + if (mp_X509CRL == nullptr) { throw XSECCryptoException(XSECCryptoException::X509Error, "OpenSSL:X509CRL - Error translating Base64 DER encoding into OpenSSL X509 CRL structure"); } diff --git a/xmltooling/security/impl/SecurityHelper.cpp b/xmltooling/security/impl/SecurityHelper.cpp index de4c422..ddc62ac 100644 --- a/xmltooling/security/impl/SecurityHelper.cpp +++ b/xmltooling/security/impl/SecurityHelper.cpp @@ -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. @@ -56,7 +56,7 @@ static int passwd_callback(char* buf, int len, int verify, void* passwd) const char* SecurityHelper::guessEncodingFormat(const char* pathname) { - const char* format=NULL; + const char* format=nullptr; BIO* in=BIO_new(BIO_s_file_internal()); if (in && BIO_read_filename(in, pathname)>0) { const int READSIZE = 1; @@ -87,7 +87,7 @@ const char* SecurityHelper::guessEncodingFormat(const char* pathname) // Here we know it's DER-encoded, now try to parse it as a PKCS12 ASN.1 structure. // If it fails, must be another kind of DER-encoded structure. PKCS12* p12; - if ((p12=d2i_PKCS12_bio(in, NULL)) == NULL) { + if ((p12=d2i_PKCS12_bio(in, nullptr)) == nullptr) { format = "DER"; } else { @@ -112,8 +112,8 @@ XSECCryptoKey* SecurityHelper::loadKeyFromFile(const char* pathname, const char* log.info("loading private key from file (%s)", pathname); // Native objects. - PKCS12* p12=NULL; - EVP_PKEY* pkey=NULL; + PKCS12* p12=nullptr; + EVP_PKEY* pkey=nullptr; BIO* in=BIO_new(BIO_s_file_internal()); if (in && BIO_read_filename(in, pathname)>0) { @@ -146,7 +146,7 @@ XSECCryptoKey* SecurityHelper::loadKeyFromFile(const char* pathname, const char* else { // Here we know it's DER-encoded, now try to parse it as a PKCS12 ASN.1 structure. // If it fails, must be another kind of DER-encoded structure. - if ((p12=d2i_PKCS12_bio(in, NULL)) == NULL) { + if ((p12=d2i_PKCS12_bio(in, nullptr)) == nullptr) { format = "DER"; if (BIO_seek(in, mark) < 0) { log_openssl(); @@ -163,17 +163,17 @@ XSECCryptoKey* SecurityHelper::loadKeyFromFile(const char* pathname, const char* // The format should be known, so parse accordingly. if (!strcmp(format, "PEM")) { - pkey = PEM_read_bio_PrivateKey(in, NULL, passwd_callback, const_cast(password)); + pkey = PEM_read_bio_PrivateKey(in, nullptr, passwd_callback, const_cast(password)); } else if (!strcmp(format, "DER")) { - pkey=d2i_PrivateKey_bio(in, NULL); + pkey=d2i_PrivateKey_bio(in, nullptr); } else if (!strcmp(format, "PKCS12")) { if (!p12) - p12 = d2i_PKCS12_bio(in, NULL); + p12 = d2i_PKCS12_bio(in, nullptr); if (p12) { - X509* x=NULL; - PKCS12_parse(p12, const_cast(password), &pkey, &x, NULL); + X509* x=nullptr; + PKCS12_parse(p12, const_cast(password), &pkey, &x, nullptr); PKCS12_free(p12); X509_free(x); } @@ -187,7 +187,7 @@ XSECCryptoKey* SecurityHelper::loadKeyFromFile(const char* pathname, const char* // Now map it to an XSEC wrapper. if (pkey) { - XSECCryptoKey* ret=NULL; + XSECCryptoKey* ret=nullptr; switch (pkey->type) { case EVP_PKEY_RSA: ret=new OpenSSLCryptoKeyRSA(pkey); @@ -222,8 +222,8 @@ vector::size_type SecurityHelper::loadCertificatesFromFile( vector::size_type count = certs.size(); // Native objects. - X509* x=NULL; - PKCS12* p12=NULL; + X509* x=nullptr; + PKCS12* p12=nullptr; BIO* in=BIO_new(BIO_s_file_internal()); if (in && BIO_read_filename(in, pathname)>0) { @@ -256,7 +256,7 @@ vector::size_type SecurityHelper::loadCertificatesFromFile( else { // Here we know it's DER-encoded, now try to parse it as a PKCS12 ASN.1 structure. // If it fails, must be another kind of DER-encoded structure. - if ((p12=d2i_PKCS12_bio(in, NULL)) == NULL) { + if ((p12=d2i_PKCS12_bio(in, nullptr)) == nullptr) { format = "DER"; if (BIO_seek(in, mark) < 0) { log_openssl(); @@ -272,13 +272,13 @@ vector::size_type SecurityHelper::loadCertificatesFromFile( // The format should be known, so parse accordingly. if (!strcmp(format, "PEM")) { - while (x=PEM_read_bio_X509(in, NULL, NULL, NULL)) { + while (x=PEM_read_bio_X509(in, nullptr, nullptr, nullptr)) { certs.push_back(new OpenSSLCryptoX509(x)); X509_free(x); } } else if (!strcmp(format, "DER")) { - x=d2i_X509_bio(in, NULL); + x=d2i_X509_bio(in, nullptr); if (x) { certs.push_back(new OpenSSLCryptoX509(x)); X509_free(x); @@ -286,9 +286,9 @@ vector::size_type SecurityHelper::loadCertificatesFromFile( } else if (!strcmp(format, "PKCS12")) { if (!p12) - p12 = d2i_PKCS12_bio(in, NULL); + p12 = d2i_PKCS12_bio(in, nullptr); if (p12) { - EVP_PKEY* pkey=NULL; + EVP_PKEY* pkey=nullptr; STACK_OF(X509)* CAstack = sk_X509_new_null(); PKCS12_parse(p12, const_cast(password), &pkey, &x, &CAstack); PKCS12_free(p12); @@ -364,15 +364,15 @@ vector::size_type SecurityHelper::loadCRLsFromFile( log.debug("CRL encoding format for (%s) dynamically resolved as (%s)", pathname, format); } - X509_CRL* crl=NULL; + X509_CRL* crl=nullptr; if (!strcmp(format, "PEM")) { - while (crl=PEM_read_bio_X509_CRL(in, NULL, NULL, NULL)) { + while (crl=PEM_read_bio_X509_CRL(in, nullptr, nullptr, nullptr)) { crls.push_back(new OpenSSLCryptoX509CRL(crl)); X509_CRL_free(crl); } } else if (!strcmp(format, "DER")) { - crl=d2i_X509_CRL_bio(in, NULL); + crl=d2i_X509_CRL_bio(in, nullptr); if (crl) { crls.push_back(new OpenSSLCryptoX509CRL(crl)); X509_CRL_free(crl); @@ -554,7 +554,7 @@ string SecurityHelper::getDEREncoding(const XSECCryptoKey& key, const char* hash Category::getInstance(XMLTOOLING_LOGCAT".SecurityHelper").warn("key was not populated"); return ret; } - const EVP_MD* md=NULL; + const EVP_MD* md=nullptr; if (hash) { md = EVP_get_digestbyname(hash); if (!md) { @@ -588,7 +588,7 @@ string SecurityHelper::getDEREncoding(const XSECCryptoKey& key, const char* hash BIO_write(chain, digest, len); BIO_flush(chain); } - BUF_MEM* bptr=NULL; + BUF_MEM* bptr=nullptr; BIO_get_mem_ptr(chain, &bptr); if (bptr && bptr->length > 0) ret.append(bptr->data, bptr->length); @@ -600,7 +600,7 @@ string SecurityHelper::getDEREncoding(const XSECCryptoKey& key, const char* hash Category::getInstance(XMLTOOLING_LOGCAT".SecurityHelper").warn("key was not populated"); return ret; } - const EVP_MD* md=NULL; + const EVP_MD* md=nullptr; if (hash) { md = EVP_get_digestbyname(hash); if (!md) { @@ -634,7 +634,7 @@ string SecurityHelper::getDEREncoding(const XSECCryptoKey& key, const char* hash BIO_write(chain, digest, len); BIO_flush(chain); } - BUF_MEM* bptr=NULL; + BUF_MEM* bptr=nullptr; BIO_get_mem_ptr(chain, &bptr); if (bptr && bptr->length > 0) ret.append(bptr->data, bptr->length); @@ -655,7 +655,7 @@ string SecurityHelper::getDEREncoding(const XSECCryptoX509& cert, const char* ha return ret; } - const EVP_MD* md=NULL; + const EVP_MD* md=nullptr; if (hash) { md = EVP_get_digestbyname(hash); if (!md) { @@ -694,7 +694,7 @@ string SecurityHelper::getDEREncoding(const XSECCryptoX509& cert, const char* ha BIO_write(chain, digest, len); BIO_flush(chain); } - BUF_MEM* bptr=NULL; + BUF_MEM* bptr=nullptr; BIO_get_mem_ptr(chain, &bptr); if (bptr && bptr->length > 0) ret.append(bptr->data, bptr->length); @@ -714,15 +714,15 @@ string SecurityHelper::getDEREncoding(const Credential& cred, const char* hash, string SecurityHelper::getDEREncoding(const XSECCryptoKey& key, bool hash, bool nowrap) { - return getDEREncoding(key, hash ? "SHA1" : NULL, nowrap); + return getDEREncoding(key, hash ? "SHA1" : nullptr, nowrap); } string SecurityHelper::getDEREncoding(const XSECCryptoX509& cert, bool hash, bool nowrap) { - return getDEREncoding(cert, hash ? "SHA1" : NULL, nowrap); + return getDEREncoding(cert, hash ? "SHA1" : nullptr, nowrap); } string SecurityHelper::getDEREncoding(const Credential& cred, bool hash, bool nowrap) { - return getDEREncoding(cred, hash ? "SHA1" : NULL, nowrap); + return getDEREncoding(cred, hash ? "SHA1" : nullptr, nowrap); } diff --git a/xmltooling/security/impl/StaticPKIXTrustEngine.cpp b/xmltooling/security/impl/StaticPKIXTrustEngine.cpp index f2432bd..8a94206 100644 --- a/xmltooling/security/impl/StaticPKIXTrustEngine.cpp +++ b/xmltooling/security/impl/StaticPKIXTrustEngine.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -17,7 +17,7 @@ /** * PKIXTrustEngine.cpp * - * Shibboleth-specific PKIX-validation TrustEngine + * Shibboleth-specific PKIX-validation TrustEngine. */ #include "internal.h" @@ -48,14 +48,14 @@ namespace xmltooling { class XMLTOOL_DLLLOCAL StaticPKIXTrustEngine : public AbstractPKIXTrustEngine { public: - StaticPKIXTrustEngine(const DOMElement* e=NULL); + StaticPKIXTrustEngine(const DOMElement* e=nullptr); virtual ~StaticPKIXTrustEngine() { delete m_credResolver; } AbstractPKIXTrustEngine::PKIXValidationInfoIterator* getPKIXValidationInfoIterator( - const CredentialResolver& pkixSource, CredentialCriteria* criteria=NULL + const CredentialResolver& pkixSource, CredentialCriteria* criteria=nullptr ) const; const KeyInfoResolver* getKeyInfoResolver() const { @@ -126,19 +126,19 @@ namespace xmltooling { }; }; -StaticPKIXTrustEngine::StaticPKIXTrustEngine(const DOMElement* e) : AbstractPKIXTrustEngine(e), m_depth(1), m_credResolver(NULL) +StaticPKIXTrustEngine::StaticPKIXTrustEngine(const DOMElement* e) : AbstractPKIXTrustEngine(e), m_depth(1), m_credResolver(nullptr) { - const XMLCh* depth = e ? e->getAttributeNS(NULL, verifyDepth) : NULL; + const XMLCh* depth = e ? e->getAttributeNS(nullptr, verifyDepth) : nullptr; if (depth && *depth) m_depth = XMLString::parseInt(depth); - if (e && e->hasAttributeNS(NULL,certificate)) { + if (e && e->hasAttributeNS(nullptr,certificate)) { // Simple File resolver config rooted here. m_credResolver = XMLToolingConfig::getConfig().CredentialResolverManager.newPlugin(FILESYSTEM_CREDENTIAL_RESOLVER,e); } else { - e = e ? XMLHelper::getFirstChildElement(e, _CredentialResolver) : NULL; - auto_ptr_char t(e ? e->getAttributeNS(NULL,type) : NULL); + e = e ? XMLHelper::getFirstChildElement(e, _CredentialResolver) : nullptr; + auto_ptr_char t(e ? e->getAttributeNS(nullptr,type) : nullptr); if (t.get()) { m_credResolver = XMLToolingConfig::getConfig().CredentialResolverManager.newPlugin(t.get(),e); } diff --git a/xmltooling/security/impl/TrustEngine.cpp b/xmltooling/security/impl/TrustEngine.cpp index d00a611..7dc9ed4 100644 --- a/xmltooling/security/impl/TrustEngine.cpp +++ b/xmltooling/security/impl/TrustEngine.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -17,7 +17,7 @@ /** * TrustEngine.cpp * - * Registration of factories for built-in engines + * Registration of factories for built-in engines. */ #include "internal.h" @@ -50,11 +50,11 @@ void XMLTOOL_API xmltooling::registerTrustEngines() static const XMLCh _KeyInfoResolver[] = UNICODE_LITERAL_15(K,e,y,I,n,f,o,R,e,s,o,l,v,e,r); static const XMLCh type[] = UNICODE_LITERAL_4(t,y,p,e); -TrustEngine::TrustEngine(const DOMElement* e) : m_keyInfoResolver(NULL) +TrustEngine::TrustEngine(const DOMElement* e) : m_keyInfoResolver(nullptr) { - DOMElement* child = e ? XMLHelper::getFirstChildElement(e,_KeyInfoResolver) : NULL; + DOMElement* child = e ? XMLHelper::getFirstChildElement(e,_KeyInfoResolver) : nullptr; if (child) { - auto_ptr_char t(child->getAttributeNS(NULL,type)); + auto_ptr_char t(child->getAttributeNS(nullptr,type)); if (t.get()) m_keyInfoResolver = XMLToolingConfig::getConfig().KeyInfoResolverManager.newPlugin(t.get(),child); else diff --git a/xmltooling/security/impl/XSECCryptoX509CRL.cpp b/xmltooling/security/impl/XSECCryptoX509CRL.cpp index 8111609..7506a8b 100644 --- a/xmltooling/security/impl/XSECCryptoX509CRL.cpp +++ b/xmltooling/security/impl/XSECCryptoX509CRL.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009 The Apache Software Foundation. + * Copyright 2001-2010 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ XSECCryptoX509CRL::~XSECCryptoX509CRL() void XSECCryptoX509CRL::loadX509CRLPEM(const char* buf, unsigned int len) { const char * b; - char * b1 = NULL; + char * b1 = nullptr; if (len == 0) b = buf; else { @@ -51,9 +51,9 @@ void XSECCryptoX509CRL::loadX509CRLPEM(const char* buf, unsigned int len) const char *p = strstr(buf, "-----BEGIN X509 CRL-----"); - if (p == NULL) { + if (p == nullptr) { - if (b1 != NULL) + if (b1 != nullptr) delete[] b1; throw XSECCryptoException(XSECCryptoException::X509Error, @@ -75,7 +75,7 @@ void XSECCryptoX509CRL::loadX509CRLPEM(const char* buf, unsigned int len) if (strstr(p, "-----END X509 CRL-----") != p) { - if (b1 != NULL) + if (b1 != nullptr) delete[] b1; throw XSECCryptoException(XSECCryptoException::X509Error, @@ -83,7 +83,7 @@ void XSECCryptoX509CRL::loadX509CRLPEM(const char* buf, unsigned int len) } - if (b1 != NULL) + if (b1 != nullptr) delete[] b1; output[i] = '\0'; diff --git a/xmltooling/signature/Signature.h b/xmltooling/signature/Signature.h index cfadb9c..eddf54b 100644 --- a/xmltooling/signature/Signature.h +++ b/xmltooling/signature/Signature.h @@ -61,7 +61,7 @@ namespace xmlsignature { /** * Gets the signing algorithm for the signature. * - * @return the signature algorithm, or NULL if indeterminate + * @return the signature algorithm, or nullptr if indeterminate */ virtual const XMLCh* getSignatureAlgorithm() const=0; @@ -89,7 +89,7 @@ namespace xmlsignature { /** * Sets a KeyInfo object to embed in the Signature. * - * @param keyInfo pointer to a KeyInfo object, or NULL + * @param keyInfo pointer to a KeyInfo object, or nullptr */ virtual void setKeyInfo(KeyInfo* keyInfo)=0; @@ -101,7 +101,7 @@ namespace xmlsignature { * for validation purposes is provided through the native * DSIGSignature object. * - * @return pointer to a KeyInfo object, or NULL + * @return pointer to a KeyInfo object, or nullptr */ virtual KeyInfo* getKeyInfo() const=0; @@ -109,7 +109,7 @@ namespace xmlsignature { * Sets the ContentReference object to the Signature to be applied * when the signature is created. * - * @param reference the reference to attach, or NULL + * @param reference the reference to attach, or nullptr */ virtual void setContentReference(ContentReference* reference)=0; @@ -121,7 +121,7 @@ namespace xmlsignature { * for validation purposes is provided through the native * DSIGSignature object. * - * @return pointer to a ContentReference object, or NULL + * @return pointer to a ContentReference object, or nullptr */ virtual ContentReference* getContentReference() const=0; @@ -139,7 +139,7 @@ namespace xmlsignature { * * @param credential optional source of signing key and KeyInfo */ - virtual void sign(const xmltooling::Credential* credential=NULL)=0; + virtual void sign(const xmltooling::Credential* credential=nullptr)=0; /** * Type-safe clone operation. @@ -209,7 +209,7 @@ namespace xmlsignature { #else virtual xmltooling::XMLObject* buildObject( #endif - const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const xmltooling::QName* schemaType=nullptr ) const; /** diff --git a/xmltooling/signature/SignatureValidator.h b/xmltooling/signature/SignatureValidator.h index f4f23e6..b275c28 100644 --- a/xmltooling/signature/SignatureValidator.h +++ b/xmltooling/signature/SignatureValidator.h @@ -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. @@ -46,7 +46,7 @@ namespace xmlsignature { * * @param key the key to use */ - SignatureValidator(XSECCryptoKey* key=NULL); + SignatureValidator(XSECCryptoKey* key=nullptr); /** * Constructor using a Credential diff --git a/xmltooling/signature/impl/KeyInfoImpl.cpp b/xmltooling/signature/impl/KeyInfoImpl.cpp index d580130..36c0280 100644 --- a/xmltooling/signature/impl/KeyInfoImpl.cpp +++ b/xmltooling/signature/impl/KeyInfoImpl.cpp @@ -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. @@ -78,20 +78,20 @@ namespace xmlsignature { } void init() { - m_P=NULL; - m_Q=NULL; - m_G=NULL; - m_Y=NULL; - m_J=NULL; - m_Seed=NULL; - m_PgenCounter=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); + m_P=nullptr; + m_Q=nullptr; + m_G=nullptr; + m_Y=nullptr; + m_J=nullptr; + m_Seed=nullptr; + m_PgenCounter=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_P=m_children.begin(); m_pos_Q=m_pos_P; ++m_pos_Q; @@ -153,10 +153,10 @@ namespace xmlsignature { } void init() { - m_Modulus=NULL; - m_Exponent=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); + m_Modulus=nullptr; + m_Exponent=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_Modulus=m_children.begin(); m_pos_Exponent=m_pos_Modulus; ++m_pos_Exponent; @@ -200,12 +200,12 @@ namespace xmlsignature { } void init() { - m_DSAKeyValue=NULL; - m_RSAKeyValue=NULL; - m_UnknownXMLObject=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); + m_DSAKeyValue=nullptr; + m_RSAKeyValue=nullptr; + m_UnknownXMLObject=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_DSAKeyValue=m_children.begin(); m_pos_RSAKeyValue=m_pos_DSAKeyValue; ++m_pos_RSAKeyValue; @@ -246,7 +246,7 @@ namespace xmlsignature { } TransformImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) - : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Algorithm(NULL) { + : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Algorithm(nullptr) { } TransformImpl(const TransformImpl& src) @@ -271,7 +271,7 @@ namespace xmlsignature { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Algorithm,ALGORITHM,NULL); + MARSHALL_STRING_ATTRIB(Algorithm,ALGORITHM,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -288,7 +288,7 @@ namespace xmlsignature { } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(Algorithm,ALGORITHM,NULL); + PROC_STRING_ATTRIB(Algorithm,ALGORITHM,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -353,9 +353,9 @@ namespace xmlsignature { } void init() { - m_URI=m_Type=NULL; - m_Transforms=NULL; - m_children.push_back(NULL); + m_URI=m_Type=nullptr; + m_Transforms=nullptr; + m_children.push_back(nullptr); m_pos_Transforms=m_children.begin(); } @@ -366,8 +366,8 @@ namespace xmlsignature { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(URI,URI,NULL); - MARSHALL_STRING_ATTRIB(Type,TYPE,NULL); + MARSHALL_STRING_ATTRIB(URI,URI,nullptr); + MARSHALL_STRING_ATTRIB(Type,TYPE,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -376,8 +376,8 @@ namespace xmlsignature { } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(URI,URI,NULL); - PROC_STRING_ATTRIB(Type,TYPE,NULL); + PROC_STRING_ATTRIB(URI,URI,nullptr); + PROC_STRING_ATTRIB(Type,TYPE,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -406,10 +406,10 @@ namespace xmlsignature { } void init() { - m_X509IssuerName=NULL; - m_X509SerialNumber=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); + m_X509IssuerName=nullptr; + m_X509SerialNumber=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_X509IssuerName=m_children.begin(); m_pos_X509SerialNumber=m_pos_X509IssuerName; ++m_pos_X509SerialNumber; @@ -524,7 +524,7 @@ namespace xmlsignature { VectorOfPairs(SPKISexp,XMLObject) v=getSPKISexps(); for (vector< pair >::const_iterator i=src.m_SPKISexps.begin(); i!=src.m_SPKISexps.end(); i++) { if (i->first) { - v.push_back(make_pair(i->first->cloneSPKISexp(),(i->second ? i->second->clone() : (XMLObject*)NULL))); + v.push_back(make_pair(i->first->cloneSPKISexp(),(i->second ? i->second->clone() : (XMLObject*)nullptr))); } } } @@ -548,7 +548,7 @@ namespace xmlsignature { if (XMLHelper::isNodeNamed(root,XMLSIG_NS,SPKISexp::LOCAL_NAME)) { SPKISexp* typesafe=dynamic_cast(childXMLObject); if (typesafe) { - getSPKISexps().push_back(make_pair(typesafe,(XMLObject*)NULL)); + getSPKISexps().push_back(make_pair(typesafe,(XMLObject*)nullptr)); return; } } @@ -557,7 +557,7 @@ namespace xmlsignature { const XMLCh* nsURI=root->getNamespaceURI(); if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) { // Update second half of pair in vector, and in master list. - if (!m_SPKISexps.empty() && m_SPKISexps.back().second==NULL) { + if (!m_SPKISexps.empty() && m_SPKISexps.back().second==nullptr) { m_SPKISexps.back().second=childXMLObject; m_children.back()=childXMLObject; return; @@ -597,10 +597,10 @@ namespace xmlsignature { } void init() { - m_PGPKeyID=NULL; - m_PGPKeyPacket=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); + m_PGPKeyID=nullptr; + m_PGPKeyPacket=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_PGPKeyID=m_children.begin(); m_pos_PGPKeyPacket=m_pos_PGPKeyID; ++m_pos_PGPKeyPacket; @@ -639,7 +639,7 @@ namespace xmlsignature { } KeyInfoImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) - : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Id(NULL) { + : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Id(nullptr) { } KeyInfoImpl(const KeyInfoImpl& src) @@ -696,7 +696,7 @@ namespace xmlsignature { } IMPL_XMLOBJECT_CLONE(KeyInfo); - IMPL_ID_ATTRIB_EX(Id,ID,NULL); + IMPL_ID_ATTRIB_EX(Id,ID,nullptr); IMPL_TYPED_CHILDREN(KeyName,m_children.end()); IMPL_TYPED_CHILDREN(KeyValue,m_children.end()); IMPL_TYPED_CHILDREN(RetrievalMethod,m_children.end()); @@ -708,7 +708,7 @@ namespace xmlsignature { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_ID_ATTRIB(Id,ID,NULL); + MARSHALL_ID_ATTRIB(Id,ID,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -731,7 +731,7 @@ namespace xmlsignature { } void processAttribute(const DOMAttr* attribute) { - PROC_ID_ATTRIB(Id,ID,NULL); + PROC_ID_ATTRIB(Id,ID,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; diff --git a/xmltooling/signature/impl/SignatureValidator.cpp b/xmltooling/signature/impl/SignatureValidator.cpp index 3fbd883..3dcddb1 100644 --- a/xmltooling/signature/impl/SignatureValidator.cpp +++ b/xmltooling/signature/impl/SignatureValidator.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -32,11 +32,11 @@ using namespace xmlsignature; using namespace xmltooling; using namespace std; -SignatureValidator::SignatureValidator(XSECCryptoKey* key) : m_key(key), m_credential(NULL) +SignatureValidator::SignatureValidator(XSECCryptoKey* key) : m_key(key), m_credential(nullptr) { } -SignatureValidator::SignatureValidator(const Credential* credential) : m_key(NULL), m_credential(credential) +SignatureValidator::SignatureValidator(const Credential* credential) : m_key(nullptr), m_credential(credential) { } @@ -47,12 +47,12 @@ SignatureValidator::~SignatureValidator() void SignatureValidator::setKey(XSECCryptoKey* key) { m_key = key; - m_credential = NULL; + m_credential = nullptr; } void SignatureValidator::setCredential(const Credential* credential) { - m_key = NULL; + m_key = nullptr; m_credential = credential; } @@ -72,7 +72,7 @@ void SignatureValidator::validate(const Signature* sigObj) const else if (!m_key && !m_credential) throw ValidationException("No Credential or key set on Validator."); - XSECCryptoKey* key = m_key ? m_key : (m_credential ? m_credential->getPublicKey() : NULL); + XSECCryptoKey* key = m_key ? m_key : (m_credential ? m_credential->getPublicKey() : nullptr); if (!key) throw ValidationException("Credential did not contain a verification key."); diff --git a/xmltooling/signature/impl/XMLSecSignatureImpl.cpp b/xmltooling/signature/impl/XMLSecSignatureImpl.cpp index 6880452..4eaa15d 100644 --- a/xmltooling/signature/impl/XMLSecSignatureImpl.cpp +++ b/xmltooling/signature/impl/XMLSecSignatureImpl.cpp @@ -17,7 +17,7 @@ /** * XMLSecSignatureImpl.cpp * - * Signature class for XMLSec-based signature-handling + * Signature class for XMLSec-based signature-handling. */ #include "internal.h" @@ -65,7 +65,7 @@ namespace xmlsignature { public: XMLSecSignatureImpl() : AbstractXMLObject(XMLSIG_NS, Signature::LOCAL_NAME, XMLSIG_PREFIX), UnknownElementImpl(XMLSIG_NS, Signature::LOCAL_NAME, XMLSIG_PREFIX), - m_signature(NULL), m_c14n(NULL), m_sm(NULL), m_key(NULL), m_keyInfo(NULL), m_reference(NULL) {} + m_signature(nullptr), m_c14n(nullptr), m_sm(nullptr), m_key(nullptr), m_keyInfo(nullptr), m_reference(nullptr) {} virtual ~XMLSecSignatureImpl(); void releaseDOM() const; @@ -79,8 +79,8 @@ namespace xmlsignature { XMLObject* clone() const; Signature* cloneSignature() const; - DOMElement* marshall(DOMDocument* document=NULL, const vector* sigs=NULL, const Credential* credential=NULL) const; - DOMElement* marshall(DOMElement* parentElement, const vector* sigs=NULL, const Credential* credential=NULL) const; + DOMElement* marshall(DOMDocument* document=nullptr, const vector* sigs=nullptr, const Credential* credential=nullptr) const; + DOMElement* marshall(DOMElement* parentElement, const vector* sigs=nullptr, const Credential* credential=nullptr) const; XMLObject* unmarshall(DOMElement* element, bool bindDocument=false); // Getters @@ -122,7 +122,7 @@ namespace xmlsignature { m_reference=reference; } - void sign(const Credential* credential=NULL); + void sign(const Credential* credential=nullptr); private: mutable DSIGSignature* m_signature; @@ -176,7 +176,7 @@ void XMLSecSignatureImpl::releaseDOM() const // Release the associated signature. if (m_signature) { XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseSignature(m_signature); - m_signature=NULL; + m_signature=nullptr; } } } @@ -274,7 +274,7 @@ DOMElement* XMLSecSignatureImpl::marshall(DOMDocument* document, const vectorcreateDocument(); + document=DOMImplementationRegistry::getDOMImplementation(nullptr)->createDocument(); bindDocument=true; } DSIGSignature* temp=XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->newSignature(); @@ -337,7 +337,7 @@ DOMElement* XMLSecSignatureImpl::marshall(DOMDocument* document, const vectorgetKeyInfo(); } if (m_keyInfo && (!m_signature->getKeyInfoList() || m_signature->getKeyInfoList()->isEmpty())) { @@ -432,7 +432,7 @@ DOMElement* XMLSecSignatureImpl::marshall(DOMElement* parentElement, const vecto // Marshall KeyInfo data. if (credential) { delete m_keyInfo; - m_keyInfo = NULL; + m_keyInfo = nullptr; m_keyInfo = credential->getKeyInfo(); } if (m_keyInfo && (!m_signature->getKeyInfoList() || m_signature->getKeyInfoList()->isEmpty())) { @@ -526,7 +526,7 @@ unsigned int Signature::createRawSignature( // Move input into a safeBuffer to source the transform chain. safeBuffer sb,sbout; sb.sbStrncpyIn(in,in_len); - TXFMSB* sbt = new TXFMSB(NULL); + TXFMSB* sbt = new TXFMSB(nullptr); sbt->setInput(sb, in_len); TXFMChain tx(sbt); @@ -572,7 +572,7 @@ bool Signature::verifyRawSignature( // Move input into a safeBuffer to source the transform chain. safeBuffer sb; sb.sbStrncpyIn(in,in_len); - TXFMSB* sbt = new TXFMSB(NULL); + TXFMSB* sbt = new TXFMSB(nullptr); sbt->setInput(sb, in_len); TXFMChain tx(sbt); diff --git a/xmltooling/soap/OpenSSLSOAPTransport.h b/xmltooling/soap/OpenSSLSOAPTransport.h index 21a2045..eecb289 100644 --- a/xmltooling/soap/OpenSSLSOAPTransport.h +++ b/xmltooling/soap/OpenSSLSOAPTransport.h @@ -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. @@ -49,7 +49,7 @@ namespace xmltooling { * @param userptr a caller-supplied value to pass to the callback function * @return true iff the callback was set */ - virtual bool setSSLCallback(ssl_ctx_callback_fn fn, void* userptr=NULL)=0; + virtual bool setSSLCallback(ssl_ctx_callback_fn fn, void* userptr=nullptr)=0; /** * Sets indicator that the transport peer has been authenticated. diff --git a/xmltooling/soap/SOAP.h b/xmltooling/soap/SOAP.h index 429f54f..01b7fe9 100644 --- a/xmltooling/soap/SOAP.h +++ b/xmltooling/soap/SOAP.h @@ -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. @@ -100,10 +100,10 @@ namespace soap11 { DECL_SOAP11OBJECTBUILDER(Envelope); DECL_SOAP11OBJECTBUILDER(Fault); DECL_SOAP11OBJECTBUILDER(Header); - DECL_XMLOBJECTBUILDER(XMLTOOL_API,Detail,NULL,NULL); - DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultactor,NULL,NULL); - DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultcode,NULL,NULL); - DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultstring,NULL,NULL); + DECL_XMLOBJECTBUILDER(XMLTOOL_API,Detail,nullptr,nullptr); + DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultactor,nullptr,nullptr); + DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultcode,nullptr,nullptr); + DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultstring,nullptr,nullptr); /** * Registers builders and validators for SOAP 1.1 classes into the runtime. diff --git a/xmltooling/soap/SOAPClient.h b/xmltooling/soap/SOAPClient.h index 3752adf..27f2622 100644 --- a/xmltooling/soap/SOAPClient.h +++ b/xmltooling/soap/SOAPClient.h @@ -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. @@ -76,7 +76,7 @@ namespace soap11 { /** * Returns the response message, if any. As long as a response is - * "expected" but not available, NULL will be returned. If no response + * "expected" but not available, nullptr will be returned. If no response * will be forthcoming, an exception is raised. * *

The caller is responsible for freeing the returned envelope. diff --git a/xmltooling/soap/SOAPTransport.h b/xmltooling/soap/SOAPTransport.h index cf5cb41..dcfcf4a 100644 --- a/xmltooling/soap/SOAPTransport.h +++ b/xmltooling/soap/SOAPTransport.h @@ -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. @@ -115,7 +115,7 @@ namespace xmltooling { * @param password simple password/credential for transport authentication * @return true iff the transport supports the indicated form of authentication */ - virtual bool setAuth(transport_auth_t authType, const char* username=NULL, const char* password=NULL)=0; + virtual bool setAuth(transport_auth_t authType, const char* username=nullptr, const char* password=nullptr)=0; /** * Determines whether TLS/SSL connections include a check of the server's certificate @@ -133,26 +133,26 @@ namespace xmltooling { * *

The lifetime of the credential must be longer than the lifetime of this object. * - * @param credential a Credential instance, or NULL + * @param credential a Credential instance, or nullptr * @return true iff the transport supports the use of the Credential */ - virtual bool setCredential(const Credential* credential=NULL)=0; + virtual bool setCredential(const Credential* credential=nullptr)=0; /** * Provides an X509TrustEngine to the transport to authenticate the transport peer. * The lifetime of the engine must be longer than the lifetime of this object. * - * @param trustEngine an X509TrustEngine instance, or NULL - * @param credResolver a CredentialResolver to supply the peer's trusted credentials, or NULL + * @param trustEngine an X509TrustEngine instance, or nullptr + * @param credResolver a CredentialResolver to supply the peer's trusted credentials, or nullptr * @param criteria optional criteria for selecting peer credentials * @param mandatory flag controls whether message is sent at all if the * transport isn't authenticated using the TrustEngine * @return true iff the transport supports the use of a TrustEngine */ virtual bool setTrustEngine( - const X509TrustEngine* trustEngine=NULL, - const CredentialResolver* credResolver=NULL, - CredentialCriteria* criteria=NULL, + const X509TrustEngine* trustEngine=nullptr, + const CredentialResolver* credResolver=nullptr, + CredentialCriteria* criteria=nullptr, bool mandatory=true )=0; #endif @@ -164,7 +164,7 @@ namespace xmltooling { * * @param cacheTag optional pointer to string used for cache management */ - virtual bool setCacheTag(std::string* cacheTag=NULL); + virtual bool setCacheTag(std::string* cacheTag=nullptr); /** * Sets an implementation-specific transport provider option. @@ -199,7 +199,7 @@ namespace xmltooling { * * @param in input stream to send */ - virtual void send(std::istream* in=NULL); + virtual void send(std::istream* in=nullptr); /** * Returns reference to response stream. The resulting stream must be diff --git a/xmltooling/soap/impl/CURLSOAPTransport.cpp b/xmltooling/soap/impl/CURLSOAPTransport.cpp index 60e3e25..5dd48a3 100644 --- a/xmltooling/soap/impl/CURLSOAPTransport.cpp +++ b/xmltooling/soap/impl/CURLSOAPTransport.cpp @@ -17,7 +17,7 @@ /** * CURLSOAPTransport.cpp * - * libcurl-based SOAPTransport implementation + * libcurl-based SOAPTransport implementation. */ #include "internal.h" @@ -61,25 +61,25 @@ namespace xmltooling { Category& m_log; }; - static XMLTOOL_DLLLOCAL CURLPool* g_CURLPool = NULL; + static XMLTOOL_DLLLOCAL CURLPool* g_CURLPool = nullptr; class XMLTOOL_DLLLOCAL CURLSOAPTransport : public HTTPSOAPTransport, public OpenSSLSOAPTransport { public: CURLSOAPTransport(const Address& addr) : m_sender(addr.m_from ? addr.m_from : ""), m_peerName(addr.m_to ? addr.m_to : ""), m_endpoint(addr.m_endpoint), - m_handle(NULL), m_headers(NULL), + m_handle(nullptr), m_headers(nullptr), #ifndef XMLTOOLING_NO_XMLSEC - m_cred(NULL), m_trustEngine(NULL), m_peerResolver(NULL), m_mandatory(false), + m_cred(nullptr), m_trustEngine(nullptr), m_peerResolver(nullptr), m_mandatory(false), #endif - m_openssl_ops(SSL_OP_ALL|SSL_OP_NO_SSLv2), m_ssl_callback(NULL), m_ssl_userptr(NULL), - m_chunked(true), m_authenticated(false), m_cacheTag(NULL) { + m_openssl_ops(SSL_OP_ALL|SSL_OP_NO_SSLv2), m_ssl_callback(nullptr), m_ssl_userptr(nullptr), + m_chunked(true), m_authenticated(false), m_cacheTag(nullptr) { m_handle = g_CURLPool->get(addr); curl_easy_setopt(m_handle,CURLOPT_URL,addr.m_endpoint); curl_easy_setopt(m_handle,CURLOPT_CONNECTTIMEOUT,15); curl_easy_setopt(m_handle,CURLOPT_TIMEOUT,30); curl_easy_setopt(m_handle,CURLOPT_HTTPAUTH,0); - curl_easy_setopt(m_handle,CURLOPT_USERPWD,NULL); + curl_easy_setopt(m_handle,CURLOPT_USERPWD,nullptr); curl_easy_setopt(m_handle,CURLOPT_SSL_VERIFYHOST,2); curl_easy_setopt(m_handle,CURLOPT_HEADERDATA,this); m_headers=curl_slist_append(m_headers,"Content-Type: text/xml"); @@ -87,8 +87,8 @@ namespace xmltooling { virtual ~CURLSOAPTransport() { curl_slist_free_all(m_headers); - curl_easy_setopt(m_handle,CURLOPT_ERRORBUFFER,NULL); - curl_easy_setopt(m_handle,CURLOPT_PRIVATE,m_authenticated ? "secure" : NULL); // Save off security "state". + curl_easy_setopt(m_handle,CURLOPT_ERRORBUFFER,nullptr); + curl_easy_setopt(m_handle,CURLOPT_PRIVATE,m_authenticated ? "secure" : nullptr); // Save off security "state". g_CURLPool->put(m_sender.c_str(), m_peerName.c_str(), m_endpoint.c_str(), m_handle); } @@ -104,35 +104,35 @@ namespace xmltooling { return (curl_easy_setopt(m_handle,CURLOPT_TIMEOUT,timeout)==CURLE_OK); } - bool setAuth(transport_auth_t authType, const char* username=NULL, const char* password=NULL); + bool setAuth(transport_auth_t authType, const char* username=nullptr, const char* password=nullptr); bool setVerifyHost(bool verify) { return (curl_easy_setopt(m_handle,CURLOPT_SSL_VERIFYHOST,verify ? 2 : 0)==CURLE_OK); } #ifndef XMLTOOLING_NO_XMLSEC - bool setCredential(const Credential* cred=NULL) { + bool setCredential(const Credential* cred=nullptr) { const OpenSSLCredential* down = dynamic_cast(cred); if (!down) { - m_cred = NULL; - return (cred==NULL); + m_cred = nullptr; + return (cred==nullptr); } m_cred = down; return true; } bool setTrustEngine( - const X509TrustEngine* trustEngine=NULL, - const CredentialResolver* peerResolver=NULL, - CredentialCriteria* criteria=NULL, + const X509TrustEngine* trustEngine=nullptr, + const CredentialResolver* peerResolver=nullptr, + CredentialCriteria* criteria=nullptr, bool mandatory=true ) { const OpenSSLTrustEngine* down = dynamic_cast(trustEngine); if (!down) { - m_trustEngine = NULL; - m_peerResolver = NULL; - m_criteria = NULL; - return (trustEngine==NULL); + m_trustEngine = nullptr; + m_peerResolver = nullptr; + m_criteria = nullptr; + return (trustEngine==nullptr); } m_trustEngine = down; m_peerResolver = peerResolver; @@ -159,7 +159,7 @@ namespace xmltooling { send(&in); } - void send(istream* in=NULL); + void send(istream* in=nullptr); istream& receive() { return m_stream; @@ -185,7 +185,7 @@ namespace xmltooling { const vector& getResponseHeader(const char* val) const; - bool setSSLCallback(ssl_ctx_callback_fn fn, void* userptr=NULL) { + bool setSSLCallback(ssl_ctx_callback_fn fn, void* userptr=nullptr) { m_ssl_callback=fn; m_ssl_userptr=userptr; return true; @@ -249,7 +249,7 @@ void xmltooling::initSOAPTransports() void xmltooling::termSOAPTransports() { delete g_CURLPool; - g_CURLPool = NULL; + g_CURLPool = nullptr; } OpenSSLSOAPTransport::OpenSSLSOAPTransport() @@ -305,14 +305,14 @@ CURL* CURLPool::get(const SOAPTransport::Address& addr) // Create a new connection and set non-varying options. CURL* handle=curl_easy_init(); if (!handle) - return NULL; + return nullptr; curl_easy_setopt(handle,CURLOPT_NOPROGRESS,1); curl_easy_setopt(handle,CURLOPT_NOSIGNAL,1); curl_easy_setopt(handle,CURLOPT_FAILONERROR,1); curl_easy_setopt(handle,CURLOPT_SSL_CIPHER_LIST,"ALL:!aNULL:!LOW:!EXPORT:!SSLv2"); // Verification of the peer is via TrustEngine only. curl_easy_setopt(handle,CURLOPT_SSL_VERIFYPEER,0); - curl_easy_setopt(handle,CURLOPT_CAINFO,NULL); + curl_easy_setopt(handle,CURLOPT_CAINFO,nullptr); curl_easy_setopt(handle,CURLOPT_HEADERFUNCTION,&curl_header_hook); curl_easy_setopt(handle,CURLOPT_WRITEFUNCTION,&curl_write_hook); curl_easy_setopt(handle,CURLOPT_DEBUGFUNCTION,&curl_debug_hook); @@ -334,7 +334,7 @@ void CURLPool::put(const char* from, const char* to, const char* endpoint, CURL* else i->second.push_back(handle); - CURL* killit=NULL; + CURL* killit=nullptr; if (++m_size > 256) { // Kick a handle out from the back of the bus. while (true) { @@ -366,7 +366,7 @@ bool CURLSOAPTransport::setAuth(transport_auth_t authType, const char* username, if (authType==transport_auth_none) { if (curl_easy_setopt(m_handle,CURLOPT_HTTPAUTH,0)!=CURLE_OK) return false; - return (curl_easy_setopt(m_handle,CURLOPT_USERPWD,NULL)==CURLE_OK); + return (curl_easy_setopt(m_handle,CURLOPT_USERPWD,nullptr)==CURLE_OK); } long flag=0; switch (authType) { @@ -410,28 +410,28 @@ bool CURLSOAPTransport::setProviderOption(const char* provider, const char* opti } // For libcurl, the option is an enum and the value type depends on the option. - CURLoption opt = static_cast(strtol(option, NULL, 10)); + CURLoption opt = static_cast(strtol(option, nullptr, 10)); if (opt < CURLOPTTYPE_OBJECTPOINT) - return (curl_easy_setopt(m_handle, opt, strtol(value, NULL, 10)) == CURLE_OK); + return (curl_easy_setopt(m_handle, opt, strtol(value, nullptr, 10)) == CURLE_OK); #ifdef CURLOPTTYPE_OFF_T else if (opt < CURLOPTTYPE_OFF_T) { if (value) m_saved_options.push_back(value); - return (curl_easy_setopt(m_handle, opt, value ? m_saved_options.back().c_str() : NULL) == CURLE_OK); + return (curl_easy_setopt(m_handle, opt, value ? m_saved_options.back().c_str() : nullptr) == CURLE_OK); } # ifdef HAVE_CURL_OFF_T else if (sizeof(curl_off_t) == sizeof(long)) - return (curl_easy_setopt(m_handle, opt, strtol(value, NULL, 10)) == CURLE_OK); + return (curl_easy_setopt(m_handle, opt, strtol(value, nullptr, 10)) == CURLE_OK); # else else if (sizeof(off_t) == sizeof(long)) - return (curl_easy_setopt(m_handle, opt, strtol(value, NULL, 10)) == CURLE_OK); + return (curl_easy_setopt(m_handle, opt, strtol(value, nullptr, 10)) == CURLE_OK); # endif return false; #else else { if (value) m_saved_options.push_back(value); - return (curl_easy_setopt(m_handle, opt, value ? m_saved_options.back().c_str() : NULL) == CURLE_OK); + return (curl_easy_setopt(m_handle, opt, value ? m_saved_options.back().c_str() : nullptr) == CURLE_OK); } #endif } @@ -458,7 +458,7 @@ const vector& CURLSOAPTransport::getResponseHeader(const char* name) con string CURLSOAPTransport::getContentType() const { - char* content_type=NULL; + char* content_type=nullptr; curl_easy_getinfo(m_handle,CURLINFO_CONTENT_TYPE,&content_type); return content_type ? content_type : ""; } @@ -504,7 +504,7 @@ void CURLSOAPTransport::send(istream* in) msg.append(buf,in->gcount()); } curl_easy_setopt(m_handle,CURLOPT_POST,1); - curl_easy_setopt(m_handle,CURLOPT_READFUNCTION,NULL); + curl_easy_setopt(m_handle,CURLOPT_READFUNCTION,nullptr); curl_easy_setopt(m_handle,CURLOPT_POSTFIELDS,msg.c_str()); curl_easy_setopt(m_handle,CURLOPT_POSTFIELDSIZE,msg.length()); } @@ -540,14 +540,14 @@ void CURLSOAPTransport::send(istream* in) // Restore security "state". Necessary because the callback only runs // when handshakes occur. Even new TCP connections won't execute it. - char* priv=NULL; + char* priv=nullptr; curl_easy_getinfo(m_handle,CURLINFO_PRIVATE,&priv); if (priv) m_authenticated=true; } else { - curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_FUNCTION,NULL); - curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_DATA,NULL); + curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_FUNCTION,nullptr); + curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_DATA,nullptr); } // Make the call. @@ -644,7 +644,7 @@ int xmltooling::verify_callback(X509_STORE_CTX* x509_ctx, void* arg) if (ctx->m_criteria) { ctx->m_criteria->setUsage(Credential::TLS_CREDENTIAL); // Bypass name check (handled for us by curl). - ctx->m_criteria->setPeerName(NULL); + ctx->m_criteria->setPeerName(nullptr); success = ctx->m_trustEngine->validate(x509_ctx->cert,x509_ctx->untrusted,*(ctx->m_peerResolver),ctx->m_criteria); } else { @@ -686,7 +686,7 @@ CURLcode xmltooling::xml_ssl_ctx_callback(CURL* curl, SSL_CTX* ssl_ctx, void* us conf->m_cred->attach(ssl_ctx); if (conf->m_trustEngine) { - SSL_CTX_set_verify(ssl_ctx,SSL_VERIFY_PEER,NULL); + SSL_CTX_set_verify(ssl_ctx,SSL_VERIFY_PEER,nullptr); #if (OPENSSL_VERSION_NUMBER >= 0x00907000L) // With 0.9.7, we can pass a callback argument directly. SSL_CTX_set_cert_verify_callback(ssl_ctx,verify_callback,userptr); @@ -694,7 +694,7 @@ CURLcode xmltooling::xml_ssl_ctx_callback(CURL* curl, SSL_CTX* ssl_ctx, void* us // With 0.9.6, there's no argument, so we're going to use a really embarrassing hack and // stuff the argument in the depth property where it will get copied to the context object // that's handed to the callback. - SSL_CTX_set_cert_verify_callback(ssl_ctx,reinterpret_cast(verify_callback),NULL); + SSL_CTX_set_cert_verify_callback(ssl_ctx,reinterpret_cast(verify_callback),nullptr); SSL_CTX_set_verify_depth(ssl_ctx,reinterpret_cast(userptr)); #endif } diff --git a/xmltooling/soap/impl/SOAPClient.cpp b/xmltooling/soap/impl/SOAPClient.cpp index a3898a5..0449eb0 100644 --- a/xmltooling/soap/impl/SOAPClient.cpp +++ b/xmltooling/soap/impl/SOAPClient.cpp @@ -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. @@ -75,7 +75,7 @@ HTTPSOAPTransport::~HTTPSOAPTransport() { } -SOAPClient::SOAPClient(bool validate) : m_validate(validate), m_transport(NULL) +SOAPClient::SOAPClient(bool validate) : m_validate(validate), m_transport(nullptr) { } @@ -92,13 +92,13 @@ void SOAPClient::setValidating(bool validate) void SOAPClient::reset() { delete m_transport; - m_transport=NULL; + m_transport=nullptr; } void SOAPClient::send(const Envelope& env, const SOAPTransport::Address& addr) { // Prepare a transport object. - const char* pch = addr.m_endpoint ? strchr(addr.m_endpoint,':') : NULL; + const char* pch = addr.m_endpoint ? strchr(addr.m_endpoint,':') : nullptr; if (!pch) throw IOException("SOAP endpoint was not a URL."); string scheme(addr.m_endpoint, pch-addr.m_endpoint); @@ -125,7 +125,7 @@ Envelope* SOAPClient::receive() // If we can get the stream, then the call is still active. istream& out = m_transport->receive(); if (!out) - return NULL; // nothing yet + return nullptr; // nothing yet // Check content type. string s = m_transport->getContentType(); @@ -175,8 +175,8 @@ void SOAPClient::prepareTransport(SOAPTransport& transport) bool SOAPClient::handleFault(const Fault& fault) { - const xmltooling::QName* code = (fault.getFaultcode() ? fault.getFaultcode()->getCode() : NULL); - auto_ptr_char str((fault.getFaultstring() ? fault.getFaultstring()->getString() : NULL)); + const xmltooling::QName* code = (fault.getFaultcode() ? fault.getFaultcode()->getCode() : nullptr); + auto_ptr_char str((fault.getFaultstring() ? fault.getFaultstring()->getString() : nullptr)); Category::getInstance(XMLTOOLING_LOGCAT".SOAPClient").error( "SOAP client detected a Fault: (%s) (%s)", (code ? code->toString().c_str() : "no code"), diff --git a/xmltooling/soap/impl/SOAPImpl.cpp b/xmltooling/soap/impl/SOAPImpl.cpp index c635f30..4549d90 100644 --- a/xmltooling/soap/impl/SOAPImpl.cpp +++ b/xmltooling/soap/impl/SOAPImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 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. @@ -17,7 +17,7 @@ /** * SOAPImpl.cpp * - * Implementation classes for SOAP 1.1 schema + * Implementation classes for SOAP 1.1 schema. */ #include "internal.h" @@ -62,11 +62,11 @@ namespace { } FaultcodeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) - : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_qname(NULL) { + : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_qname(nullptr) { } FaultcodeImpl(const FaultcodeImpl& src) - : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src), m_qname(NULL) { + : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src), m_qname(nullptr) { setCode(src.getCode()); } @@ -81,7 +81,7 @@ namespace { setTextContent(temp.get()); } else - setTextContent(NULL); + setTextContent(nullptr); } IMPL_XMLOBJECT_CLONE(Faultcode); @@ -135,14 +135,14 @@ namespace { public AbstractXMLObjectUnmarshaller { void init() { - m_Faultcode=NULL; - m_Faultstring=NULL; - m_Faultactor=NULL; - m_Detail=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); + m_Faultcode=nullptr; + m_Faultstring=nullptr; + m_Faultactor=nullptr; + m_Detail=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_Faultcode=m_children.begin(); m_pos_Faultstring=m_pos_Faultcode; ++m_pos_Faultstring; @@ -185,10 +185,10 @@ namespace { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Faultcode,NULL,false); - PROC_TYPED_CHILD(Faultstring,NULL,false); - PROC_TYPED_CHILD(Faultactor,NULL,false); - PROC_TYPED_CHILD(Detail,NULL,false); + PROC_TYPED_CHILD(Faultcode,nullptr,false); + PROC_TYPED_CHILD(Faultstring,nullptr,false); + PROC_TYPED_CHILD(Faultactor,nullptr,false); + PROC_TYPED_CHILD(Detail,nullptr,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -285,10 +285,10 @@ namespace { public AbstractXMLObjectUnmarshaller { void init() { - m_Header=NULL; - m_Body=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); + m_Header=nullptr; + m_Body=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_Header=m_children.begin(); m_pos_Body=m_pos_Header; ++m_pos_Body; diff --git a/xmltooling/soap/impl/SOAPSchemaValidators.cpp b/xmltooling/soap/impl/SOAPSchemaValidators.cpp index 8bea6d6..2ae9b54 100644 --- a/xmltooling/soap/impl/SOAPSchemaValidators.cpp +++ b/xmltooling/soap/impl/SOAPSchemaValidators.cpp @@ -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. @@ -73,12 +73,12 @@ void soap11::registerSOAPClasses() { QName q; REGISTER_ELEMENT_NOVAL(SOAP11ENV_NS,Body); - REGISTER_ELEMENT_NOVAL(NULL,Detail); + REGISTER_ELEMENT_NOVAL(nullptr,Detail); REGISTER_ELEMENT(SOAP11ENV_NS,Envelope); REGISTER_ELEMENT(SOAP11ENV_NS,Fault); - REGISTER_ELEMENT(NULL,Faultactor); - REGISTER_ELEMENT(NULL,Faultcode); - REGISTER_ELEMENT(NULL,Faultstring); + REGISTER_ELEMENT(nullptr,Faultactor); + REGISTER_ELEMENT(nullptr,Faultcode); + REGISTER_ELEMENT(nullptr,Faultstring); REGISTER_ELEMENT_NOVAL(SOAP11ENV_NS,Header); REGISTER_TYPE_NOVAL(SOAP11ENV_NS,Body); REGISTER_TYPE_NOVAL(SOAP11ENV_NS,Detail); diff --git a/xmltooling/unicode.h b/xmltooling/unicode.h index 1076abc..327cadc 100644 --- a/xmltooling/unicode.h +++ b/xmltooling/unicode.h @@ -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. @@ -97,7 +97,7 @@ namespace xmltooling { /** * Default constructor. */ - auto_ptr_char() : m_buf(NULL) { + auto_ptr_char() : m_buf(nullptr) { } /** @@ -138,7 +138,7 @@ namespace xmltooling { * @return a null-terminated local code page string */ char* release() { - char* temp=m_buf; m_buf=NULL; return temp; + char* temp=m_buf; m_buf=nullptr; return temp; } private: @@ -159,7 +159,7 @@ namespace xmltooling { /** * Default constructor. */ - auto_ptr_XMLCh() : m_buf(NULL) { + auto_ptr_XMLCh() : m_buf(nullptr) { } /** @@ -200,7 +200,7 @@ namespace xmltooling { * @return a null-terminated Unicode string */ XMLCh* release() { - XMLCh* temp=m_buf; m_buf=NULL; return temp; + XMLCh* temp=m_buf; m_buf=nullptr; return temp; } private: @@ -247,7 +247,7 @@ namespace xmltooling { * @return the wrapped pointer */ T* release() { - T* temp=m_ptr; m_ptr=NULL; return temp; + T* temp=m_ptr; m_ptr=nullptr; return temp; } }; }; diff --git a/xmltooling/util/CurlURLInputStream.cpp b/xmltooling/util/CurlURLInputStream.cpp index 92e7920..219cf97 100644 --- a/xmltooling/util/CurlURLInputStream.cpp +++ b/xmltooling/util/CurlURLInputStream.cpp @@ -204,9 +204,9 @@ CurlURLInputStream::CurlURLInputStream(const DOMElement* e, string* cacheTag) , fContentType(0) , fStatusCode(200) { - const XMLCh* attr = e->getAttributeNS(NULL, url); + const XMLCh* attr = e->getAttributeNS(nullptr, url); if (!attr || !*attr) { - attr = e->getAttributeNS(NULL, uri); + attr = e->getAttributeNS(nullptr, uri); if (!attr || !*attr) throw IOException("No URL supplied via DOM to CurlURLInputStream constructor."); } @@ -261,13 +261,13 @@ void CurlURLInputStream::init(const DOMElement* e) curl_easy_setopt(fEasy, CURLOPT_MAXREDIRS, 6); // Default settings. - curl_easy_setopt(fEasy, CURLOPT_CONNECTTIMEOUT,10); - curl_easy_setopt(fEasy, CURLOPT_TIMEOUT,60); - curl_easy_setopt(fEasy, CURLOPT_HTTPAUTH,0); - curl_easy_setopt(fEasy, CURLOPT_USERPWD,NULL); + curl_easy_setopt(fEasy, CURLOPT_CONNECTTIMEOUT, 10); + curl_easy_setopt(fEasy, CURLOPT_TIMEOUT, 60); + curl_easy_setopt(fEasy, CURLOPT_HTTPAUTH, 0); + curl_easy_setopt(fEasy, CURLOPT_USERPWD, nullptr); curl_easy_setopt(fEasy, CURLOPT_SSL_VERIFYHOST, 2); curl_easy_setopt(fEasy, CURLOPT_SSL_VERIFYPEER, 0); - curl_easy_setopt(fEasy, CURLOPT_CAINFO, NULL); + curl_easy_setopt(fEasy, CURLOPT_CAINFO, nullptr); curl_easy_setopt(fEasy, CURLOPT_SSL_CIPHER_LIST, "ALL:!aNULL:!LOW:!EXPORT:!SSLv2"); curl_easy_setopt(fEasy, CURLOPT_NOPROGRESS, 1); curl_easy_setopt(fEasy, CURLOPT_NOSIGNAL, 1); @@ -294,7 +294,7 @@ void CurlURLInputStream::init(const DOMElement* e) } if (e) { - const XMLCh* flag = e->getAttributeNS(NULL, verifyHost); + const XMLCh* flag = e->getAttributeNS(nullptr, verifyHost); if (flag && (*flag == chLatin_f || *flag == chDigit_0)) curl_easy_setopt(fEasy, CURLOPT_SSL_VERIFYHOST, 0); @@ -302,8 +302,8 @@ void CurlURLInputStream::init(const DOMElement* e) bool success; DOMElement* child = XMLHelper::getLastChildElement(e, TransportOption); while (child) { - if (child->hasChildNodes() && XMLString::equals(child->getAttributeNS(NULL,_provider), _OpenSSL)) { - auto_ptr_char option(child->getAttributeNS(NULL,_option)); + if (child->hasChildNodes() && XMLString::equals(child->getAttributeNS(nullptr,_provider), _OpenSSL)) { + auto_ptr_char option(child->getAttributeNS(nullptr,_option)); auto_ptr_char value(child->getFirstChild()->getNodeValue()); if (option.get() && value.get() && !strcmp(option.get(), "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION") && (*value.get()=='1' || *value.get()=='t')) { @@ -327,14 +327,14 @@ void CurlURLInputStream::init(const DOMElement* e) if (!success) fLog.error("failed to set OpenSSL transport option (%s)", option.get()); } - else if (child->hasChildNodes() && XMLString::equals(child->getAttributeNS(NULL,_provider), _CURL)) { - auto_ptr_char option(child->getAttributeNS(NULL,_option)); + else if (child->hasChildNodes() && XMLString::equals(child->getAttributeNS(nullptr,_provider), _CURL)) { + auto_ptr_char option(child->getAttributeNS(nullptr,_option)); auto_ptr_char value(child->getFirstChild()->getNodeValue()); if (option.get() && *option.get() && value.get() && *value.get()) { // For libcurl, the option is an enum and the value type depends on the option. - CURLoption opt = static_cast(strtol(option.get(), NULL, 10)); + CURLoption opt = static_cast(strtol(option.get(), nullptr, 10)); if (opt < CURLOPTTYPE_OBJECTPOINT) - success = (curl_easy_setopt(fEasy, opt, strtol(value.get(), NULL, 10)) == CURLE_OK); + success = (curl_easy_setopt(fEasy, opt, strtol(value.get(), nullptr, 10)) == CURLE_OK); #ifdef CURLOPTTYPE_OFF_T else if (opt < CURLOPTTYPE_OFF_T) { fSavedOptions.push_back(value.get()); @@ -342,10 +342,10 @@ void CurlURLInputStream::init(const DOMElement* e) } # ifdef HAVE_CURL_OFF_T else if (sizeof(curl_off_t) == sizeof(long)) - success = (curl_easy_setopt(fEasy, opt, strtol(value.get(), NULL, 10)) == CURLE_OK); + success = (curl_easy_setopt(fEasy, opt, strtol(value.get(), nullptr, 10)) == CURLE_OK); # else else if (sizeof(off_t) == sizeof(long)) - success = (curl_easy_setopt(fEasy, opt, strtol(value.get(), NULL, 10)) == CURLE_OK); + success = (curl_easy_setopt(fEasy, opt, strtol(value.get(), nullptr, 10)) == CURLE_OK); # endif else success = false; @@ -377,9 +377,9 @@ void CurlURLInputStream::init(const DOMElement* e) catch (XMLException&) { curl_multi_remove_handle(fMulti, fEasy); curl_easy_cleanup(fEasy); - fEasy = NULL; + fEasy = nullptr; curl_multi_cleanup(fMulti); - fMulti = NULL; + fMulti = nullptr; throw; } if(runningHandles == 0) break; @@ -398,9 +398,9 @@ void CurlURLInputStream::init(const DOMElement* e) if (!fBuffer) { curl_multi_remove_handle(fMulti, fEasy); curl_easy_cleanup(fEasy); - fEasy = NULL; + fEasy = nullptr; curl_multi_cleanup(fMulti); - fMulti = NULL; + fMulti = nullptr; throw bad_alloc(); } memcpy(fBuffer, specialxml.c_str(), specialxml.length()); @@ -412,7 +412,7 @@ void CurlURLInputStream::init(const DOMElement* e) } // Find the content type - char* contentType8 = NULL; + char* contentType8 = nullptr; if(curl_easy_getinfo(fEasy, CURLINFO_CONTENT_TYPE, &contentType8) == CURLE_OK && contentType8) fContentType = XMLString::transcode(contentType8); } @@ -476,7 +476,7 @@ bool CurlURLInputStream::readMore(int* runningHandles) // Process messages from curl int msgsInQueue = 0; - for (CURLMsg* msg = NULL; (msg = curl_multi_info_read(fMulti, &msgsInQueue)) != NULL; ) + for (CURLMsg* msg = nullptr; (msg = curl_multi_info_read(fMulti, &msgsInQueue)) != nullptr; ) { fLog.debug("msg %d, %d from curl", msg->msg, msg->data.result); diff --git a/xmltooling/util/CurlURLInputStream.h b/xmltooling/util/CurlURLInputStream.h index 0a7ee47..a8b72ba 100644 --- a/xmltooling/util/CurlURLInputStream.h +++ b/xmltooling/util/CurlURLInputStream.h @@ -46,7 +46,7 @@ namespace xmltooling { * @param url the URL of the resource to fetch * @param cacheTag optional pointer to string used for cache management */ - CurlURLInputStream(const char* url, std::string* cacheTag=NULL); + CurlURLInputStream(const char* url, std::string* cacheTag=nullptr); /** * Constructor. @@ -54,7 +54,7 @@ namespace xmltooling { * @param url the URL of the resource to fetch * @param cacheTag optional pointer to string used for cache management */ - CurlURLInputStream(const XMLCh* url, std::string* cacheTag=NULL); + CurlURLInputStream(const XMLCh* url, std::string* cacheTag=nullptr); /** * Constructor taking a DOM element supporting the following content: @@ -71,7 +71,7 @@ namespace xmltooling { * @param e DOM to supply configuration * @param cacheTag optional pointer to string used for cache management */ - CurlURLInputStream(const xercesc::DOMElement* e, std::string* cacheTag=NULL); + CurlURLInputStream(const xercesc::DOMElement* e, std::string* cacheTag=nullptr); ~CurlURLInputStream(); @@ -109,7 +109,7 @@ namespace xmltooling { static size_t staticWriteCallback(char *buffer, size_t size, size_t nitems, void *outstream); size_t writeCallback(char *buffer, size_t size, size_t nitems); - void init(const xercesc::DOMElement* e=NULL); + void init(const xercesc::DOMElement* e=nullptr); bool readMore(int *runningHandles); logging::Category& fLog; diff --git a/xmltooling/util/PThreads.cpp b/xmltooling/util/PThreads.cpp index a5d159c..43437e7 100644 --- a/xmltooling/util/PThreads.cpp +++ b/xmltooling/util/PThreads.cpp @@ -102,7 +102,7 @@ namespace xmltooling { int timedwait(MutexImpl* mutex, int delay_seconds) { struct timespec ts; memset(&ts, 0, sizeof(ts)); - ts.tv_sec = time(NULL) + delay_seconds; + ts.tv_sec = time(nullptr) + delay_seconds; return pthread_cond_timedwait(&cond, &(mutex->mutex), &ts); } @@ -195,7 +195,7 @@ ThreadImpl::ThreadImpl(void* (*start_routine)(void*), void* arg, size_t stacksiz rc = pthread_create(&thread_id, &attrs, start_routine, arg); } else { - rc = pthread_create(&thread_id, NULL, start_routine, arg); + rc = pthread_create(&thread_id, nullptr, start_routine, arg); } if (rc) { #ifdef HAVE_STRERROR_R @@ -212,7 +212,7 @@ ThreadImpl::ThreadImpl(void* (*start_routine)(void*), void* arg, size_t stacksiz MutexImpl::MutexImpl() { - int rc=pthread_mutex_init(&mutex, NULL); + int rc=pthread_mutex_init(&mutex, nullptr); if (rc) { #ifdef HAVE_STRERROR_R char buf[256]; @@ -228,7 +228,7 @@ MutexImpl::MutexImpl() CondWaitImpl::CondWaitImpl() { - int rc=pthread_cond_init(&cond, NULL); + int rc=pthread_cond_init(&cond, nullptr); if (rc) { #ifdef HAVE_STRERROR_R char buf[256]; @@ -245,9 +245,9 @@ CondWaitImpl::CondWaitImpl() RWLockImpl::RWLockImpl() { #ifdef HAVE_PTHREAD_RWLOCK_INIT - int rc=pthread_rwlock_init(&lock, NULL); + int rc=pthread_rwlock_init(&lock, nullptr); #else - int rc=rwlock_init(&lock, USYNC_THREAD, NULL); + int rc=rwlock_init(&lock, USYNC_THREAD, nullptr); #endif if (rc) { #ifdef HAVE_STRERROR_R @@ -297,7 +297,7 @@ void Thread::mask_all_signals(void) { sigset_t sigmask; sigfillset(&sigmask); - Thread::mask_signals(SIG_BLOCK, &sigmask, NULL); + Thread::mask_signals(SIG_BLOCK, &sigmask, nullptr); } int Thread::mask_signals(int how, const sigset_t *newmask, sigset_t *oldmask) diff --git a/xmltooling/util/ParserPool.cpp b/xmltooling/util/ParserPool.cpp index 39d6369..604822a 100644 --- a/xmltooling/util/ParserPool.cpp +++ b/xmltooling/util/ParserPool.cpp @@ -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. @@ -110,7 +110,7 @@ ParserPool::~ParserPool() DOMDocument* ParserPool::newDocument() { - return DOMImplementationRegistry::getDOMImplementation(NULL)->createDocument(); + return DOMImplementationRegistry::getDOMImplementation(nullptr)->createDocument(); } #ifdef XMLTOOLING_XERCESC_COMPLIANT_DOMLS @@ -128,20 +128,20 @@ DOMDocument* ParserPool::parse(DOMLSInput& domsrc) doc->release(); throw XMLParserException("XML error(s) during parsing, check log for specifics"); } - parser->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, (void*)NULL); + parser->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, nullptr); parser->getDomConfig()->setParameter(XMLUni::fgXercesUserAdoptsDOMDocument, true); checkinBuilder(janitor.release()); return doc; } catch (XMLException& ex) { - parser->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, (void*)NULL); + parser->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, nullptr); parser->getDomConfig()->setParameter(XMLUni::fgXercesUserAdoptsDOMDocument, true); checkinBuilder(janitor.release()); auto_ptr_char temp(ex.getMessage()); throw XMLParserException(string("Xerces error during parsing: ") + (temp.get() ? temp.get() : "no message")); } catch (XMLToolingException&) { - parser->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, (void*)NULL); + parser->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, nullptr); parser->getDomConfig()->setParameter(XMLUni::fgXercesUserAdoptsDOMDocument, true); checkinBuilder(janitor.release()); throw; @@ -163,20 +163,20 @@ DOMDocument* ParserPool::parse(DOMInputSource& domsrc) doc->release(); throw XMLParserException("XML error(s) during parsing, check log for specifics"); } - parser->setErrorHandler(NULL); + parser->setErrorHandler(nullptr); parser->setFeature(XMLUni::fgXercesUserAdoptsDOMDocument, true); checkinBuilder(janitor.release()); return doc; } catch (XMLException& ex) { - parser->setErrorHandler(NULL); + parser->setErrorHandler(nullptr); parser->setFeature(XMLUni::fgXercesUserAdoptsDOMDocument, true); checkinBuilder(janitor.release()); auto_ptr_char temp(ex.getMessage()); throw XMLParserException(string("Xerces error during parsing: ") + (temp.get() ? temp.get() : "no message")); } catch (XMLToolingException&) { - parser->setErrorHandler(NULL); + parser->setErrorHandler(nullptr); parser->setFeature(XMLUni::fgXercesUserAdoptsDOMDocument, true); checkinBuilder(janitor.release()); throw; @@ -262,7 +262,7 @@ bool ParserPool::loadCatalog(const XMLCh* pathname) log.debug("loading XML catalog from %s", temp.get()); } - LocalFileInputSource fsrc(NULL,pathname); + LocalFileInputSource fsrc(nullptr,pathname); Wrapper4InputSource domsrc(&fsrc,false); try { DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(domsrc); @@ -281,8 +281,8 @@ bool ParserPool::loadCatalog(const XMLCh* pathname) Lock lock(m_lock); for (XMLSize_t i=0; igetLength(); i++) { root=static_cast(mappings->item(i)); - const XMLCh* from=root->getAttributeNS(NULL,systemId); - const XMLCh* to=root->getAttributeNS(NULL,uri); + const XMLCh* from=root->getAttributeNS(nullptr,systemId); + const XMLCh* to=root->getAttributeNS(nullptr,uri); m_schemaLocMap[from]=to; } m_schemaLocations.erase(); @@ -314,7 +314,7 @@ DOMInputSource* ParserPool::resolveEntity( xmltooling::NDC ndc("resolveEntity"); #endif if (!systemId) - return NULL; + return nullptr; Category& log=Category::getInstance(XMLTOOLING_LOGCAT".ParserPool"); if (log.isDebugEnabled()) { @@ -351,7 +351,7 @@ DOMLSParser* ParserPool::createBuilder() { static const XMLCh impltype[] = { chLatin_L, chLatin_S, chNull }; DOMImplementation* impl=DOMImplementationRegistry::getDOMImplementation(impltype); - DOMLSParser* parser=static_cast(impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS,NULL); + DOMLSParser* parser=static_cast(impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS,nullptr); parser->getDomConfig()->setParameter(XMLUni::fgDOMNamespaces, m_namespaceAware); if (m_schemaAware) { parser->getDomConfig()->setParameter(XMLUni::fgDOMNamespaces, true); @@ -467,7 +467,7 @@ StreamInputSource::StreamBinInputStream::curPos() const #ifdef XMLTOOLING_XERCESC_64BITSAFE const XMLCh* StreamInputSource::StreamBinInputStream::getContentType() const { - return NULL; + return nullptr; } #endif @@ -505,9 +505,9 @@ URLInputSource::URLInputSource(const DOMElement* e, const char* systemId, string static const XMLCh uri[] = UNICODE_LITERAL_3(u,r,i); static const XMLCh url[] = UNICODE_LITERAL_3(u,r,l); - const XMLCh* attr = e->getAttributeNS(NULL, url); + const XMLCh* attr = e->getAttributeNS(nullptr, url); if (!attr || !*attr) { - attr = e->getAttributeNS(NULL, uri); + attr = e->getAttributeNS(nullptr, uri); if (!attr || !*attr) throw IOException("No URL supplied via DOM to URLInputSource constructor."); } @@ -524,7 +524,7 @@ BinInputStream* URLInputSource::makeStream() const #else URLInputSource::URLInputSource(const XMLCh* url, const char* systemId, string* cacheTag) - : InputSource(systemId), m_cacheTag(cacheTag), m_url(url), m_root(NULL) + : InputSource(systemId), m_cacheTag(cacheTag), m_url(url), m_root(nullptr) { } diff --git a/xmltooling/util/ParserPool.h b/xmltooling/util/ParserPool.h index 004f7c7..fabe1e5 100644 --- a/xmltooling/util/ParserPool.h +++ b/xmltooling/util/ParserPool.h @@ -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. @@ -178,7 +178,7 @@ namespace xmltooling { * @param is reference to an input stream * @param systemId optional system identifier to attach to the stream */ - StreamInputSource(std::istream& is, const char* systemId=NULL); + StreamInputSource(std::istream& is, const char* systemId=nullptr); /// @cond off xercesc::BinInputStream* makeStream() const; /// @endcond @@ -227,7 +227,7 @@ namespace xmltooling { * @param systemId optional system identifier to attach to the source * @param cacheTag optional pointer to string used for cache management */ - URLInputSource(const XMLCh* url, const char* systemId=NULL, std::string* cacheTag=NULL); + URLInputSource(const XMLCh* url, const char* systemId=nullptr, std::string* cacheTag=nullptr); /** * Constructor taking a DOM element supporting the following content: @@ -245,7 +245,7 @@ namespace xmltooling { * @param systemId optional system identifier to attach to the source * @param cacheTag optional pointer to string used for cache management */ - URLInputSource(const xercesc::DOMElement* e, const char* systemId=NULL, std::string* cacheTag=NULL); + URLInputSource(const xercesc::DOMElement* e, const char* systemId=nullptr, std::string* cacheTag=nullptr); /// @cond off virtual xercesc::BinInputStream* makeStream() const; diff --git a/xmltooling/util/PathResolver.h b/xmltooling/util/PathResolver.h index a6b6363..a19cc89 100644 --- a/xmltooling/util/PathResolver.h +++ b/xmltooling/util/PathResolver.h @@ -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. @@ -106,12 +106,12 @@ namespace xmltooling { * * @param s filename to resolve * @param filetype type of file being resolved - * @param pkgname application package name to use in resolving the file (or NULL for the default) - * @param prefix installation prefix to use in resolving the file (or NULL for the default) + * @param pkgname application package name to use in resolving the file (or nullptr for the default) + * @param prefix installation prefix to use in resolving the file (or nullptr for the default) * * @return a const reference to the input string */ - virtual const std::string& resolve(std::string& s, file_type_t filetype, const char* pkgname=NULL, const char* prefix=NULL) const; + virtual const std::string& resolve(std::string& s, file_type_t filetype, const char* pkgname=nullptr, const char* prefix=nullptr) const; private: bool isAbsolute(const char* s) const; diff --git a/xmltooling/util/Predicates.h b/xmltooling/util/Predicates.h index b822862..3269231 100644 --- a/xmltooling/util/Predicates.h +++ b/xmltooling/util/Predicates.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -76,7 +76,7 @@ namespace xmltooling { * @param xmlObject the object to examine */ bool operator()(const XMLObject* xmlObject) const { - const QName* xsitype = xmlObject ? xmlObject->getSchemaType() : NULL; + const QName* xsitype = xmlObject ? xmlObject->getSchemaType() : nullptr; return xsitype ? (*xsitype == m_q) : false; } @@ -89,12 +89,12 @@ namespace xmltooling { * * @param c read-only container of pointer-based objects * @param p a predicate function - * @return the first object in the container matching the predicate, or NULL + * @return the first object in the container matching the predicate, or nullptr */ template typename Container::value_type find_if(const Container& c, const Predicate& p) { typename Container::const_iterator i = std::find_if(c.begin(), c.end(), p); - return (i!=c.end()) ? *i : NULL; + return (i!=c.end()) ? *i : nullptr; } /** @@ -102,12 +102,12 @@ namespace xmltooling { * * @param c read-only container of pointer-based objects * @param p a predicate function - * @return the first object in the container matching the predicate, or NULL + * @return the first object in the container matching the predicate, or nullptr */ template typename Container::value_type find_if(Container& c, const Predicate& p) { typename Container::iterator i = std::find_if(c.begin(), c.end(), p); - return (i!=c.end()) ? *i : NULL; + return (i!=c.end()) ? *i : nullptr; } }; diff --git a/xmltooling/util/ReloadableXMLFile.cpp b/xmltooling/util/ReloadableXMLFile.cpp index 722fc5c..dda1982 100644 --- a/xmltooling/util/ReloadableXMLFile.cpp +++ b/xmltooling/util/ReloadableXMLFile.cpp @@ -63,25 +63,25 @@ static const XMLCh backingFilePath[] = UNICODE_LITERAL_15(b,a,c,k,i,n,g,F,i,l,e ReloadableXMLFile::ReloadableXMLFile(const DOMElement* e, Category& log) - : m_root(e), m_local(true), m_validate(false), m_backupIndicator(true), m_filestamp(0), m_reloadInterval(0), m_lock(NULL), m_log(log), - m_shutdown(false), m_reload_wait(NULL), m_reload_thread(NULL) + : m_root(e), m_local(true), m_validate(false), m_backupIndicator(true), m_filestamp(0), m_reloadInterval(0), m_lock(nullptr), m_log(log), + m_shutdown(false), m_reload_wait(nullptr), m_reload_thread(nullptr) { #ifdef _DEBUG NDC ndc("ReloadableXMLFile"); #endif // Establish source of data... - const XMLCh* source=e->getAttributeNS(NULL,uri); + const XMLCh* source=e->getAttributeNS(nullptr,uri); if (!source || !*source) { - source=e->getAttributeNS(NULL,url); + source=e->getAttributeNS(nullptr,url); if (!source || !*source) { - source=e->getAttributeNS(NULL,path); + source=e->getAttributeNS(nullptr,path); if (!source || !*source) { - source=e->getAttributeNS(NULL,pathname); + source=e->getAttributeNS(nullptr,pathname); if (!source || !*source) { - source=e->getAttributeNS(NULL,file); + source=e->getAttributeNS(nullptr,file); if (!source || !*source) { - source=e->getAttributeNS(NULL,filename); + source=e->getAttributeNS(nullptr,filename); } } } @@ -93,7 +93,7 @@ ReloadableXMLFile::ReloadableXMLFile(const DOMElement* e, Category& log) m_local=false; if (source && *source) { - const XMLCh* flag=e->getAttributeNS(NULL,validate); + const XMLCh* flag=e->getAttributeNS(nullptr,validate); m_validate=(XMLString::equals(flag,xmlconstants::XML_TRUE) || XMLString::equals(flag,xmlconstants::XML_ONE)); auto_ptr_char temp(source); @@ -107,7 +107,7 @@ ReloadableXMLFile::ReloadableXMLFile(const DOMElement* e, Category& log) if (m_local) { XMLToolingConfig::getConfig().getPathResolver()->resolve(m_source, PathResolver::XMLTOOLING_CFG_FILE); - flag=e->getAttributeNS(NULL,reloadChanges); + flag=e->getAttributeNS(nullptr,reloadChanges); if (!XMLString::equals(flag,xmlconstants::XML_FALSE) && !XMLString::equals(flag,xmlconstants::XML_ZERO)) { #ifdef WIN32 struct _stat stat_buf; @@ -125,14 +125,14 @@ ReloadableXMLFile::ReloadableXMLFile(const DOMElement* e, Category& log) } else { log.debug("using remote resource (%s)", m_source.c_str()); - source = e->getAttributeNS(NULL,backingFilePath); + source = e->getAttributeNS(nullptr,backingFilePath); if (source && *source) { auto_ptr_char temp2(source); m_backing=temp2.get(); XMLToolingConfig::getConfig().getPathResolver()->resolve(m_backing, PathResolver::XMLTOOLING_RUN_FILE); log.debug("backup remote resource to (%s)", m_backing.c_str()); } - source = e->getAttributeNS(NULL,reloadInterval); + source = e->getAttributeNS(nullptr,reloadInterval); if (source && *source) { m_reloadInterval = XMLString::parseInt(source); if (m_reloadInterval > 0) { @@ -140,7 +140,7 @@ ReloadableXMLFile::ReloadableXMLFile(const DOMElement* e, Category& log) m_lock=RWLock::create(); } } - m_filestamp = time(NULL); // assume it gets loaded initially + m_filestamp = time(nullptr); // assume it gets loaded initially } if (m_lock) { @@ -152,7 +152,7 @@ ReloadableXMLFile::ReloadableXMLFile(const DOMElement* e, Category& log) log.debug("no resource uri/path/name supplied, will load inline configuration"); } - source = e->getAttributeNS(NULL, id); + source = e->getAttributeNS(nullptr, id); if (source && *source) { auto_ptr_char tempid(source); m_id = tempid.get(); @@ -171,11 +171,11 @@ void ReloadableXMLFile::shutdown() // Shut down the reload thread and let it know. m_shutdown = true; m_reload_wait->signal(); - m_reload_thread->join(NULL); + m_reload_thread->join(nullptr); delete m_reload_thread; delete m_reload_wait; - m_reload_thread = NULL; - m_reload_wait = NULL; + m_reload_thread = nullptr; + m_reload_wait = nullptr; } } @@ -242,7 +242,7 @@ void* ReloadableXMLFile::reload_fn(void* pv) logging::NDC::pop(); } - return NULL; + return nullptr; } Lockable* ReloadableXMLFile::lock() @@ -312,11 +312,11 @@ pair ReloadableXMLFile::load(bool backup) else m_log.debug("loading configuration from external resource..."); - DOMDocument* doc=NULL; + DOMDocument* doc=nullptr; if (m_local || backup) { auto_ptr_XMLCh widenit(backup ? m_backing.c_str() : m_source.c_str()); // Use library-wide lock for now, nothing else is using it anyway. - Locker locker(backup ? getBackupLock() : NULL); + Locker locker(backup ? getBackupLock() : nullptr); LocalFileInputSource src(widenit.get()); Wrapper4InputSource dsrc(&src, false); if (m_validate) @@ -325,7 +325,7 @@ pair ReloadableXMLFile::load(bool backup) doc=XMLToolingConfig::getConfig().getParser().parse(dsrc); } else { - URLInputSource src(m_root, NULL, &m_cacheTag); + URLInputSource src(m_root, nullptr, &m_cacheTag); Wrapper4InputSource dsrc(&src, false); if (m_validate) doc=XMLToolingConfig::getConfig().getValidatingParser().parse(dsrc); diff --git a/xmltooling/util/ReloadableXMLFile.h b/xmltooling/util/ReloadableXMLFile.h index a990f5e..bce4b8e 100644 --- a/xmltooling/util/ReloadableXMLFile.h +++ b/xmltooling/util/ReloadableXMLFile.h @@ -107,7 +107,7 @@ namespace xmltooling { * *

The lock is NOT acquired automatically. * - * @return pointer to a lock interface, or NULL if unnecessary + * @return pointer to a lock interface, or nullptr if unnecessary */ virtual Lockable* getBackupLock(); diff --git a/xmltooling/util/ReplayCache.cpp b/xmltooling/util/ReplayCache.cpp index ea91d82..a4db58d 100644 --- a/xmltooling/util/ReplayCache.cpp +++ b/xmltooling/util/ReplayCache.cpp @@ -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. @@ -27,10 +27,10 @@ using namespace xmltooling; using namespace std; -ReplayCache::ReplayCache(StorageService* storage) : m_owned(storage==NULL), m_storage(storage) +ReplayCache::ReplayCache(StorageService* storage) : m_owned(storage==nullptr), m_storage(storage) { if (!m_storage) - m_storage = XMLToolingConfig::getConfig().StorageServiceManager.newPlugin(MEMORY_STORAGE_SERVICE, NULL); + m_storage = XMLToolingConfig::getConfig().StorageServiceManager.newPlugin(MEMORY_STORAGE_SERVICE, nullptr); } ReplayCache::~ReplayCache() diff --git a/xmltooling/util/ReplayCache.h b/xmltooling/util/ReplayCache.h index b208646..a95514d 100644 --- a/xmltooling/util/ReplayCache.h +++ b/xmltooling/util/ReplayCache.h @@ -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. @@ -43,9 +43,9 @@ namespace xmltooling { * The lifetime of the StorageService MUST be longer than * the lifetime of the ReplayCache. * - * @param storage pointer to a StorageService, or NULL to keep cache in memory + * @param storage pointer to a StorageService, or nullptr to keep cache in memory */ - ReplayCache(StorageService* storage=NULL); + ReplayCache(StorageService* storage=nullptr); virtual ~ReplayCache(); diff --git a/xmltooling/util/StorageService.h b/xmltooling/util/StorageService.h index 04ee2c9..7d5440c 100644 --- a/xmltooling/util/StorageService.h +++ b/xmltooling/util/StorageService.h @@ -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. @@ -73,7 +73,7 @@ namespace xmltooling { * @throws IOException raised if errors occur in the read process */ virtual int readString( - const char* context, const char* key, std::string* pvalue=NULL, time_t* pexpiration=NULL, int version=0 + const char* context, const char* key, std::string* pvalue=nullptr, time_t* pexpiration=nullptr, int version=0 )=0; /** @@ -81,7 +81,7 @@ namespace xmltooling { * * @param context a storage context label * @param key null-terminated unique key of up to 255 bytes - * @param value null-terminated value of up to 255 bytes to store, or NULL to leave alone + * @param value null-terminated value of up to 255 bytes to store, or nullptr to leave alone * @param expiration a new expiration timestamp, or 0 to leave alone * @param version if > 0, only update if the current version matches this value * @return the version of the record after update, 0 if no record exists, or -1 if the version @@ -90,7 +90,7 @@ namespace xmltooling { * @throws IOException raised if errors occur in the update process */ virtual int updateString( - const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0 + const char* context, const char* key, const char* value=nullptr, time_t expiration=0, int version=0 )=0; /** @@ -132,7 +132,7 @@ namespace xmltooling { * @throws IOException raised if errors occur in the read process */ virtual int readText( - const char* context, const char* key, std::string* pvalue=NULL, time_t* pexpiration=NULL, int version=0 + const char* context, const char* key, std::string* pvalue=nullptr, time_t* pexpiration=nullptr, int version=0 )=0; /** @@ -140,7 +140,7 @@ namespace xmltooling { * * @param context a storage context label * @param key null-terminated unique key of up to 255 bytes - * @param value null-terminated value of arbitrary length to store, or NULL to leave alone + * @param value null-terminated value of arbitrary length to store, or nullptr to leave alone * @param expiration a new expiration timestamp, or 0 to leave alone * @param version if > 0, only update if the current version matches this value * @return the version of the record after update, 0 if no record exists, or -1 if the version @@ -149,7 +149,7 @@ namespace xmltooling { * @throws IOException raised if errors occur in the update process */ virtual int updateText( - const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0 + const char* context, const char* key, const char* value=nullptr, time_t expiration=0, int version=0 )=0; /** diff --git a/xmltooling/util/TemplateEngine.cpp b/xmltooling/util/TemplateEngine.cpp index 3ff09ae..48e90a9 100644 --- a/xmltooling/util/TemplateEngine.cpp +++ b/xmltooling/util/TemplateEngine.cpp @@ -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. @@ -40,7 +40,7 @@ TemplateEngine::~TemplateEngine() { } -TemplateEngine::TemplateParameters::TemplateParameters() : m_request(NULL) +TemplateEngine::TemplateParameters::TemplateParameters() : m_request(nullptr) { } @@ -51,13 +51,13 @@ TemplateEngine::TemplateParameters::~TemplateParameters() const char* TemplateEngine::TemplateParameters::getParameter(const char* name) const { map::const_iterator i=m_map.find(name); - return (i!=m_map.end() ? i->second.c_str() : (m_request ? m_request->getParameter(name) : NULL)); + return (i!=m_map.end() ? i->second.c_str() : (m_request ? m_request->getParameter(name) : nullptr)); } const multimap* TemplateEngine::TemplateParameters::getLoopCollection(const char* name) const { map< string,multimap >::const_iterator i=m_collectionMap.find(name); - return (i!=m_collectionMap.end() ? &(i->second) : NULL); + return (i!=m_collectionMap.end() ? &(i->second) : nullptr); } void TemplateEngine::setTagPrefix(const char* tagPrefix) @@ -135,7 +135,7 @@ void TemplateEngine::process( const char* line = buf.c_str(); const char* thispos; - while ((thispos = strchr(lastpos, '<')) != NULL) { + while ((thispos = strchr(lastpos, '<')) != nullptr) { // Output the string up to this token. if (visible) os << buf.substr(lastpos-line, thispos-lastpos); @@ -151,7 +151,7 @@ void TemplateEngine::process( lastpos = thispos + keytag.length(); // search for the end-tag - if ((thispos = strstr(lastpos, "/>")) != NULL) { + if ((thispos = strstr(lastpos, "/>")) != nullptr) { string key = buf.substr(lastpos-line, thispos-lastpos); trimspace(key); @@ -179,7 +179,7 @@ void TemplateEngine::process( lastpos = thispos + iftag.length(); // search for the end of this tag - if ((thispos = strchr(lastpos, '>')) != NULL) { + if ((thispos = strchr(lastpos, '>')) != nullptr) { string key = buf.substr(lastpos-line, thispos-lastpos); trimspace(key); bool cond=false; @@ -209,7 +209,7 @@ void TemplateEngine::process( lastpos = thispos + ifnottag.length(); // search for the end of this tag - if ((thispos = strchr(lastpos, '>')) != NULL) { + if ((thispos = strchr(lastpos, '>')) != nullptr) { string key = buf.substr(lastpos-line, thispos-lastpos); trimspace(key); bool cond=visible; @@ -242,7 +242,7 @@ void TemplateEngine::process( bool cond = visible; // search for the end of this tag - if ((thispos = strchr(lastpos, '>')) != NULL) { + if ((thispos = strchr(lastpos, '>')) != nullptr) { key = buf.substr(lastpos-line, thispos-lastpos); trimspace(key); lastpos = thispos + 1; // strlen(">") diff --git a/xmltooling/util/TemplateEngine.h b/xmltooling/util/TemplateEngine.h index 71606be..157c912 100644 --- a/xmltooling/util/TemplateEngine.h +++ b/xmltooling/util/TemplateEngine.h @@ -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. @@ -91,7 +91,7 @@ namespace xmltooling { * Returns the value of a parameter to plug into the template. * * @param name name of parameter - * @return value of parameter, or NULL + * @return value of parameter, or nullptr */ virtual const char* getParameter(const char* name) const; @@ -99,7 +99,7 @@ namespace xmltooling { * Returns a named collection of sub-parameters to pass into a loop. * * @param name name of sub-collection - * @return pointer to a multimap of sub-parameters, or NULL + * @return pointer to a multimap of sub-parameters, or nullptr */ virtual const std::multimap* getLoopCollection(const char* name) const; }; @@ -117,7 +117,7 @@ namespace xmltooling { std::istream& is, std::ostream& os, const TemplateParameters& parameters, - const XMLToolingException* e=NULL + const XMLToolingException* e=nullptr ) const; /** diff --git a/xmltooling/util/Threads.h b/xmltooling/util/Threads.h index d184d5c..aae15ed 100644 --- a/xmltooling/util/Threads.h +++ b/xmltooling/util/Threads.h @@ -17,7 +17,7 @@ /** * @file xmltooling/util/Threads.h * - * Thread and locking wrappers + * Thread and locking wrappers. */ #ifndef _xmltooling_threads_h @@ -128,7 +128,7 @@ namespace xmltooling /** * Returns the value for a TLS key. * - * @return the value or NULL + * @return the value or nullptr */ virtual void* getData() const=0; diff --git a/xmltooling/util/Win32Threads.cpp b/xmltooling/util/Win32Threads.cpp index 09d2720..222603a 100644 --- a/xmltooling/util/Win32Threads.cpp +++ b/xmltooling/util/Win32Threads.cpp @@ -17,7 +17,7 @@ /** * Win32Threads.cpp * - * Thread and locking wrappers for Win32 platforms + * Thread and locking wrappers for Win32 platforms. */ #include "internal.h" @@ -370,7 +370,7 @@ namespace xmltooling { void onDetach() const { if (destroy_hook) { destroy_hook(TlsGetValue(key)); - TlsSetValue(key, NULL); + TlsSetValue(key, nullptr); } } }; diff --git a/xmltooling/util/XMLHelper.cpp b/xmltooling/util/XMLHelper.cpp index ee502a4..5ffd63d 100644 --- a/xmltooling/util/XMLHelper.cpp +++ b/xmltooling/util/XMLHelper.cpp @@ -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. @@ -57,18 +57,18 @@ xmltooling::QName* XMLHelper::getXSIType(const DOMElement* e) return ret; } else { - return new xmltooling::QName(e->lookupNamespaceURI(NULL), attributeValue); + return new xmltooling::QName(e->lookupNamespaceURI(nullptr), attributeValue); } } } - return NULL; + return nullptr; } DOMAttr* XMLHelper::getIdAttribute(const DOMElement* domElement) { if(!domElement->hasAttributes()) { - return NULL; + return nullptr; } DOMNamedNodeMap* attributes = domElement->getAttributes(); @@ -80,7 +80,7 @@ DOMAttr* XMLHelper::getIdAttribute(const DOMElement* domElement) } } - return NULL; + return nullptr; } const XMLObject* XMLHelper::getXMLObjectById(const XMLObject& tree, const XMLCh* id) @@ -98,7 +98,7 @@ const XMLObject* XMLHelper::getXMLObjectById(const XMLObject& tree, const XMLCh* } } - return NULL; + return nullptr; } XMLObject* XMLHelper::getXMLObjectById(XMLObject& tree, const XMLCh* id) @@ -116,7 +116,7 @@ XMLObject* XMLHelper::getXMLObjectById(XMLObject& tree, const XMLCh* id) } } - return NULL; + return nullptr; } void XMLHelper::getNonVisiblyUsedPrefixes(const XMLObject& tree, set& prefixes) @@ -150,7 +150,7 @@ xmltooling::QName* XMLHelper::getNodeQName(const DOMNode* domNode) { if (domNode) return new xmltooling::QName(domNode->getNamespaceURI(), domNode->getLocalName(), domNode->getPrefix()); - return NULL; + return nullptr; } xmltooling::QName* XMLHelper::getAttributeValueAsQName(const DOMAttr* attribute) @@ -161,7 +161,7 @@ xmltooling::QName* XMLHelper::getAttributeValueAsQName(const DOMAttr* attribute) xmltooling::QName* XMLHelper::getNodeValueAsQName(const DOMNode* domNode) { if (!domNode) - return NULL; + return nullptr; int i; const XMLCh* value=domNode->getTextContent(); @@ -174,7 +174,7 @@ xmltooling::QName* XMLHelper::getNodeValueAsQName(const DOMNode* domNode) return ret; } - return new xmltooling::QName(domNode->lookupNamespaceURI(NULL), value); + return new xmltooling::QName(domNode->lookupNamespaceURI(nullptr), value); } DOMElement* XMLHelper::appendChildElement(DOMElement* parentElement, DOMElement* childElement) @@ -201,7 +201,7 @@ const XMLCh* XMLHelper::getTextContent(const DOMElement* e) return child->getNodeValue(); child=child->getNextSibling(); } - return NULL; + return nullptr; } DOMElement* XMLHelper::getFirstChildElement(const DOMNode* n, const XMLCh* localName) diff --git a/xmltooling/util/XMLHelper.h b/xmltooling/util/XMLHelper.h index 9fe1e62..d776d03 100644 --- a/xmltooling/util/XMLHelper.h +++ b/xmltooling/util/XMLHelper.h @@ -57,7 +57,7 @@ namespace xmltooling { /** * Returns resource held by this object. * - * @return the resource held or NULL + * @return the resource held or nullptr */ T* get() { return m_held; @@ -66,7 +66,7 @@ namespace xmltooling { /** * Returns resource held by this object. * - * @return the resource held or NULL + * @return the resource held or nullptr */ T* operator->() { return m_held; @@ -75,11 +75,11 @@ namespace xmltooling { /** * Returns resource held by this object and releases it to the caller. * - * @return the resource held or NULL + * @return the resource held or nullptr */ T* release() { T* ret=m_held; - m_held=NULL; + m_held=nullptr; return ret; } }; @@ -120,7 +120,7 @@ namespace xmltooling { * * @param tree root of tree to search * @param id ID value to locate - * @return XMLObject in the tree with a matching ID value, or NULL + * @return XMLObject in the tree with a matching ID value, or nullptr */ static const XMLObject* getXMLObjectById(const XMLObject& tree, const XMLCh* id); @@ -130,7 +130,7 @@ namespace xmltooling { * * @param tree root of tree to search * @param id ID value to locate - * @return XMLObject in the tree with a matching ID value, or NULL + * @return XMLObject in the tree with a matching ID value, or nullptr */ static XMLObject* getXMLObjectById(XMLObject& tree, const XMLCh* id); @@ -191,37 +191,37 @@ namespace xmltooling { * Returns the first matching child element of the node if any. * * @param n node to check - * @param localName local name to compare with or NULL for any match - * @return the first matching child node of type Element, or NULL + * @param localName local name to compare with or nullptr for any match + * @return the first matching child node of type Element, or nullptr */ - static xercesc::DOMElement* getFirstChildElement(const xercesc::DOMNode* n, const XMLCh* localName=NULL); + static xercesc::DOMElement* getFirstChildElement(const xercesc::DOMNode* n, const XMLCh* localName=nullptr); /** * Returns the last matching child element of the node if any. * * @param n node to check - * @param localName local name to compare with or NULL for any match - * @return the last matching child node of type Element, or NULL + * @param localName local name to compare with or nullptr for any match + * @return the last matching child node of type Element, or nullptr */ - static xercesc::DOMElement* getLastChildElement(const xercesc::DOMNode* n, const XMLCh* localName=NULL); + static xercesc::DOMElement* getLastChildElement(const xercesc::DOMNode* n, const XMLCh* localName=nullptr); /** * Returns the next matching sibling element of the node if any. * * @param n node to check - * @param localName local name to compare with or NULL for any match - * @return the next matching sibling node of type Element, or NULL + * @param localName local name to compare with or nullptr for any match + * @return the next matching sibling node of type Element, or nullptr */ - static xercesc::DOMElement* getNextSiblingElement(const xercesc::DOMNode* n, const XMLCh* localName=NULL); + static xercesc::DOMElement* getNextSiblingElement(const xercesc::DOMNode* n, const XMLCh* localName=nullptr); /** * Returns the previous matching sibling element of the node if any. * * @param n node to check - * @param localName local name to compare with or NULL for any match - * @return the previous matching sibling node of type Element, or NULL + * @param localName local name to compare with or nullptr for any match + * @return the previous matching sibling node of type Element, or nullptr */ - static xercesc::DOMElement* getPreviousSiblingElement(const xercesc::DOMNode* n, const XMLCh* localName=NULL); + static xercesc::DOMElement* getPreviousSiblingElement(const xercesc::DOMNode* n, const XMLCh* localName=nullptr); /** * Returns the first matching child element of the node if any. @@ -229,7 +229,7 @@ namespace xmltooling { * @param n node to check * @param ns namespace to compare with * @param localName local name to compare with - * @return the first matching child node of type Element, or NULL + * @return the first matching child node of type Element, or nullptr */ static xercesc::DOMElement* getFirstChildElement(const xercesc::DOMNode* n, const XMLCh* ns, const XMLCh* localName); @@ -239,7 +239,7 @@ namespace xmltooling { * @param n node to check * @param ns namespace to compare with * @param localName local name to compare with - * @return the last matching child node of type Element, or NULL + * @return the last matching child node of type Element, or nullptr */ static xercesc::DOMElement* getLastChildElement(const xercesc::DOMNode* n, const XMLCh* ns, const XMLCh* localName); @@ -249,7 +249,7 @@ namespace xmltooling { * @param n node to check * @param ns namespace to compare with * @param localName local name to compare with - * @return the next matching sibling node of type Element, or NULL + * @return the next matching sibling node of type Element, or nullptr */ static xercesc::DOMElement* getNextSiblingElement(const xercesc::DOMNode* n, const XMLCh* ns, const XMLCh* localName); @@ -259,7 +259,7 @@ namespace xmltooling { * @param n node to check * @param ns namespace to compare with * @param localName local name to compare with - * @return the previous matching sibling node of type Element, or NULL + * @return the previous matching sibling node of type Element, or nullptr */ static xercesc::DOMElement* getPreviousSiblingElement(const xercesc::DOMNode* n, const XMLCh* ns, const XMLCh* localName); @@ -269,7 +269,7 @@ namespace xmltooling { * examples the immediate children of the element. * * @param e element to examine - * @return the content of the first Text node found, or NULL + * @return the content of the first Text node found, or nullptr */ static const XMLCh* getTextContent(const xercesc::DOMElement* e); diff --git a/xmltooling/util/XMLObjectChildrenList.h b/xmltooling/util/XMLObjectChildrenList.h index c0b6575..c9955fb 100644 --- a/xmltooling/util/XMLObjectChildrenList.h +++ b/xmltooling/util/XMLObjectChildrenList.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -17,7 +17,7 @@ /** * @file xmltooling/util/XMLObjectChildrenList.h * - * STL-compatible container wrapper + * STL-compatible container wrapper. */ #ifndef __xmltooling_list_h__ @@ -558,7 +558,7 @@ namespace xmltooling { void removeParent(const_reference _Val) { if (_Val->getParent()!=m_parent) throw XMLObjectException("Child object not owned by this parent."); - _Val->setParent(NULL); + _Val->setParent(nullptr); m_parent->releaseParentDOM(true); } @@ -720,9 +720,9 @@ namespace xmltooling { void removeParent(const_reference _Val) { if (_Val.first->getParent()!=m_parent || (_Val.second && _Val.second->getParent()!=m_parent)) throw XMLObjectException("One of the child objects not owned by this parent."); - _Val.first->setParent(NULL); + _Val.first->setParent(nullptr); if (_Val.second) - _Val.second->setParent(NULL); + _Val.second->setParent(nullptr); m_parent->releaseParentDOM(true); } diff --git a/xmltooling/xmltooling-lite.vcxproj b/xmltooling/xmltooling-lite.vcxproj new file mode 100644 index 0000000..6c3b6d5 --- /dev/null +++ b/xmltooling/xmltooling-lite.vcxproj @@ -0,0 +1,289 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {06B55A46-D3B3-41AE-B5A5-B57830BA010E} + xmltooling-lite + Win32Proj + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(ProjectName)-$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(ProjectName)-$(Configuration)\ + true + $(ProjectName)-$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(ProjectName)-$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + $(ProjectName)1_4 + $(ProjectName)1_4 + $(ProjectName)1_4D + $(ProjectName)1_4D + + + + Disabled + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;XMLTOOLING_LITE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + true + Level3 + EditAndContinue + + + _DEBUG;XMLTOOLING_LITE;%(PreprocessorDefinitions) + + + wsock32.lib;log4shib1D.lib;xerces-c_3D.lib;%(AdditionalDependencies) + true + Windows + false + + + $(TargetDir)$(ProjectName)1D.lib + MachineX86 + + + + + X64 + + + Disabled + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;XMLTOOLING_LITE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + true + Level3 + ProgramDatabase + + + _DEBUG;XMLTOOLING_LITE;%(PreprocessorDefinitions) + + + wsock32.lib;log4shib1D.lib;xerces-c_3D.lib;%(AdditionalDependencies) + true + Windows + + + $(TargetDir)$(ProjectName)1D.lib + + + + + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;XMLTOOLING_LITE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + XMLTOOLING_LITE;%(PreprocessorDefinitions) + + + wsock32.lib;log4shib1.lib;xerces-c_3.lib;%(AdditionalDependencies) + true + Windows + true + true + false + + + $(TargetDir)$(ProjectName)1.lib + MachineX86 + + + + + X64 + + + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;XMLTOOLING_LITE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + XMLTOOLING_LITE;%(PreprocessorDefinitions) + + + wsock32.lib;log4shib1.lib;xerces-c_3.lib;%(AdditionalDependencies) + true + Windows + true + true + + + $(TargetDir)$(ProjectName)1.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xmltooling/xmltooling.vcxproj b/xmltooling/xmltooling.vcxproj new file mode 100644 index 0000000..70cec10 --- /dev/null +++ b/xmltooling/xmltooling.vcxproj @@ -0,0 +1,339 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {06B55A46-D3B3-41AE-B5A5-B57830BA010D} + xmltooling + Win32Proj + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + $(ProjectName)1_4D + $(ProjectName)1_4D + $(ProjectName)1_4 + $(ProjectName)1_4 + + + + Disabled + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + EnableFastChecks + + + true + Level3 + EditAndContinue + MultiThreadedDebugDLL + + + _DEBUG;%(PreprocessorDefinitions) + + + wsock32.lib;log4shib1D.lib;xerces-c_3D.lib;xsec_1D.lib;libeay32D.lib;ssleay32D.lib;libcurld_imp.lib;%(AdditionalDependencies) + true + Windows + + + $(TargetDir)$(ProjectName)1D.lib + + + + + X64 + + + Disabled + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + EnableFastChecks + + + true + Level3 + ProgramDatabase + MultiThreadedDebugDLL + + + _DEBUG;%(PreprocessorDefinitions) + + + wsock32.lib;log4shib1D.lib;xerces-c_3D.lib;xsec_1D.lib;libeay32D.lib;ssleay32D.lib;libcurld_imp.lib;%(AdditionalDependencies) + true + Windows + + + $(TargetDir)$(ProjectName)1D.lib + + + + + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + + + Level3 + ProgramDatabase + + + wsock32.lib;log4shib1.lib;xerces-c_3.lib;xsec_1.lib;libeay32.lib;ssleay32.lib;libcurl_imp.lib;%(AdditionalDependencies) + true + Windows + true + true + + + $(TargetDir)$(ProjectName)1.lib + + + + + X64 + + + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + + + Level3 + ProgramDatabase + + + wsock32.lib;log4shib1.lib;xerces-c_3.lib;xsec_1.lib;libeay32.lib;ssleay32.lib;libcurl_imp.lib;%(AdditionalDependencies) + true + Windows + true + true + + + $(TargetDir)$(ProjectName)1.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xmltoolingtest/.gitignore b/xmltoolingtest/.gitignore index d0c1d63..5723d2c 100644 --- a/xmltoolingtest/.gitignore +++ b/xmltoolingtest/.gitignore @@ -8,3 +8,4 @@ /Makefile.in /xmltoolingtest /x64 +/*.filters diff --git a/xmltoolingtest/ComplexXMLObjectTest.h b/xmltoolingtest/ComplexXMLObjectTest.h index e2b6e78..8068e3b 100644 --- a/xmltoolingtest/ComplexXMLObjectTest.h +++ b/xmltoolingtest/ComplexXMLObjectTest.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -35,16 +35,16 @@ public: string path=data_path + "ComplexXMLObject.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); XercesJanitor janitor(doc); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr wcObject( dynamic_cast(b->buildFromDocument(doc, false)) ); - TS_ASSERT(wcObject.get()!=NULL); + TS_ASSERT(wcObject.get()!=nullptr); VectorOf(XMLObject) kids=wcObject->getUnknownXMLObjects(); TSM_ASSERT_EQUALS("Number of child elements was not expected value", 2, kids.size()); diff --git a/xmltoolingtest/EncryptionTest.h b/xmltoolingtest/EncryptionTest.h index 38edea7..6573d4c 100644 --- a/xmltoolingtest/EncryptionTest.h +++ b/xmltoolingtest/EncryptionTest.h @@ -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. @@ -33,7 +33,7 @@ class EncryptionTest : public CxxTest::TestSuite { CredentialResolver* m_resolver; public: void setUp() { - m_resolver=NULL; + m_resolver=nullptr; string config = data_path + "FilesystemCredentialResolver.xml"; ifstream in(config.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in); @@ -53,14 +53,14 @@ public: string path=data_path + "ComplexXMLObject.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); try { CredentialCriteria cc; cc.setUsage(Credential::ENCRYPTION_CREDENTIAL); Locker locker(m_resolver); const Credential* cred=m_resolver->resolve(&cc); - TSM_ASSERT("Retrieved credential was null", cred!=NULL); + TSM_ASSERT("Retrieved credential was null", cred!=nullptr); Encrypter encrypter; Encrypter::EncryptionParams ep; diff --git a/xmltoolingtest/FilesystemCredentialResolverTest.h b/xmltoolingtest/FilesystemCredentialResolverTest.h index 4f358a8..7eb6949 100644 --- a/xmltoolingtest/FilesystemCredentialResolverTest.h +++ b/xmltoolingtest/FilesystemCredentialResolverTest.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -43,8 +43,8 @@ public: Locker locker(credResolver.get()); const X509Credential* cred=dynamic_cast(credResolver->resolve()); - TSM_ASSERT("Retrieved credential was null", cred!=NULL); - TSM_ASSERT("Retrieved key was null", cred->getPrivateKey()!=NULL); + TSM_ASSERT("Retrieved credential was null", cred!=nullptr); + TSM_ASSERT("Retrieved key was null", cred->getPrivateKey()!=nullptr); TSM_ASSERT_EQUALS("Unexpected number of certificates", 1, cred->getEntityCertificateChain().size()); TSM_ASSERT_EQUALS("Custom key name not found", 1, cred->getKeyNames().count("Sample Key")); } diff --git a/xmltoolingtest/InlineKeyResolverTest.h b/xmltoolingtest/InlineKeyResolverTest.h index 1ecaaaa..0f6a8fa 100644 --- a/xmltoolingtest/InlineKeyResolverTest.h +++ b/xmltoolingtest/InlineKeyResolverTest.h @@ -27,7 +27,7 @@ using namespace xmlsignature; class InlineKeyResolverTest : public CxxTest::TestSuite { KeyInfoResolver* m_resolver; public: - InlineKeyResolverTest() : m_resolver(NULL) {} + InlineKeyResolverTest() : m_resolver(nullptr) {} void setUp() { string config = data_path + "InlineKeyResolver.xml"; @@ -39,23 +39,23 @@ public: void tearDown() { delete m_resolver; - m_resolver=NULL; + m_resolver=nullptr; } void testResolver() { string path=data_path + "KeyInfo1.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getValidatingParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr kiObject(dynamic_cast(b->buildFromDocument(doc))); - TS_ASSERT(kiObject.get()!=NULL); + TS_ASSERT(kiObject.get()!=nullptr); auto_ptr cred(dynamic_cast(m_resolver->resolve(kiObject.get()))); - TSM_ASSERT("Unable to resolve KeyInfo into Credential.", cred.get()!=NULL); + TSM_ASSERT("Unable to resolve KeyInfo into Credential.", cred.get()!=nullptr); - TSM_ASSERT("Unable to resolve public key.", cred->getPublicKey()!=NULL); + TSM_ASSERT("Unable to resolve public key.", cred->getPublicKey()!=nullptr); TSM_ASSERT_EQUALS("Unexpected key type.", cred->getPublicKey()->getKeyType(), XSECCryptoKey::KEY_RSA_PUBLIC); TSM_ASSERT_EQUALS("Wrong certificate count.", cred->getEntityCertificateChain().size(), 1); TSM_ASSERT_EQUALS("Wrong CRL count.", cred->getCRLs().size(), 3); diff --git a/xmltoolingtest/KeyInfoTest.h b/xmltoolingtest/KeyInfoTest.h index b38790f..3ebae4c 100644 --- a/xmltoolingtest/KeyInfoTest.h +++ b/xmltoolingtest/KeyInfoTest.h @@ -38,13 +38,13 @@ public: string path=data_path + "KeyInfo1.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getValidatingParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr kiObject(dynamic_cast(b->buildFromDocument(doc))); - TS_ASSERT(kiObject.get()!=NULL); + TS_ASSERT(kiObject.get()!=nullptr); TSM_ASSERT_EQUALS("Number of child elements was not expected value", 4, kiObject->getOrderedChildren().size()); TSM_ASSERT_EQUALS("Number of child elements was not expected value", @@ -62,13 +62,13 @@ public: string path=data_path + "KeyInfo2.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getValidatingParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr kiObject(dynamic_cast(b->buildFromDocument(doc))); - TS_ASSERT(kiObject.get()!=NULL); + TS_ASSERT(kiObject.get()!=nullptr); TSM_ASSERT_EQUALS("Number of child elements was not expected value", 2, kiObject->getOrderedChildren().size()); TSM_ASSERT_EQUALS("Number of child elements was not expected value", @@ -83,13 +83,13 @@ public: string path=data_path + "KeyInfo3.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr kiObject(dynamic_cast(b->buildFromDocument(doc))); - TS_ASSERT(kiObject.get()!=NULL); + TS_ASSERT(kiObject.get()!=nullptr); TS_ASSERT_THROWS(SchemaValidators.validate(kiObject.get()),ValidationException); } }; diff --git a/xmltoolingtest/MarshallingTest.h b/xmltoolingtest/MarshallingTest.h index 823c5fd..1981093 100644 --- a/xmltoolingtest/MarshallingTest.h +++ b/xmltoolingtest/MarshallingTest.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -36,7 +36,7 @@ public: void testMarshallingWithAttributes() { auto_ptr sxObject(SimpleXMLObjectBuilder::buildSimpleXMLObject()); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); auto_ptr_XMLCh expected("Firefly"); sxObject->setId(expected.get()); @@ -45,7 +45,7 @@ public: string path=data_path + "SimpleXMLObjectWithAttribute.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); TS_ASSERT(rootElement->isEqualNode(doc->getDocumentElement())); doc->release(); @@ -53,7 +53,7 @@ public: void testMarshallingWithElementContent() { auto_ptr sxObject(SimpleXMLObjectBuilder::buildSimpleXMLObject()); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); auto_ptr_XMLCh expected("Sample Content"); sxObject->setValue(expected.get()); @@ -62,7 +62,7 @@ public: string path=data_path + "SimpleXMLObjectWithContent.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); TS_ASSERT(rootElement->isEqualNode(doc->getDocumentElement())); doc->release(); @@ -71,10 +71,10 @@ public: void testMarshallingWithChildElements() { xmltooling::QName qname(SimpleXMLObject::NAMESPACE,SimpleXMLObject::LOCAL_NAME); const SimpleXMLObjectBuilder* b=dynamic_cast(XMLObjectBuilder::getBuilder(qname)); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr sxObject(dynamic_cast(b->buildObject())); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); VectorOf(SimpleXMLObject) kids=sxObject->getSimpleXMLObjects(); kids.push_back(dynamic_cast(b->buildObject())); kids.push_back(dynamic_cast(b->buildObject())); @@ -102,7 +102,7 @@ public: string path=data_path + "SimpleXMLObjectWithChildren.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); TS_ASSERT(rootElement->isEqualNode(doc->getDocumentElement())); doc->release(); diff --git a/xmltoolingtest/MemoryStorageServiceTest.h b/xmltoolingtest/MemoryStorageServiceTest.h index 7c16f9d..509ac6d 100644 --- a/xmltoolingtest/MemoryStorageServiceTest.h +++ b/xmltoolingtest/MemoryStorageServiceTest.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -28,17 +28,17 @@ public: void testMemoryService() { auto_ptr storage( - XMLToolingConfig::getConfig().StorageServiceManager.newPlugin(MEMORY_STORAGE_SERVICE,NULL) + XMLToolingConfig::getConfig().StorageServiceManager.newPlugin(MEMORY_STORAGE_SERVICE,nullptr) ); string data; TSM_ASSERT_EQUALS("Record found in storage.", 0, storage->readString("context", "foo1", &data)); - storage->createString("context", "foo1", "bar1", time(NULL) + 60); - storage->createString("context", "foo2", "bar2", time(NULL) + 60); + storage->createString("context", "foo1", "bar1", time(nullptr) + 60); + storage->createString("context", "foo2", "bar2", time(nullptr) + 60); TSM_ASSERT_EQUALS("Record not found in storage.", 1, storage->readString("context", "foo1", &data)); TSM_ASSERT_EQUALS("Record value doesn't match.", data, "bar1"); TSM_ASSERT_EQUALS("Update failed.", 2, storage->updateString("context", "foo2", "bar1", 0, 1)); - TSM_ASSERT_EQUALS("Record not found in storage.", 2, storage->readString("context", "foo2", &data, NULL, 1)); + TSM_ASSERT_EQUALS("Record not found in storage.", 2, storage->readString("context", "foo2", &data, nullptr, 1)); TSM_ASSERT_EQUALS("Record value doesn't match.", data, "bar1"); TSM_ASSERT("Delete failed.", storage->deleteString("context", "foo2")); storage->reap("context"); diff --git a/xmltoolingtest/NonVisibleNamespaceTest.h b/xmltoolingtest/NonVisibleNamespaceTest.h index 0d4624e..e50fdf3 100644 --- a/xmltoolingtest/NonVisibleNamespaceTest.h +++ b/xmltoolingtest/NonVisibleNamespaceTest.h @@ -38,13 +38,13 @@ public: void testNamespacesAfterBuilding() { xmltooling::QName qtype(SimpleXMLObject::NAMESPACE,SimpleXMLObject::TYPE_NAME,SimpleXMLObject::NAMESPACE_PREFIX); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(qtype); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr sxObject( - dynamic_cast(b->buildObject(SimpleXMLObject::NAMESPACE, SimpleXMLObject::LOCAL_NAME, NULL, &qtype)) + dynamic_cast(b->buildObject(SimpleXMLObject::NAMESPACE, SimpleXMLObject::LOCAL_NAME, nullptr, &qtype)) ); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); static_cast(sxObject.get())->setAttribute( - xmltooling::QName(NULL, "attr1"), xmltooling::QName("http://www.example.org/testObjects/ext", "Value1", "test2") + xmltooling::QName(nullptr, "attr1"), xmltooling::QName("http://www.example.org/testObjects/ext", "Value1", "test2") ); static const XMLCh TEST2_PREFIX[] = { chLatin_t, chLatin_e, chLatin_s, chLatin_t, chDigit_2, chNull }; @@ -74,15 +74,15 @@ public: string path=data_path + "SimpleXMLObjectWithNonVisible.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr sxObject( dynamic_cast(b->buildFromDocument(doc)) ); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); const set& namespaces = sxObject->getNamespaces(); bool cond1=false, cond2=false, cond3=false; diff --git a/xmltoolingtest/SecurityHelperTest.h b/xmltoolingtest/SecurityHelperTest.h index 81f0080..4297c89 100644 --- a/xmltoolingtest/SecurityHelperTest.h +++ b/xmltoolingtest/SecurityHelperTest.h @@ -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. @@ -44,7 +44,7 @@ public: pathname = data_path + "key.der"; auto_ptr key2(SecurityHelper::loadKeyFromFile(pathname.c_str())); pathname = data_path + "test.pfx"; - auto_ptr key3(SecurityHelper::loadKeyFromFile(pathname.c_str(), NULL, "password")); + auto_ptr key3(SecurityHelper::loadKeyFromFile(pathname.c_str(), nullptr, "password")); TSM_ASSERT("PEM/DER keys did not match", SecurityHelper::matches(*key1.get(), *key2.get())); TSM_ASSERT("DER/PKCS12 keys did not match", SecurityHelper::matches(*key2.get(), *key3.get())); @@ -63,7 +63,7 @@ public: auto_ptr key2(SecurityHelper::loadKeyFromURL(*t2.get(), pathname.c_str())); pathname = data_path + "test.pfx.bak"; auto_ptr t3(getTransport("https://spaces.internet2.edu/download/attachments/5305/test.pfx")); - auto_ptr key3(SecurityHelper::loadKeyFromURL(*t3.get(), pathname.c_str(), NULL, "password")); + auto_ptr key3(SecurityHelper::loadKeyFromURL(*t3.get(), pathname.c_str(), nullptr, "password")); TSM_ASSERT("PEM/DER keys did not match", SecurityHelper::matches(*key1.get(), *key2.get())); TSM_ASSERT("DER/PKCS12 keys did not match", SecurityHelper::matches(*key2.get(), *key3.get())); @@ -75,7 +75,7 @@ public: pathname = data_path + "cert.der"; SecurityHelper::loadCertificatesFromFile(certs, pathname.c_str()); pathname = data_path + "test.pfx"; - SecurityHelper::loadCertificatesFromFile(certs, pathname.c_str(), NULL, "password"); + SecurityHelper::loadCertificatesFromFile(certs, pathname.c_str(), nullptr, "password"); TSM_ASSERT_EQUALS("Wrong certificate count", certs.size(), 3); @@ -114,7 +114,7 @@ public: SecurityHelper::loadCertificatesFromURL(certs, *t2.get(), pathname.c_str()); pathname = data_path + "test.pfx.bak"; auto_ptr t3(getTransport("https://spaces.internet2.edu/download/attachments/5305/test.pfx")); - SecurityHelper::loadCertificatesFromURL(certs, *t3.get(), pathname.c_str(), NULL, "password"); + SecurityHelper::loadCertificatesFromURL(certs, *t3.get(), pathname.c_str(), nullptr, "password"); TSM_ASSERT_EQUALS("Wrong certificate count", certs.size(), 3); diff --git a/xmltoolingtest/SignatureTest.h b/xmltoolingtest/SignatureTest.h index 93d6c3b..4e4f232 100644 --- a/xmltoolingtest/SignatureTest.h +++ b/xmltoolingtest/SignatureTest.h @@ -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. @@ -75,7 +75,7 @@ class SignatureTest : public CxxTest::TestSuite { CredentialResolver* m_resolver; public: void setUp() { - m_resolver=NULL; + m_resolver=nullptr; xmltooling::QName qname(SimpleXMLObject::NAMESPACE,SimpleXMLObject::LOCAL_NAME); xmltooling::QName qtype(SimpleXMLObject::NAMESPACE,SimpleXMLObject::TYPE_NAME); XMLObjectBuilder::registerBuilder(qname, new SimpleXMLObjectBuilder()); @@ -101,10 +101,10 @@ public: void testSignature() { xmltooling::QName qname(SimpleXMLObject::NAMESPACE,SimpleXMLObject::LOCAL_NAME); const SimpleXMLObjectBuilder* b=dynamic_cast(XMLObjectBuilder::getBuilder(qname)); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr sxObject(dynamic_cast(b->buildObject())); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); VectorOf(SimpleXMLObject) kids=sxObject->getSimpleXMLObjects(); kids.push_back(dynamic_cast(b->buildObject())); kids.push_back(dynamic_cast(b->buildObject())); @@ -124,12 +124,12 @@ public: cc.setUsage(Credential::SIGNING_CREDENTIAL); Locker locker(m_resolver); const Credential* cred = m_resolver->resolve(&cc); - TSM_ASSERT("Retrieved credential was null", cred!=NULL); + TSM_ASSERT("Retrieved credential was null", cred!=nullptr); - DOMElement* rootElement = NULL; + DOMElement* rootElement = nullptr; try { vector sigs(1,sig); - rootElement=sxObject->marshall((DOMDocument*)NULL,&sigs,cred); + rootElement=sxObject->marshall((DOMDocument*)nullptr,&sigs,cred); } catch (XMLToolingException& e) { TS_TRACE(e.what()); @@ -143,8 +143,8 @@ public: istringstream in(buf); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in); auto_ptr sxObject2(dynamic_cast(b->buildFromDocument(doc))); - TS_ASSERT(sxObject2.get()!=NULL); - TS_ASSERT(sxObject2->getSignature()!=NULL); + TS_ASSERT(sxObject2.get()!=nullptr); + TS_ASSERT(sxObject2->getSignature()!=nullptr); try { TestValidator tv(&chNull, cred); diff --git a/xmltoolingtest/UnmarshallingTest.h b/xmltoolingtest/UnmarshallingTest.h index 43c2735..b29eea7 100644 --- a/xmltoolingtest/UnmarshallingTest.h +++ b/xmltoolingtest/UnmarshallingTest.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -72,15 +72,15 @@ public: string path=data_path + "SimpleXMLObjectWithAttribute.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr sxObject( dynamic_cast(b->buildFromDocument(doc)) ); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); auto_ptr_XMLCh expected("Firefly"); TSM_ASSERT("ID was not expected value", XMLString::equals(expected.get(), sxObject->getId())); @@ -90,15 +90,15 @@ public: string path=data_path + "SimpleXMLObjectWithContent.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr sxObject( dynamic_cast(b->buildFromDocument(doc)) ); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); auto_ptr_XMLCh expected("Sample Content"); TSM_ASSERT("Element content was not expected value", XMLString::equals(expected.get(), sxObject->getValue())); @@ -108,15 +108,15 @@ public: string path=data_path + "SimpleXMLObjectWithChildren.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr sxObject( dynamic_cast(b->buildFromDocument(doc)) ); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); VectorOf(SimpleXMLObject) kids=sxObject->getSimpleXMLObjects(); TSM_ASSERT_EQUALS("Number of child elements was not expected value", 3, kids.size()); @@ -128,15 +128,15 @@ public: string path=data_path + "SimpleXMLObjectWithChildren.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr sxObject( dynamic_cast(b->buildFromDocument(doc)) ); - TS_ASSERT(sxObject.get()!=NULL); + TS_ASSERT(sxObject.get()!=nullptr); sxObject->releaseThisAndChildrenDOM(); auto_ptr clonedObject(dynamic_cast(sxObject->clone())); @@ -151,10 +151,10 @@ public: string path=data_path + "SimpleXMLObjectWithUnknownChild.xml"; ifstream fs(path.c_str()); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); const XMLObjectBuilder* b = XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); TS_ASSERT_THROWS(b->buildFromDocument(doc),UnmarshallingException); doc->release(); diff --git a/xmltoolingtest/XMLObjectBaseTestCase.h b/xmltoolingtest/XMLObjectBaseTestCase.h index 1962683..f6d6f1e 100644 --- a/xmltoolingtest/XMLObjectBaseTestCase.h +++ b/xmltoolingtest/XMLObjectBaseTestCase.h @@ -58,7 +58,7 @@ protected: : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src), m_id(XMLString::replicate(src.m_id)) { #ifndef XMLTOOLING_NO_XMLSEC - m_children.push_back(NULL); + m_children.push_back(nullptr); m_signature=m_children.begin(); #endif VectorOf(SimpleXMLObject) mine=getSimpleXMLObjects(); @@ -76,10 +76,10 @@ public: static const XMLCh ID_ATTRIB_NAME[]; SimpleXMLObject( - const XMLCh* nsURI=NULL, const XMLCh* localName=NULL, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL - ) : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_id(NULL) { + const XMLCh* nsURI=nullptr, const XMLCh* localName=nullptr, const XMLCh* prefix=nullptr, const xmltooling::QName* schemaType=nullptr + ) : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_id(nullptr) { #ifndef XMLTOOLING_NO_XMLSEC - m_children.push_back(NULL); + m_children.push_back(nullptr); m_signature=m_children.begin(); #endif } @@ -127,11 +127,11 @@ public: protected: void marshallAttributes(xercesc::DOMElement* domElement) const { if(getId()) { - domElement->setAttributeNS(NULL, SimpleXMLObject::ID_ATTRIB_NAME, getId()); + domElement->setAttributeNS(nullptr, SimpleXMLObject::ID_ATTRIB_NAME, getId()); #ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE - domElement->setIdAttributeNS(NULL, SimpleXMLObject::ID_ATTRIB_NAME, true); + domElement->setIdAttributeNS(nullptr, SimpleXMLObject::ID_ATTRIB_NAME, true); #else - domElement->setIdAttributeNS(NULL, SimpleXMLObject::ID_ATTRIB_NAME); + domElement->setIdAttributeNS(nullptr, SimpleXMLObject::ID_ATTRIB_NAME); #endif } marshallExtensionAttributes(domElement); @@ -156,7 +156,7 @@ protected: } void processAttribute(const xercesc::DOMAttr* attribute) { - if (XMLHelper::isNodeNamed(attribute, NULL, SimpleXMLObject::ID_ATTRIB_NAME)) { + if (XMLHelper::isNodeNamed(attribute, nullptr, SimpleXMLObject::ID_ATTRIB_NAME)) { setId(attribute->getValue()); return; } @@ -179,7 +179,7 @@ public: } XMLObject* buildObject( - const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const xmltooling::QName* schemaType=nullptr ) const { return new SimpleXMLObject(nsURI, localName, prefix, schemaType); } diff --git a/xmltoolingtest/xmltoolingtest.h b/xmltoolingtest/xmltoolingtest.h index 30b8622..49f73e3 100644 --- a/xmltoolingtest/xmltoolingtest.h +++ b/xmltoolingtest/xmltoolingtest.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 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. @@ -73,22 +73,22 @@ public: void testUnknown() { ifstream fs("../xmltoolingtest/data/SimpleXMLObjectWithChildren.xml"); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); string buf1; XMLHelper::serialize(doc->getDocumentElement(), buf1); const XMLObjectBuilder* b=XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr xmlObject(b->buildFromDocument(doc)); // bind document - TS_ASSERT(xmlObject.get()!=NULL); + TS_ASSERT(xmlObject.get()!=nullptr); auto_ptr clonedObject(xmlObject->clone()); - TS_ASSERT(clonedObject.get()!=NULL); + TS_ASSERT(clonedObject.get()!=nullptr); DOMElement* rootElement=clonedObject->marshall(); - TS_ASSERT(rootElement!=NULL); + TS_ASSERT(rootElement!=nullptr); // should reuse DOM TS_ASSERT(rootElement==clonedObject->marshall()); @@ -101,20 +101,20 @@ public: void testUnknownWithDocChange() { ifstream fs("../xmltoolingtest/data/SimpleXMLObjectWithChildren.xml"); DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(fs); - TS_ASSERT(doc!=NULL); + TS_ASSERT(doc!=nullptr); string buf1; XMLHelper::serialize(doc->getDocumentElement(), buf1); const XMLObjectBuilder* b=XMLObjectBuilder::getBuilder(doc->getDocumentElement()); - TS_ASSERT(b!=NULL); + TS_ASSERT(b!=nullptr); auto_ptr xmlObject(b->buildFromDocument(doc)); // bind document - TS_ASSERT(xmlObject.get()!=NULL); + TS_ASSERT(xmlObject.get()!=nullptr); DOMDocument* newDoc=XMLToolingConfig::getConfig().getParser().newDocument(); DOMElement* rootElement=xmlObject->marshall(newDoc); - TS_ASSERT(rootElement!=NULL); + TS_ASSERT(rootElement!=nullptr); string buf2; XMLHelper::serialize(rootElement, buf2); diff --git a/xmltoolingtest/xmltoolingtest.vcxproj b/xmltoolingtest/xmltoolingtest.vcxproj new file mode 100644 index 0000000..ee7e33d --- /dev/null +++ b/xmltoolingtest/xmltoolingtest.vcxproj @@ -0,0 +1,404 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {3E34CDCC-FCBA-490D-A165-1CB6F4559799} + xmltoolingtest + Win32Proj + + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + $(SolutionDir);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + Level3 + EditAndContinue + + + xerces-c_3D.lib;xsec_1D.lib;%(AdditionalDependencies) + true + Console + false + + + MachineX86 + + + + + X64 + + + Disabled + $(SolutionDir);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + Level3 + ProgramDatabase + + + xerces-c_3D.lib;xsec_1D.lib;%(AdditionalDependencies) + true + Console + + + + + + + $(SolutionDir);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + ProgramDatabase + + + xerces-c_3.lib;xsec_1.lib;%(AdditionalDependencies) + true + Console + true + true + false + + + MachineX86 + + + + + X64 + + + $(SolutionDir);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + ProgramDatabase + + + xerces-c_3.lib;xsec_1.lib;%(AdditionalDependencies) + true + Console + true + true + + + + + + + + + + + + + + + + + + + + + + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + perl.exe -w \cxxtest\cxxtestgen.pl --error-printer --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --error-printer --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --error-printer --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + perl.exe -w \cxxtest\cxxtestgen.pl --error-printer --have-eh --have-std --abort-on-fail -o "%(Filename)".cpp "%(FullPath)" + + %(Filename).cpp;%(Outputs) + + + + + + + + + {06b55a46-d3b3-41ae-b5a5-b57830ba010d} + false + + + + + + \ No newline at end of file