Reducing header overuse, non-inlining selected methods (CPPOST-35).
authorScott Cantor <cantor.2@osu.edu>
Mon, 12 Oct 2009 21:58:41 +0000 (21:58 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 12 Oct 2009 21:58:41 +0000 (21:58 +0000)
112 files changed:
.cproject
xmltooling/AbstractAttributeExtensibleXMLObject.cpp
xmltooling/AbstractAttributeExtensibleXMLObject.h
xmltooling/AbstractComplexElement.cpp
xmltooling/AbstractComplexElement.h
xmltooling/AbstractDOMCachingXMLObject.cpp
xmltooling/AbstractDOMCachingXMLObject.h
xmltooling/AbstractSimpleElement.cpp
xmltooling/AbstractSimpleElement.h
xmltooling/AbstractXMLObject.cpp
xmltooling/AbstractXMLObject.h
xmltooling/AttributeExtensibleXMLObject.h
xmltooling/ConcreteXMLObjectBuilder.h
xmltooling/ElementExtensibleXMLObject.h
xmltooling/ElementProxy.h
xmltooling/Lockable.cpp [new file with mode: 0644]
xmltooling/Lockable.h
xmltooling/Makefile.am
xmltooling/XMLObject.h
xmltooling/XMLObjectBuilder.cpp
xmltooling/XMLObjectBuilder.h
xmltooling/XMLToolingConfig.cpp
xmltooling/XMLToolingConfig.h
xmltooling/encryption/Decrypter.h
xmltooling/encryption/EncryptedKeyResolver.h
xmltooling/encryption/Encrypter.h
xmltooling/encryption/Encryption.h
xmltooling/encryption/impl/Decrypter.cpp
xmltooling/encryption/impl/EncryptedKeyResolver.cpp
xmltooling/encryption/impl/Encrypter.cpp
xmltooling/encryption/impl/EncryptionImpl.cpp
xmltooling/encryption/impl/EncryptionSchemaValidators.cpp
xmltooling/impl/AnyElement.cpp
xmltooling/impl/AnyElement.h
xmltooling/impl/UnknownElement.cpp
xmltooling/impl/UnknownElement.h
xmltooling/io/AbstractXMLObjectMarshaller.cpp
xmltooling/io/AbstractXMLObjectMarshaller.h
xmltooling/io/AbstractXMLObjectUnmarshaller.cpp
xmltooling/io/AbstractXMLObjectUnmarshaller.h
xmltooling/io/GenericRequest.h
xmltooling/io/GenericResponse.h
xmltooling/io/HTTPRequest.cpp
xmltooling/io/HTTPRequest.h
xmltooling/io/HTTPResponse.cpp
xmltooling/io/HTTPResponse.h
xmltooling/security/AbstractPKIXTrustEngine.h
xmltooling/security/BasicX509Credential.h
xmltooling/security/ChainingTrustEngine.h
xmltooling/security/Credential.h
xmltooling/security/CredentialContext.h
xmltooling/security/CredentialCriteria.h
xmltooling/security/CredentialResolver.h
xmltooling/security/KeyInfoCredentialContext.h
xmltooling/security/KeyInfoResolver.h
xmltooling/security/OpenSSLCredential.h
xmltooling/security/OpenSSLCryptoX509CRL.h
xmltooling/security/OpenSSLTrustEngine.h
xmltooling/security/SecurityHelper.h
xmltooling/security/SignatureTrustEngine.h
xmltooling/security/TrustEngine.h
xmltooling/security/X509Credential.h
xmltooling/security/X509TrustEngine.h
xmltooling/security/XSECCryptoX509CRL.h
xmltooling/security/impl/AbstractPKIXTrustEngine.cpp
xmltooling/security/impl/BasicX509Credential.cpp
xmltooling/security/impl/CredentialCriteria.cpp
xmltooling/security/impl/CredentialResolver.cpp
xmltooling/security/impl/FilesystemCredentialResolver.cpp
xmltooling/security/impl/InlineKeyResolver.cpp
xmltooling/security/impl/KeyInfoResolver.cpp
xmltooling/security/impl/OpenSSLCryptoX509CRL.cpp
xmltooling/security/impl/TrustEngine.cpp
xmltooling/security/impl/XSECCryptoX509CRL.cpp
xmltooling/signature/ContentReference.h
xmltooling/signature/Signature.h
xmltooling/signature/SignatureValidator.h
xmltooling/signature/impl/KeyInfoSchemaValidators.cpp
xmltooling/signature/impl/SignatureValidator.cpp
xmltooling/signature/impl/XMLSecSignatureImpl.cpp
xmltooling/soap/HTTPSOAPTransport.h
xmltooling/soap/OpenSSLSOAPTransport.h
xmltooling/soap/SOAP.h
xmltooling/soap/SOAPClient.h
xmltooling/soap/SOAPTransport.h
xmltooling/soap/impl/CURLSOAPTransport.cpp
xmltooling/soap/impl/SOAPClient.cpp
xmltooling/soap/impl/SOAPSchemaValidators.cpp
xmltooling/util/DateTime.cpp
xmltooling/util/DateTime.h
xmltooling/util/ParserPool.cpp
xmltooling/util/ParserPool.h
xmltooling/util/PathResolver.cpp
xmltooling/util/PathResolver.h
xmltooling/util/ReloadableXMLFile.cpp
xmltooling/util/ReplayCache.cpp
xmltooling/util/ReplayCache.h
xmltooling/util/StorageService.cpp
xmltooling/util/StorageService.h
xmltooling/util/TemplateEngine.cpp
xmltooling/util/TemplateEngine.h
xmltooling/util/URLEncoder.cpp
xmltooling/util/URLEncoder.h
xmltooling/util/XMLHelper.cpp
xmltooling/util/XMLHelper.h
xmltooling/validation/Validator.h
xmltooling/validation/ValidatorSuite.cpp
xmltooling/validation/ValidatorSuite.h
xmltooling/xmltooling-lite.vcproj
xmltooling/xmltooling.vcproj
xmltoolingtest/EncryptionTest.h
xmltoolingtest/InlineKeyResolverTest.h

index f481b92..8e67507 100644 (file)
--- a/.cproject
+++ b/.cproject
@@ -1,7 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
-<?fileVersion 4.0.0?>\r
-\r
-<cproject>\r
+<?xml version="1.0" encoding="UTF-8"?><?fileVersion 4.0.0?><cproject>\r
 <storageModule moduleId="org.eclipse.cdt.core.settings">\r
 <cconfiguration id="converted.config.943130369">\r
 <storageModule moduleId="scannerConfiguration">\r
@@ -68,7 +65,7 @@
 <storageModule moduleId="org.eclipse.cdt.core.pathentry">\r
 <pathentry include="C:/log4shib-1.0.2/include" kind="inc" path="" system="true"/>\r
 <pathentry include="C:/xerces-c-3.0.1-x86-windows-vc-9.0/include" kind="inc" path="" system="true"/>\r
-<pathentry include="C:/xml-security-c-1.5.0/include" kind="inc" path="" system="true"/>\r
+<pathentry include="C:/xml-security-c-1.5.1/include" kind="inc" path="" system="true"/>\r
 <pathentry include="C:/openssl-0.9.8k/inc32" kind="inc" path="" system="true"/>\r
 <pathentry include="C:/curl-7.19.5/include" kind="inc" path="" system="true"/>\r
 <pathentry include="C:/cxxtest" kind="inc" path="" system="true"/>\r
index b24ee87..eae509f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +22,8 @@
 
 #include "internal.h"
 #include "AbstractAttributeExtensibleXMLObject.h"
+#include "ElementExtensibleXMLObject.h"
+#include "ElementProxy.h"
 
 #include <algorithm>
 #include <functional>
@@ -33,12 +35,60 @@ using xercesc::DOMAttr;
 using xercesc::DOMElement;
 using xercesc::XMLString;
 
+ElementExtensibleXMLObject::ElementExtensibleXMLObject()
+{
+}
+
+ElementExtensibleXMLObject::~ElementExtensibleXMLObject()
+{
+}
+
+ElementProxy::ElementProxy()
+{
+}
+
+ElementProxy::~ElementProxy()
+{
+}
+
 set<QName> AttributeExtensibleXMLObject::m_idAttributeSet;
 
-AbstractAttributeExtensibleXMLObject::~AbstractAttributeExtensibleXMLObject()
+AttributeExtensibleXMLObject::AttributeExtensibleXMLObject()
 {
-    for (map<QName,XMLCh*>::iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++)
-        XMLString::release(&(i->second));
+}
+
+AttributeExtensibleXMLObject::~AttributeExtensibleXMLObject()
+{
+}
+
+const set<QName>& AttributeExtensibleXMLObject::getRegisteredIDAttributes()
+{
+    return m_idAttributeSet;
+}
+
+bool AttributeExtensibleXMLObject::isRegisteredIDAttribute(const QName& name)
+{
+    return m_idAttributeSet.find(name)!=m_idAttributeSet.end();
+}
+
+void AttributeExtensibleXMLObject::registerIDAttribute(const QName& name)
+{
+    m_idAttributeSet.insert(name);
+}
+
+void AttributeExtensibleXMLObject::deregisterIDAttribute(const QName& name)
+{
+    m_idAttributeSet.erase(name);
+}
+
+void AttributeExtensibleXMLObject::deregisterIDAttributes()
+{
+    m_idAttributeSet.clear();
+}
+
+AbstractAttributeExtensibleXMLObject::AbstractAttributeExtensibleXMLObject()
+{
+    m_idAttribute = m_attributeMap.end();
 }
 
 AbstractAttributeExtensibleXMLObject::AbstractAttributeExtensibleXMLObject(const AbstractAttributeExtensibleXMLObject& src)
@@ -53,6 +103,18 @@ AbstractAttributeExtensibleXMLObject::AbstractAttributeExtensibleXMLObject(const
     }
 }
 
+AbstractAttributeExtensibleXMLObject::~AbstractAttributeExtensibleXMLObject()
+{
+    for (map<QName,XMLCh*>::iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++)
+        XMLString::release(&(i->second));
+}
+
+const XMLCh* AbstractAttributeExtensibleXMLObject::getAttribute(const QName& qualifiedName) const
+{
+    map<QName,XMLCh*>::const_iterator i=m_attributeMap.find(qualifiedName);
+    return (i==m_attributeMap.end()) ? NULL : i->second;
+}
+
 void AbstractAttributeExtensibleXMLObject::setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID)
 {
     map<QName,XMLCh*>::iterator i=m_attributeMap.find(qualifiedName);
@@ -78,6 +140,15 @@ void AbstractAttributeExtensibleXMLObject::setAttribute(const QName& qualifiedNa
     }
 }
 
+const map<QName,XMLCh*>& AbstractAttributeExtensibleXMLObject::getExtensionAttributes() const
+{
+    return m_attributeMap;
+}
+const XMLCh* AbstractAttributeExtensibleXMLObject::getXMLID() const
+{
+    return (m_idAttribute == m_attributeMap.end()) ? NULL : m_idAttribute->second;
+}
+
 void AbstractAttributeExtensibleXMLObject::unmarshallExtensionAttribute(const DOMAttr* attribute)
 {
     QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
index 9698e5b..0429461 100644 (file)
@@ -45,25 +45,14 @@ namespace xmltooling {
     public:
         virtual ~AbstractAttributeExtensibleXMLObject();
         
-        const XMLCh* getAttribute(const QName& qualifiedName) const {
-            std::map<QName,XMLCh*>::const_iterator i=m_attributeMap.find(qualifiedName);
-            return (i==m_attributeMap.end()) ? NULL : i->second;
-        }
-        
+        // Virtual function overrides.
+        const XMLCh* getAttribute(const QName& qualifiedName) const;
         void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false);
-    
-        const std::map<QName,XMLCh*>& getExtensionAttributes() const {
-            return m_attributeMap;
-        }
-        
-        const XMLCh* getXMLID() const {
-            return (m_idAttribute == m_attributeMap.end()) ? NULL : m_idAttribute->second;
-        }
+        const std::map<QName,XMLCh*>& getExtensionAttributes() const;
+        const XMLCh* getXMLID() const;
     
      protected:
-        AbstractAttributeExtensibleXMLObject() {
-            m_idAttribute = m_attributeMap.end();
-        }
+        AbstractAttributeExtensibleXMLObject();
 
         /** Copy constructor. */
         AbstractAttributeExtensibleXMLObject(const AbstractAttributeExtensibleXMLObject& src);
index 6f6f9f1..ea08e19 100644 (file)
@@ -36,6 +36,16 @@ namespace {
     }
 }
 
+AbstractComplexElement::AbstractComplexElement()
+{
+}
+
+AbstractComplexElement::AbstractComplexElement(const AbstractComplexElement& src)
+{
+    for (vector<XMLCh*>::const_iterator i=src.m_text.begin(); i!=src.m_text.end(); ++i)
+        m_text.push_back(XMLString::replicate(*i));
+}
+
 AbstractComplexElement::~AbstractComplexElement() {
     for_each(m_children.begin(), m_children.end(), cleanup<XMLObject>());
     for (vector<XMLCh*>::iterator i=m_text.begin(); i!=m_text.end(); ++i)
@@ -49,15 +59,19 @@ bool AbstractComplexElement::hasChildren() const
     return (find_if(m_children.begin(), m_children.end(), _nonnull) != m_children.end());
 }
 
+const list<XMLObject*>& AbstractComplexElement::getOrderedChildren() const
+{
+    return m_children;
+}
+
 void AbstractComplexElement::removeChild(XMLObject* child)
 {
     m_children.erase(remove(m_children.begin(), m_children.end(), child), m_children.end());
 }
 
-AbstractComplexElement::AbstractComplexElement(const AbstractComplexElement& src)
+const XMLCh* AbstractComplexElement::getTextContent(unsigned int position) const
 {
-    for (vector<XMLCh*>::const_iterator i=src.m_text.begin(); i!=src.m_text.end(); ++i)
-        m_text.push_back(XMLString::replicate(*i));
+    return (m_text.size() > position) ? m_text[position] : NULL;
 }
 
 void AbstractComplexElement::setTextContent(const XMLCh* value, unsigned int position)
index cf88200..9f8c24d 100644 (file)
@@ -40,23 +40,16 @@ namespace xmltooling {
     {
     public:
         virtual ~AbstractComplexElement();
-        
-        bool hasChildren() const;
-
-        const std::list<XMLObject*>& getOrderedChildren() const {
-            return m_children;
-        }
 
+        // Virtual function overrides.
+        bool hasChildren() const;
+        const std::list<XMLObject*>& getOrderedChildren() const;
         void removeChild(XMLObject* child);
-
-        const XMLCh* getTextContent(unsigned int position=0) const {
-            return (m_text.size() > position) ? m_text[position] : NULL; 
-        }
-        
+        const XMLCh* getTextContent(unsigned int position=0) const;
         void setTextContent(const XMLCh* value, unsigned int position=0);
 
     protected:
-        AbstractComplexElement() {}
+        AbstractComplexElement();
         
         /** Copy constructor. */
         AbstractComplexElement(const AbstractComplexElement& src);
index b8d3b42..476eccd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,12 +33,26 @@ using namespace xmltooling;
 using namespace xercesc;
 using namespace std;
 
+AbstractDOMCachingXMLObject::AbstractDOMCachingXMLObject() : m_dom(NULL), m_document(NULL)
+{
+}
+
+AbstractDOMCachingXMLObject::AbstractDOMCachingXMLObject(const AbstractDOMCachingXMLObject& src)
+    : AbstractXMLObject(src), m_dom(NULL), m_document(NULL)
+{
+}
+
 AbstractDOMCachingXMLObject::~AbstractDOMCachingXMLObject()
 {
     if (m_document)
         m_document->release();
 }
 
+DOMElement* AbstractDOMCachingXMLObject::getDOM() const
+{
+    return m_dom;
+}
+
 void AbstractDOMCachingXMLObject::setDOM(DOMElement* dom, bool bindDocument) const
 {
     m_dom=dom;
@@ -49,6 +63,13 @@ void AbstractDOMCachingXMLObject::setDOM(DOMElement* dom, bool bindDocument) con
     }
 }
 
+void AbstractDOMCachingXMLObject::setDocument(DOMDocument* doc) const
+{
+    if (m_document)
+        m_document->release();
+    m_document=doc;
+}
+
 void AbstractDOMCachingXMLObject::releaseDOM() const
 {
     if (m_dom) {
index 125ef79..6f78d98 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,35 +40,22 @@ namespace xmltooling {
     {
     public:
         virtual ~AbstractDOMCachingXMLObject();
-        
-        xercesc::DOMElement* getDOM() const {
-            return m_dom;
-        }
-        
+
+        // Virtual function overrides.
+        xercesc::DOMElement* getDOM() const;
         void setDOM(xercesc::DOMElement* dom, bool bindDocument=false) const;
-        
-        void setDocument(xercesc::DOMDocument* doc) const {
-            if (m_document)
-                m_document->release();
-            m_document=doc;
-        }
-    
-        virtual void releaseDOM() const;
-        
-        virtual void releaseParentDOM(bool propagateRelease=true) const;
-        
-        virtual void releaseChildrenDOM(bool propagateRelease=true) const;
-    
+        void setDocument(xercesc::DOMDocument* doc) const;
+        void releaseDOM() const;
+        void releaseParentDOM(bool propagateRelease=true) const;
+        void releaseChildrenDOM(bool propagateRelease=true) const;
         XMLObject* clone() const;
-
         void detach();
 
      protected:
-        AbstractDOMCachingXMLObject() : m_dom(NULL), m_document(NULL) {}
+        AbstractDOMCachingXMLObject();
 
         /** Copy constructor. */
-        AbstractDOMCachingXMLObject(const AbstractDOMCachingXMLObject& src)
-            : AbstractXMLObject(src), m_dom(NULL), m_document(NULL) {}
+        AbstractDOMCachingXMLObject(const AbstractDOMCachingXMLObject& src);
 
         /**
          * If a DOM representation exists, this clones it into a new document.
index 1276d4b..43003dd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include "AbstractSimpleElement.h"
 
 using namespace xmltooling;
+using xercesc::XMLString;
 using namespace std;
 
 // shared "empty" list of children for childless objects
 
 list<XMLObject*> AbstractSimpleElement::m_no_children;
 
+AbstractSimpleElement::AbstractSimpleElement() : m_value(NULL)
+{
+}
+
+AbstractSimpleElement::AbstractSimpleElement(const AbstractSimpleElement& src)
+    : AbstractXMLObject(src), m_value(XMLString::replicate(src.m_value))
+{
+}
+
+AbstractSimpleElement::~AbstractSimpleElement()
+{
+    XMLString::release(&m_value);
+}
+
+bool AbstractSimpleElement::hasChildren() const
+{
+    return false;
+}
+
+const list<XMLObject*>& AbstractSimpleElement::getOrderedChildren() const
+{
+    return m_no_children;
+}
+
 void AbstractSimpleElement::removeChild(XMLObject* child)
 {
     throw XMLObjectException("Cannot remove child from a childless object.");
 }
+
+const XMLCh* AbstractSimpleElement::getTextContent(unsigned int position) const
+{
+    return (position==0) ? m_value : NULL;
+}
+
+void AbstractSimpleElement::setTextContent(const XMLCh* value, unsigned int position)
+{
+    if (position > 0)
+        throw XMLObjectException("Cannot set text content in simple element at position > 0.");
+    m_value=prepareForAssignment(m_value,value);
+}
index 461b1cc..2abf232 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,36 +39,20 @@ namespace xmltooling {
     class XMLTOOL_API AbstractSimpleElement : public virtual AbstractXMLObject
     {
     public:
-        virtual ~AbstractSimpleElement() {
-            xercesc::XMLString::release(&m_value);
-        }
+        virtual ~AbstractSimpleElement();
         
-        bool hasChildren() const {
-            return false;
-        }
-
-        const std::list<XMLObject*>& getOrderedChildren() const {
-            return m_no_children;
-        }
-
+        // Virtual function overrides.
+        bool hasChildren() const;
+        const std::list<XMLObject*>& getOrderedChildren() const;
         void removeChild(XMLObject* child);
-
-        virtual const XMLCh* getTextContent(unsigned int position=0) const {
-            return (position==0) ? m_value : NULL;
-        }
-        
-        virtual void setTextContent(const XMLCh* value, unsigned int position=0) {
-            if (position > 0)
-                throw XMLObjectException("Cannot set text content in simple element at position > 0.");
-            m_value=prepareForAssignment(m_value,value);
-        }
+        const XMLCh* getTextContent(unsigned int position=0) const;
+        void setTextContent(const XMLCh* value, unsigned int position=0);
         
     protected:
-        AbstractSimpleElement() : m_value(NULL) {}
+        AbstractSimpleElement();
         
         /** Copy constructor. */
-        AbstractSimpleElement(const AbstractSimpleElement& src)
-            : AbstractXMLObject(src), m_value(xercesc::XMLString::replicate(src.m_value)) {}
+        AbstractSimpleElement(const AbstractSimpleElement& src);
 
     private:
         XMLCh* m_value;
index 1a51a44..491aaa8 100644 (file)
  */
 
 #include "internal.h"
-#include "AbstractXMLObject.h"
 #include "exceptions.h"
+#include "AbstractXMLObject.h"
+#include "util/DateTime.h"
 
 #include <algorithm>
 
 using namespace xmltooling;
+using std::set;
 
 using xercesc::XMLString;
 
+XMLObject::XMLObject()
+{
+}
+
+XMLObject::~XMLObject()
+{
+}
+
+void XMLObject::releaseThisandParentDOM() const
+{
+    if (getDOM()) {
+        releaseDOM();
+        releaseParentDOM(true);
+    }
+}
+
+void XMLObject::releaseThisAndChildrenDOM() const
+{
+    if (getDOM()) {
+        releaseChildrenDOM(true);
+        releaseDOM();
+    }
+}
+
 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),
@@ -58,6 +84,29 @@ AbstractXMLObject::~AbstractXMLObject()
     xercesc::XMLString::release(&m_noNamespaceSchemaLocation);
 }
 
+void AbstractXMLObject::detach()
+{
+    if (!getParent())
+        return;
+    else if (getParent()->hasParent())
+        throw XMLObjectException("Cannot detach an object whose parent is itself a child.");
+
+    // Pull ourselves out of the parent and then blast him.
+    getParent()->removeChild(this);
+    delete m_parent;
+    m_parent = NULL;
+}
+
+const QName& AbstractXMLObject::getElementQName() const
+{
+    return m_elementQname;
+}
+
+const set<Namespace>& AbstractXMLObject::getNamespaces() const
+{
+    return m_namespaces;
+}
+
 void XMLObject::setNil(const XMLCh* value)
 {
     if (value) {
@@ -92,6 +141,49 @@ void AbstractXMLObject::addNamespace(const Namespace& ns) const
         const_cast<Namespace&>(*i).setAlwaysDeclare(true);
 }
 
+void AbstractXMLObject::removeNamespace(const Namespace& ns)
+{
+    m_namespaces.erase(ns);
+}
+
+const QName* AbstractXMLObject::getSchemaType() const
+{
+    return m_typeQname;
+}
+
+const XMLCh* AbstractXMLObject::getXMLID() const
+{
+    return NULL;
+}
+
+xmlconstants::xmltooling_bool_t AbstractXMLObject::getNil() const
+{
+    return m_nil;
+}
+
+void AbstractXMLObject::nil(xmlconstants::xmltooling_bool_t value)
+{
+    if (m_nil != value) {
+        releaseThisandParentDOM();
+        m_nil = value;
+    }
+}
+
+bool AbstractXMLObject::hasParent() const
+{
+    return m_parent != NULL;
+}
+
+XMLObject* AbstractXMLObject::getParent() const
+{
+    return m_parent;
+}
+
+void AbstractXMLObject::setParent(XMLObject* parent)
+{
+    m_parent = parent;
+}
+
 XMLCh* AbstractXMLObject::prepareForAssignment(XMLCh* oldValue, const XMLCh* newValue)
 {
     if (!XMLString::equals(oldValue,newValue)) {
@@ -186,16 +278,3 @@ XMLObject* AbstractXMLObject::prepareForAssignment(XMLObject* oldValue, XMLObjec
 
     return newValue;
 }
-
-void AbstractXMLObject::detach()
-{
-    if (!getParent())
-        return;
-    else if (getParent()->hasParent())
-        throw XMLObjectException("Cannot detach an object whose parent is itself a child.");
-
-    // Pull ourselves out of the parent and then blast him.
-    getParent()->removeChild(this);
-    delete m_parent;
-    m_parent = NULL;
-}
index 9d6319e..b7b22dc 100644 (file)
@@ -24,8 +24,8 @@
 #define __xmltooling_abstractxmlobj_h__
 
 #include <xmltooling/logging.h>
+#include <xmltooling/QName.h>
 #include <xmltooling/XMLObject.h>
-#include <xmltooling/util/DateTime.h>
 
 #if defined (_MSC_VER)
     #pragma warning( push )
@@ -34,6 +34,8 @@
 
 namespace xmltooling {
 
+    class XMLTOOL_API DateTime;
+
     /**
      * An abstract implementation of XMLObject.
      * This is the primary concrete base class, and supplies basic namespace,
@@ -46,52 +48,19 @@ namespace xmltooling {
     public:
         virtual ~AbstractXMLObject();
 
+        // Virtual function overrides.
         void detach();
-
-        const QName& getElementQName() const {
-            return m_elementQname;
-        }
-
-        const std::set<Namespace>& getNamespaces() const {
-            return m_namespaces;
-        }
-
+        const QName& getElementQName() const;
+        const std::set<Namespace>& getNamespaces() const;
         void addNamespace(const Namespace& ns) const;
-
-        void removeNamespace(const Namespace& ns) {
-            m_namespaces.erase(ns);
-        }
-
-        const QName* getSchemaType() const {
-            return m_typeQname;
-        }
-
-        const XMLCh* getXMLID() const {
-            return NULL;
-        }
-
-        xmlconstants::xmltooling_bool_t getNil() const {
-               return m_nil;
-        }
-
-        void nil(xmlconstants::xmltooling_bool_t value) {
-            if (m_nil != value) {
-               releaseThisandParentDOM();
-               m_nil = value;
-            }
-        }
-
-        bool hasParent() const {
-            return m_parent != NULL;
-        }
-
-        XMLObject* getParent() const {
-            return m_parent;
-        }
-
-        void setParent(XMLObject* parent) {
-            m_parent = parent;
-        }
+        void removeNamespace(const Namespace& ns);
+        const QName* getSchemaType() const;
+        const XMLCh* getXMLID() const;
+        xmlconstants::xmltooling_bool_t getNil() const;
+        void nil(xmlconstants::xmltooling_bool_t value);
+        bool hasParent() const;
+        XMLObject* getParent() const;
+        void setParent(XMLObject* parent);
 
      protected:
         /**
index d839e3a..08eff0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,10 +38,10 @@ namespace xmltooling {
     class XMLTOOL_API AttributeExtensibleXMLObject : public virtual XMLObject
     {
     protected:
-        AttributeExtensibleXMLObject() {}
+        AttributeExtensibleXMLObject();
         
     public:
-        virtual ~AttributeExtensibleXMLObject() {}
+        virtual ~AttributeExtensibleXMLObject();
         
         /**
          * Gets the value of an XML attribute of the object.
@@ -73,43 +73,33 @@ namespace xmltooling {
          * 
          * @return list of all the ID attributes currently registered
          */
-        static const std::set<QName>& getRegisteredIDAttributes() {
-            return m_idAttributeSet;
-        }
+        static const std::set<QName>& getRegisteredIDAttributes();
         
         /**
          * Tests whether an XML attribute is registered as an XML ID.
          * 
          * @return true iff the attribute name matches a registered XML ID attribute 
          */
-        static bool isRegisteredIDAttribute(const QName& name) {
-            return m_idAttributeSet.find(name)!=m_idAttributeSet.end();
-        }
+        static bool isRegisteredIDAttribute(const QName& name);
     
         /**
          * Registers a new attribute as being of XML ID type.
          * 
          * @param name the qualified attribute name
          */
-        static void registerIDAttribute(const QName& name) {
-            m_idAttributeSet.insert(name);
-        }
+        static void registerIDAttribute(const QName& name);
 
         /**
          * Deregisters an ID attribute.
          * 
          * @param name the qualified attribute name
          */
-        static void deregisterIDAttribute(const QName& name) {
-            m_idAttributeSet.erase(name);
-        }
+        static void deregisterIDAttribute(const QName& name);
         
         /**
          * Deregisters all ID attributes.
          */
-        static void deregisterIDAttributes() {
-            m_idAttributeSet.clear();
-        }
+        static void deregisterIDAttributes();
 
     private:
         /** Set of attributes to treat as XML IDs. */
index 40da9e0..be6f101 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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 @@ namespace xmltooling {
     class XMLTOOL_API ConcreteXMLObjectBuilder : public XMLObjectBuilder
     {
     public:
-        virtual ~ConcreteXMLObjectBuilder() {}
+        virtual ~ConcreteXMLObjectBuilder();
 
         using XMLObjectBuilder::buildObject;
         
@@ -46,7 +46,7 @@ namespace xmltooling {
         virtual XMLObject* buildObject() const=0;
 
     protected:
-        ConcreteXMLObjectBuilder() {}
+        ConcreteXMLObjectBuilder();
     };
 
 };
index df31b5b..eb1097c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,10 +39,10 @@ namespace xmltooling {
     class XMLTOOL_API ElementExtensibleXMLObject : public virtual XMLObject
     {
     protected:
-        ElementExtensibleXMLObject() {}
+        ElementExtensibleXMLObject();
     
     public:
-        virtual ~ElementExtensibleXMLObject() {}
+        virtual ~ElementExtensibleXMLObject();
         
         /**
          * Gets a mutable list of child objects
index 8c814b3..1dee1a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@ namespace xmltooling {
     class XMLTOOL_API ElementProxy : public virtual AttributeExtensibleXMLObject, public virtual ElementExtensibleXMLObject
     {
     protected:
-        ElementProxy() {}
+        ElementProxy();
 
     public:
-        virtual ~ElementProxy() {}
+        virtual ~ElementProxy();
     };
     
 };
diff --git a/xmltooling/Lockable.cpp b/xmltooling/Lockable.cpp
new file mode 100644 (file)
index 0000000..4d9c5a4
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ *  Copyright 2009 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Lockable.cpp
+ * 
+ * Locking abstraction.
+ */
+
+#include "internal.h"
+#include "Lockable.h"
+
+using namespace xmltooling;
+
+Lockable::Lockable()
+{
+}
+
+Lockable::~Lockable()
+{
+}
+        
+Locker::Locker(Lockable* lockee, bool lock)
+{
+    if (lockee && lock)
+        m_lockee=lockee->lock();
+    else
+        m_lockee=lockee;
+}
+
+void Locker::assign(Lockable* lockee, bool lock)
+{
+    if (m_lockee)
+        m_lockee->unlock();
+    m_lockee=NULL;
+    if (lockee && lock)
+        m_lockee=lockee->lock();
+    else
+        m_lockee=lockee;
+}
+
+Locker::~Locker()
+{
+    if (m_lockee)
+        m_lockee->unlock();
+}
index 629c046..a244d2d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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/Lockable.h
  * 
- * Locking abstraction 
+ * Locking abstraction.
  */
 
 #ifndef __xmltooling_lockable_h__
@@ -30,9 +30,12 @@ namespace xmltooling {
     /**
      * Abstract mixin interface for interfaces that support locking
      */
-    struct XMLTOOL_API Lockable
+    class XMLTOOL_API Lockable
     {
-        virtual ~Lockable() {}
+    protected:
+        Lockable();
+    public:
+        virtual ~Lockable();
         
         /**
          * Lock the associated object for exclusive access.
@@ -60,12 +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) {
-            if (lockee && lock)
-                m_lockee=lockee->lock();
-            else
-                m_lockee=lockee;
-        }
+        Locker(Lockable* lockee=NULL, bool lock=true);
 
         /**
          * Optionally locks an object and stores it for later release.
@@ -74,23 +72,12 @@ 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) {
-            if (m_lockee)
-                m_lockee->unlock();
-            m_lockee=NULL;
-            if (lockee && lock)
-                m_lockee=lockee->lock();
-            else
-                m_lockee=lockee;
-        }
+        void assign(Lockable* lockee=NULL, bool lock=true);
         
         /**
          * Destructor releases lock on held pointer, if any.
          */
-        ~Locker() {
-            if (m_lockee)
-                m_lockee->unlock();
-         }
+        ~Locker();
         
     private:
         Lockable* m_lockee;
index 9ce25a4..374cf1b 100644 (file)
@@ -168,6 +168,7 @@ common_sources = \
        AbstractSimpleElement.cpp \
        AbstractXMLObject.cpp \
        exceptions.cpp \
+       Lockable.cpp \
        Namespace.cpp \
        QName.cpp \
        unicode.cpp \
index 85f7054..d61ac84 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@
 #ifndef __xmltooling_xmlobj_h__
 #define __xmltooling_xmlobj_h__
 
-#include <xmltooling/QName.h>
 #include <xmltooling/Namespace.h>
 #include <xmltooling/util/XMLConstants.h>
 
@@ -48,6 +47,7 @@ namespace xmltooling {
 #ifndef XMLTOOLING_NO_XMLSEC
     class XMLTOOL_API Credential;
 #endif
+    class XMLTOOL_API QName;
 
     /**
      * Object that represents an XML Element that has been unmarshalled into this C++ object.
@@ -55,7 +55,7 @@ namespace xmltooling {
     class XMLTOOL_API XMLObject
     {
     public:
-        virtual ~XMLObject() {}
+        virtual ~XMLObject();
         
         /**
          * Creates a copy of the object, along with all of its children.
@@ -284,22 +284,12 @@ namespace xmltooling {
         /**
          * A convenience method that is equal to calling releaseDOM() then releaseParentDOM(true).
          */
-        void releaseThisandParentDOM() const {
-            if (getDOM()) {
-                releaseDOM();
-                releaseParentDOM(true);
-            }
-        }
+        void releaseThisandParentDOM() const;
     
         /**
          * A convenience method that is equal to calling releaseChildrenDOM(true) then releaseDOM().
          */
-        void releaseThisAndChildrenDOM() const {
-            if (getDOM()) {
-                releaseChildrenDOM(true);
-                releaseDOM();
-            }
-        }
+        void releaseThisAndChildrenDOM() const;
 
         /**
          * Marshalls the XMLObject, and its children, into a DOM element.
@@ -362,7 +352,7 @@ namespace xmltooling {
         virtual XMLObject* unmarshall(xercesc::DOMElement* element, bool bindDocument=false)=0;
 
     protected:
-        XMLObject() {}
+        XMLObject();
     private:
         XMLObject& operator=(const XMLObject& src);
     };
index 972e212..c8eeda8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
 
 #include "internal.h"
 #include "logging.h"
-#include "XMLObjectBuilder.h"
+#include "ConcreteXMLObjectBuilder.h"
 #include "util/NDC.h"
 #include "util/XMLHelper.h"
 
@@ -30,11 +30,51 @@ using namespace xmltooling::logging;
 using namespace xmltooling;
 using namespace std;
 
+using xercesc::DOMDocument;
 using xercesc::DOMElement;
 
 map<QName,XMLObjectBuilder*> XMLObjectBuilder::m_map;
 XMLObjectBuilder* XMLObjectBuilder::m_default=NULL;
 
+XMLObjectBuilder::XMLObjectBuilder()
+{
+}
+
+XMLObjectBuilder::~XMLObjectBuilder()
+{
+}
+
+XMLObject* XMLObjectBuilder::buildFromQName(const QName& q) const
+{
+    return buildObject(q.getNamespaceURI(),q.getLocalPart(),q.getPrefix());
+}
+
+XMLObject* XMLObjectBuilder::buildFromElement(DOMElement* element, bool bindDocument) const
+{
+    auto_ptr<XMLObject> ret(
+        buildObject(element->getNamespaceURI(),element->getLocalName(),element->getPrefix(),XMLHelper::getXSIType(element))
+        );
+    ret->unmarshall(element,bindDocument);
+    return ret.release();
+}
+
+XMLObject* XMLObjectBuilder::buildFromDocument(DOMDocument* doc, bool bindDocument) const
+{
+    return buildFromElement(doc->getDocumentElement(),bindDocument);
+}
+
+XMLObject* XMLObjectBuilder::buildOneFromElement(xercesc::DOMElement* element, bool bindDocument)
+{
+    const XMLObjectBuilder* b=getBuilder(element);
+    return b ? b->buildFromElement(element,bindDocument) : NULL;
+}
+
+const XMLObjectBuilder* XMLObjectBuilder::getBuilder(const QName& key)
+{
+    map<QName,XMLObjectBuilder*>::const_iterator i=m_map.find(key);
+    return (i==m_map.end()) ? NULL : i->second;
+}
+
 const XMLObjectBuilder* XMLObjectBuilder::getBuilder(const DOMElement* domElement)
 {
 #ifdef _DEBUG
@@ -66,9 +106,51 @@ const XMLObjectBuilder* XMLObjectBuilder::getBuilder(const DOMElement* domElemen
     return m_default;
 }
 
+const XMLObjectBuilder* XMLObjectBuilder::getDefaultBuilder()
+{
+    return m_default;
+}
+
+const map<QName,XMLObjectBuilder*>& XMLObjectBuilder::getBuilders()
+{
+    return m_map;
+}
+
+void XMLObjectBuilder::registerBuilder(const QName& builderKey, XMLObjectBuilder* builder)
+{
+    deregisterBuilder(builderKey);
+    m_map[builderKey]=builder;
+}
+
+void XMLObjectBuilder::registerDefaultBuilder(XMLObjectBuilder* builder)
+{
+    deregisterDefaultBuilder();
+    m_default=builder;
+}
+
+void XMLObjectBuilder::deregisterBuilder(const QName& builderKey)
+{
+    delete getBuilder(builderKey);
+    m_map.erase(builderKey);
+}
+
+void XMLObjectBuilder::deregisterDefaultBuilder()
+{
+    delete m_default;
+    m_default=NULL;
+}
+
 void XMLObjectBuilder::destroyBuilders()
 {
     for_each(m_map.begin(),m_map.end(),cleanup_pair<QName,XMLObjectBuilder>());
     m_map.clear();
     deregisterDefaultBuilder();
 }
+
+ConcreteXMLObjectBuilder::ConcreteXMLObjectBuilder()
+{
+}
+
+ConcreteXMLObjectBuilder::~ConcreteXMLObjectBuilder()
+{
+}
index 7592dc7..01eb11e 100644 (file)
@@ -45,7 +45,7 @@ namespace xmltooling {
     {\r
     MAKE_NONCOPYABLE(XMLObjectBuilder);\r
     public:\r
-        virtual ~XMLObjectBuilder() {}\r
+        virtual ~XMLObjectBuilder();\r
         \r
         /**\r
          * Creates an empty XMLObject with a particular element name.\r
@@ -67,9 +67,7 @@ namespace xmltooling {
          * @param q     QName of element for object\r
          * @return the empty XMLObject\r
          */\r
-        XMLObject* buildFromQName(const QName& q) const {\r
-            return buildObject(q.getNamespaceURI(),q.getLocalPart(),q.getPrefix());\r
-        }\r
+        XMLObject* buildFromQName(const QName& q) const;\r
 \r
         /**\r
          * Creates an unmarshalled XMLObject from a DOM Element.\r
@@ -78,13 +76,7 @@ namespace xmltooling {
          * @param bindDocument  true iff the XMLObject should take ownership of the DOM Document\r
          * @return the unmarshalled XMLObject\r
          */\r
-        XMLObject* buildFromElement(xercesc::DOMElement* element, bool bindDocument=false) const {\r
-            std::auto_ptr<XMLObject> ret(\r
-                buildObject(element->getNamespaceURI(),element->getLocalName(),element->getPrefix(),XMLHelper::getXSIType(element))\r
-                );\r
-            ret->unmarshall(element,bindDocument);\r
-            return ret.release();\r
-        }\r
+        XMLObject* buildFromElement(xercesc::DOMElement* element, bool bindDocument=false) const;\r
 \r
         /**\r
          * Creates an unmarshalled XMLObject from the root of a DOM Document.\r
@@ -93,9 +85,7 @@ namespace xmltooling {
          * @param bindDocument  true iff the XMLObject should take ownership of the DOM Document\r
          * @return the unmarshalled XMLObject\r
          */\r
-        XMLObject* buildFromDocument(xercesc::DOMDocument* doc, bool bindDocument=true) const {\r
-            return buildFromElement(doc->getDocumentElement(),bindDocument);\r
-        }\r
+        XMLObject* buildFromDocument(xercesc::DOMDocument* doc, bool bindDocument=true) const;\r
 \r
         /**\r
          * Creates an unmarshalled XMLObject using the default build method, if a builder can be found.\r
@@ -104,10 +94,7 @@ namespace xmltooling {
          * @param bindDocument  true iff the new XMLObject should take ownership of the DOM Document\r
          * @return  the unmarshalled object or NULL if no builder is available \r
          */\r
-        static XMLObject* buildOneFromElement(xercesc::DOMElement* element, bool bindDocument=false) {\r
-            const XMLObjectBuilder* b=getBuilder(element);\r
-            return b ? b->buildFromElement(element,bindDocument) : NULL;\r
-        }\r
+        static XMLObject* buildOneFromElement(xercesc::DOMElement* element, bool bindDocument=false);\r
 \r
         /**\r
          * Retrieves an XMLObjectBuilder using the key it was registered with.\r
@@ -115,10 +102,7 @@ namespace xmltooling {
          * @param key the key used to register the builder\r
          * @return the builder or NULL\r
          */\r
-        static const XMLObjectBuilder* getBuilder(const QName& key) {\r
-            std::map<QName,XMLObjectBuilder*>::const_iterator i=m_map.find(key);\r
-            return (i==m_map.end()) ? NULL : i->second;\r
-        }\r
+        static const XMLObjectBuilder* getBuilder(const QName& key);\r
 \r
         /**\r
          * Retrieves an XMLObjectBuilder for a given DOM element.\r
@@ -134,18 +118,14 @@ namespace xmltooling {
          * \r
          * @return the default builder or NULL\r
          */\r
-        static const XMLObjectBuilder* getDefaultBuilder() {\r
-            return m_default;\r
-        }\r
+        static const XMLObjectBuilder* getDefaultBuilder();\r
 \r
         /**\r
          * Gets an immutable list of all the builders currently registered.\r
          * \r
          * @return list of all the builders currently registered\r
          */\r
-        static const std::map<QName,XMLObjectBuilder*>& getBuilders() {\r
-            return m_map;\r
-        }\r
+        static const std::map<QName,XMLObjectBuilder*>& getBuilders();\r
     \r
         /**\r
          * Registers a new builder for the given key.\r
@@ -153,38 +133,26 @@ namespace xmltooling {
          * @param builderKey the key used to retrieve this builder later\r
          * @param builder the builder\r
          */\r
-        static void registerBuilder(const QName& builderKey, XMLObjectBuilder* builder) {\r
-            deregisterBuilder(builderKey);\r
-            m_map[builderKey]=builder;\r
-        }\r
+        static void registerBuilder(const QName& builderKey, XMLObjectBuilder* builder);\r
 \r
         /**\r
          * Registers a default builder\r
          * \r
          * @param builder the default builder\r
          */\r
-        static void registerDefaultBuilder(XMLObjectBuilder* builder) {\r
-            deregisterDefaultBuilder();\r
-            m_default=builder;\r
-        }\r
+        static void registerDefaultBuilder(XMLObjectBuilder* builder);\r
 \r
         /**\r
          * Deregisters a builder.\r
          * \r
          * @param builderKey the key for the builder to be deregistered\r
          */\r
-        static void deregisterBuilder(const QName& builderKey) {\r
-            delete getBuilder(builderKey);\r
-            m_map.erase(builderKey);\r
-        }\r
+        static void deregisterBuilder(const QName& builderKey);\r
 \r
         /**\r
          * Deregisters default builder.\r
          */\r
-        static void deregisterDefaultBuilder() {\r
-            delete m_default;\r
-            m_default=NULL;\r
-        }\r
+        static void deregisterDefaultBuilder();\r
 \r
         /**\r
          * Unregisters and destroys all registered builders. \r
@@ -192,7 +160,7 @@ namespace xmltooling {
         static void destroyBuilders();\r
 \r
     protected:\r
-        XMLObjectBuilder() {}\r
+        XMLObjectBuilder();\r
     \r
     private:\r
         static std::map<QName,XMLObjectBuilder*> m_map;\r
index 7e99906..e3710aa 100644 (file)
@@ -33,6 +33,7 @@
 #include "security/OpenSSLCryptoX509CRL.h"
 #include "security/CredentialResolver.h"
 #include "security/KeyInfoResolver.h"
+#include "signature/KeyInfo.h"
 #include "signature/Signature.h"
 #include "soap/SOAP.h"
 #include "soap/SOAPTransport.h"
@@ -41,6 +42,7 @@
 #include "util/ReplayCache.h"
 #include "util/StorageService.h"
 #include "util/TemplateEngine.h"
+#include "util/Threads.h"
 #include "util/URLEncoder.h"
 #include "util/XMLConstants.h"
 #include "validation/ValidatorSuite.h"
@@ -204,10 +206,14 @@ bool XMLToolingInternalConfig::log_config(const char* config)
 }
 
 #ifndef XMLTOOLING_LITE
-void XMLToolingConfig::setReplayCache(ReplayCache* replayCache)
+const KeyInfoResolver* XMLToolingConfig::getKeyInfoResolver() const
 {
-    delete m_replayCache;
-    m_replayCache = replayCache;
+    return m_keyInfoResolver;
+}
+
+ReplayCache* XMLToolingConfig::getReplayCache() const
+{
+    return m_replayCache;
 }
 
 void XMLToolingConfig::setKeyInfoResolver(xmltooling::KeyInfoResolver *keyInfoResolver)
@@ -215,8 +221,29 @@ void XMLToolingConfig::setKeyInfoResolver(xmltooling::KeyInfoResolver *keyInfoRe
     delete m_keyInfoResolver;
     m_keyInfoResolver = keyInfoResolver;
 }
+
+void XMLToolingConfig::setReplayCache(ReplayCache* replayCache)
+{
+    delete m_replayCache;
+    m_replayCache = replayCache;
+}
 #endif
 
+PathResolver* XMLToolingConfig::getPathResolver() const
+{
+    return m_pathResolver;
+}
+
+TemplateEngine* XMLToolingConfig::getTemplateEngine() const
+{
+    return m_templateEngine;
+}
+
+const URLEncoder* XMLToolingConfig::getURLEncoder() const
+{
+    return m_urlEncoder;
+}
+
 void XMLToolingConfig::setPathResolver(PathResolver* pathResolver)
 {
     delete m_pathResolver;
index 3c24b2a..8afee3d 100644 (file)
@@ -163,18 +163,14 @@ namespace xmltooling {
          * 
          * @return  global KeyInfoResolver or NULL
          */
-        const KeyInfoResolver* getKeyInfoResolver() const {
-            return m_keyInfoResolver;
-        }
+        const KeyInfoResolver* getKeyInfoResolver() const;
 
         /**
          * Returns the global ReplayCache instance.
          * 
          * @return  global ReplayCache or NULL
          */
-        ReplayCache* getReplayCache() const {
-            return m_replayCache;
-        }
+        ReplayCache* getReplayCache() const;
 
         /**
          * Sets the global KeyInfoResolver instance.
@@ -200,27 +196,21 @@ namespace xmltooling {
          * 
          * @return  global PathResolver or NULL
          */
-        PathResolver* getPathResolver() const {
-            return m_pathResolver;
-        }
+        PathResolver* getPathResolver() const;
         
         /**
          * Returns the global TemplateEngine instance.
          * 
          * @return  global TemplateEngine or NULL
          */
-        TemplateEngine* getTemplateEngine() const {
-            return m_templateEngine;
-        }
+        TemplateEngine* getTemplateEngine() const;
 
         /**
          * Returns the global URLEncoder instance.
          * 
          * @return  global URLEncoder or NULL
          */
-        const URLEncoder* getURLEncoder() const {
-            return m_urlEncoder;
-        }
+        const URLEncoder* getURLEncoder() const;
 
         /**
          * Sets the global PathResolver instance.
index f1eeb21..8d2b574 100644 (file)
@@ -23,9 +23,9 @@
 #if !defined(__xmltooling_decrypter_h__) && !defined(XMLTOOLING_NO_XMLSEC)
 #define __xmltooling_decrypter_h__
 
-#include <xmltooling/encryption/Encryption.h>
+#include <xmltooling/exceptions.h>
 
-#include <xsec/xenc/XENCCipher.hpp>
+class XENCCipher;
 
 namespace xmltooling {
     class XMLTOOL_API CredentialCriteria;
@@ -34,6 +34,8 @@ namespace xmltooling {
 
 namespace xmlencryption {
 
+    class XMLTOOL_API EncryptedData;
+    class XMLTOOL_API EncryptedKey;
     class XMLTOOL_API EncryptedKeyResolver;
 
     /**
@@ -53,8 +55,7 @@ namespace xmlencryption {
             const xmltooling::CredentialResolver* credResolver=NULL,
             xmltooling::CredentialCriteria* criteria=NULL,
             const EncryptedKeyResolver* EKResolver=NULL
-            ) : m_cipher(NULL), m_credResolver(credResolver), m_criteria(criteria), m_EKResolver(EKResolver) {
-        }
+            );
 
         virtual ~Decrypter();
         
@@ -63,9 +64,7 @@ namespace xmlencryption {
          * 
          * @param EKResolver  the EncryptedKeyResolver to attach 
          */
-        void setEncryptedKeyResolver(const EncryptedKeyResolver* EKResolver) {
-            m_EKResolver=EKResolver;
-        }
+        void setEncryptedKeyResolver(const EncryptedKeyResolver* EKResolver);
 
         /**
          * Replace the current CredentialResolver interface, if any, with a new one.
@@ -73,10 +72,7 @@ namespace xmlencryption {
          * @param resolver  the locked CredentialResolver to attach, or NULL to clear
          * @param criteria  optional external criteria to use with resolver
          */
-        void setKEKResolver(const xmltooling::CredentialResolver* resolver, xmltooling::CredentialCriteria* criteria) {
-            m_credResolver=resolver;
-            m_criteria=criteria;
-        }
+        void setKEKResolver(const xmltooling::CredentialResolver* resolver, xmltooling::CredentialCriteria* criteria);
 
         /**
          * Decrypts the supplied information using the supplied key, and returns
index 9a4c42e..a93a825 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,8 +33,8 @@ namespace xmlencryption {
     class XMLTOOL_API EncryptedKeyResolver {
         MAKE_NONCOPYABLE(EncryptedKeyResolver);
     public:
-        EncryptedKeyResolver() {}
-        virtual ~EncryptedKeyResolver() {}
+        EncryptedKeyResolver();
+        virtual ~EncryptedKeyResolver();
         
         /**
          * Returns an encrypted key based on the supplied object's KeyInfo information.
index 33383ad..a195585 100644 (file)
 #if !defined(__xmltooling_encrypter_h__) && !defined(XMLTOOLING_NO_XMLSEC)
 #define __xmltooling_encrypter_h__
 
-#include <xmltooling/encryption/Encryption.h>
+#include <xmltooling/exceptions.h>
 
-#include <xsec/enc/XSECCryptoKey.hpp>
-#include <xsec/xenc/XENCCipher.hpp>
+#include <xsec/dsig/DSIGConstants.hpp>
+
+class XENCCipher;
 
 namespace xmltooling {
     class XMLTOOL_API Credential;
@@ -34,6 +35,9 @@ namespace xmltooling {
 
 namespace xmlencryption {
 
+    class XMLTOOL_API EncryptedData;
+    class XMLTOOL_API EncryptedKey;
+
     /**
      * Wrapper API for XML Encryption functionality.
      * Designed to allow both external and internal key generation as follows:
@@ -82,11 +86,9 @@ namespace xmlencryption {
                 unsigned int keyBufferSize=0,
                 const xmltooling::Credential* credential=NULL,
                 bool compact=false
-                ) :  m_algorithm(algorithm), m_keyBuffer(keyBuffer), m_keyBufferSize(keyBufferSize),
-                    m_credential(credential), m_compact(compact) {
-            }
+                );
 
-            ~EncryptionParams() {}
+            ~EncryptionParams();
 
             /** Data encryption algorithm. */
             const XMLCh* m_algorithm;
@@ -116,13 +118,10 @@ namespace xmlencryption {
              * @param recipient     optional name of recipient of encrypted key
              */
             KeyEncryptionParams(
-                const xmltooling::Credential& credential,
-                const XMLCh* algorithm=NULL,
-                const XMLCh* recipient=NULL
-                ) : m_credential(credential), m_algorithm(algorithm), m_recipient(recipient) {
-            }
+                const xmltooling::Credential& credential, const XMLCh* algorithm=NULL, const XMLCh* recipient=NULL
+                );
         
-            ~KeyEncryptionParams() {}
+            ~KeyEncryptionParams();
 
             /** Credential containing key encryption key. */
             const xmltooling::Credential& m_credential;
@@ -134,7 +133,7 @@ namespace xmlencryption {
             const XMLCh* m_recipient;
         };
     
-        Encrypter() : m_cipher(NULL) {}
+        Encrypter();
 
         virtual ~Encrypter();
         
index dc3d2c8..f56a248 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #if !defined(__xmltooling_encryption_h__) && !defined(XMLTOOLING_NO_XMLSEC)
 #define __xmltooling_encryption_h__
 
-#include <xmltooling/signature/KeyInfo.h>
+#include <xmltooling/ConcreteXMLObjectBuilder.h>
+#include <xmltooling/ElementProxy.h>
+#include <xmltooling/util/XMLConstants.h>
+
 #include <cstdio>
 
+namespace xmlsignature {
+    class XMLTOOL_API KeyInfo;
+    class XMLTOOL_API Transform;
+};
+
 /**
  * Macro for declaring encryption builders.
  * 
index b29ca13..483715a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
 #include "logging.h"
 #include "encryption/Decrypter.h"
 #include "encryption/EncryptedKeyResolver.h"
+#include "encryption/Encryption.h"
 #include "security/Credential.h"
 #include "security/CredentialCriteria.h"
 #include "security/CredentialResolver.h"
@@ -33,6 +34,7 @@
 #include <xsec/framework/XSECAlgorithmMapper.hpp>
 #include <xsec/framework/XSECAlgorithmHandler.hpp>
 #include <xsec/utils/XSECBinTXFMInputStream.hpp>
+#include <xsec/xenc/XENCCipher.hpp>
 #include <xsec/xenc/XENCEncryptedData.hpp>
 #include <xsec/xenc/XENCEncryptedKey.hpp>
 
@@ -42,12 +44,28 @@ using namespace xmltooling;
 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)
+{
+}
+
 Decrypter::~Decrypter()
 {
     if (m_cipher)
         XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher);
 }
 
+void Decrypter::setEncryptedKeyResolver(const EncryptedKeyResolver* EKResolver)
+{
+    m_EKResolver=EKResolver;
+}
+
+void Decrypter::setKEKResolver(const CredentialResolver* resolver, CredentialCriteria* criteria)
+{
+    m_credResolver=resolver;
+    m_criteria=criteria;
+}
+
 DOMDocumentFragment* Decrypter::decryptData(const EncryptedData& encryptedData, XSECCryptoKey* key)
 {
     if (encryptedData.getDOM()==NULL)
index 5afe82e..421bec6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include "internal.h"
 #include "encryption/EncryptedKeyResolver.h"
+#include "signature/KeyInfo.h"
 
 using namespace xmlencryption;
 using namespace xmlsignature;
 using namespace xmltooling;
 using namespace std;
 
+EncryptedKeyResolver::EncryptedKeyResolver()
+{
+}
+
+EncryptedKeyResolver::~EncryptedKeyResolver()
+{
+}
+
 const EncryptedKey* EncryptedKeyResolver::resolveKey(const EncryptedData& encryptedData, const XMLCh* recipient) const
 {
     if (!encryptedData.getKeyInfo())
index 21601b8..a6996c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include "internal.h"
 #include "encryption/Encrypter.h"
+#include "encryption/Encryption.h"
 #include "security/Credential.h"
+#include "signature/KeyInfo.h"
 
 #include <xsec/enc/XSECCryptoException.hpp>
 #include <xsec/framework/XSECException.hpp>
 #include <xsec/framework/XSECAlgorithmMapper.hpp>
 #include <xsec/framework/XSECAlgorithmHandler.hpp>
+#include <xsec/xenc/XENCCipher.hpp>
 #include <xsec/xenc/XENCEncryptedData.hpp>
 #include <xsec/xenc/XENCEncryptedKey.hpp>
 
@@ -37,6 +40,29 @@ using namespace xmltooling;
 using namespace xercesc;
 using namespace std;
 
+Encrypter::EncryptionParams::EncryptionParams(
+    const XMLCh* algorithm, const unsigned char* keyBuffer, unsigned int keyBufferSize, const Credential* credential, bool compact
+    ) : m_algorithm(algorithm), m_keyBuffer(keyBuffer), m_keyBufferSize(keyBufferSize), m_credential(credential), m_compact(compact)
+{
+}
+
+Encrypter::EncryptionParams::~EncryptionParams()
+{
+}
+
+Encrypter::KeyEncryptionParams::KeyEncryptionParams(const Credential& credential, const XMLCh* algorithm, const XMLCh* recipient)
+    : m_credential(credential), m_algorithm(algorithm), m_recipient(recipient)
+{
+}
+
+Encrypter::KeyEncryptionParams::~KeyEncryptionParams()
+{
+}
+
+Encrypter::Encrypter() : m_cipher(NULL)
+{
+}
+
 Encrypter::~Encrypter()
 {
     XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher);
index a6d0af7..df2eda0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
 #include "encryption/Encryption.h"
 #include "io/AbstractXMLObjectMarshaller.h"
 #include "io/AbstractXMLObjectUnmarshaller.h"
+#include "signature/KeyInfo.h"
 #include "util/XMLHelper.h"
 
 #include <xercesc/util/XMLUniDefs.hpp>
index 4adcb7b..16d7adc 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright 2001-2007 Internet2
+*  Copyright 2001-2009 Internet2
  * 
 * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 #include "internal.h"
 #include "exceptions.h"
 #include "encryption/Encryption.h"
+#include "validation/Validator.h"
 #include "validation/ValidatorSuite.h"
 
 using namespace xmlencryption;
index 8fb4cfc..27c1702 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,6 +32,19 @@ using namespace xmltooling;
 using namespace xercesc;
 using namespace std;
 
+AnyElementImpl::AnyElementImpl()
+{
+}
+
+AnyElementImpl::AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+{
+}
+
+AnyElementImpl::~AnyElementImpl()
+{
+}
+
 XMLObject* AnyElementImpl::clone() const {
     auto_ptr<XMLObject> domClone(AbstractDOMCachingXMLObject::clone());
     AnyElementImpl* ret=dynamic_cast<AnyElementImpl*>(domClone.get());
@@ -43,27 +56,34 @@ XMLObject* AnyElementImpl::clone() const {
     return new AnyElementImpl(*this);
 }
 
-AnyElementImpl::AnyElementImpl(const AnyElementImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src),
-        AbstractComplexElement(src), AbstractAttributeExtensibleXMLObject(src) {
+AnyElementImpl::AnyElementImpl(const AnyElementImpl& src)
+        : AbstractXMLObject(src),
+          AbstractDOMCachingXMLObject(src),
+          AbstractComplexElement(src),
+          AbstractAttributeExtensibleXMLObject(src) {
     const vector<XMLObject*>& children = src.getUnknownXMLObjects();
     for (vector<XMLObject*>::const_iterator i=children.begin(); i!=children.end(); ++i)
         getUnknownXMLObjects().push_back((*i)->clone());
 }       
 
-void AnyElementImpl::marshallAttributes(DOMElement* domElement) const {
+void AnyElementImpl::marshallAttributes(DOMElement* domElement) const
+{
     marshallExtensionAttributes(domElement);
 }
 
-void AnyElementImpl::processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+void AnyElementImpl::processChildElement(XMLObject* childXMLObject, const DOMElement* root)
+{
     getUnknownXMLObjects().push_back(childXMLObject);
 }
 
-void AnyElementImpl::processAttribute(const DOMAttr* attribute) {
+void AnyElementImpl::processAttribute(const DOMAttr* attribute)
+{
     unmarshallExtensionAttribute(attribute);
 }
 
 XMLObject* AnyElementBuilder::buildObject(
     const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType
-    ) const {
+    ) const
+{
     return new AnyElementImpl(nsURI, localName, prefix, schemaType);
 }
index 5fad8ec..4151cd3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -49,15 +49,14 @@ namespace xmltooling {
     {
     /// @cond OFF
     public:
-        virtual ~AnyElementImpl() {}
+        virtual ~AnyElementImpl();
 
-        AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL)
-            : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
+        AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL);
         
         XMLObject* clone() const;
         
     protected:
-        AnyElementImpl() {}
+        AnyElementImpl();
         AnyElementImpl(const AnyElementImpl& src);
         
         IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
index b1bc80f..9f68476 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright 2001-2007 Internet2
+*  Copyright 2001-2009 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 @@
 /**
  * UnknownElement.cpp
  * 
- * Basic implementation suitable for use as default for unrecognized content
+ * Basic implementation suitable for use as default for unrecognized content.
  */
 
 #include "internal.h"
@@ -39,6 +39,15 @@ using namespace std;
 using xmlsignature::Signature;
 #endif
 
+UnknownElementImpl::UnknownElementImpl(const XMLCh* namespaceURI, const XMLCh* elementLocalName, const XMLCh* namespacePrefix)
+    : AbstractXMLObject(namespaceURI, elementLocalName, namespacePrefix)
+{
+}
+
+UnknownElementImpl::~UnknownElementImpl()
+{
+}
+
 void UnknownElementImpl::releaseDOM() const
 {
 #ifdef _DEBUG
@@ -68,6 +77,25 @@ XMLObject* UnknownElementImpl::clone() const
     return ret;
 }
 
+const XMLCh* UnknownElementImpl::getTextContent(unsigned int position) const
+{
+    throw XMLObjectException("Direct access to content is not permitted.");
+}
+
+void UnknownElementImpl::setTextContent(const XMLCh*, unsigned int position)
+{
+    throw XMLObjectException("Direct access to content is not permitted.");
+}
+
+void UnknownElementImpl::setDocumentElement(DOMDocument* document, DOMElement* element) const
+{
+    DOMElement* documentRoot = document->getDocumentElement();
+    if (documentRoot)
+        document->replaceChild(element, documentRoot);
+    else
+        document->appendChild(element);
+}
+
 void UnknownElementImpl::serialize(string& s) const
 {
     if (getDOM())
@@ -206,7 +234,8 @@ XMLObject* UnknownElementImpl::unmarshall(DOMElement* element, bool bindDocument
 
 XMLObject* UnknownElementBuilder::buildObject(
     const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType
-    ) const {
+    ) const
+{
     return new UnknownElementImpl(nsURI,localName,prefix);
 }
 
index ed24fae..d88d281 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright 2001-2007 Internet2
+*  Copyright 2001-2009 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/impl/UnknownElement.h
  * 
- * Basic implementation suitable for use as default for unrecognized content
+ * Basic implementation suitable for use as default for unrecognized content.
  */
 
 #ifndef __xmltooling_unkelement_h__
@@ -42,20 +42,14 @@ namespace xmltooling {
     class XMLTOOL_DLLLOCAL UnknownElementImpl : public AbstractSimpleElement, public AbstractDOMCachingXMLObject
     {
     public:
-        UnknownElementImpl(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL)
-            : AbstractXMLObject(namespaceURI, elementLocalName, namespacePrefix) {}
+        UnknownElementImpl(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL);
     
-        void releaseDOM() const;
+        virtual ~UnknownElementImpl();
 
+        void releaseDOM() const;
         XMLObject* clone() const;
-
-        const XMLCh* getTextContent(unsigned int position=0) const {
-            throw XMLObjectException("Direct access to content is not permitted.");
-        }
-
-        void setTextContent(const XMLCh*, unsigned int position=0) {
-            throw XMLObjectException("Direct access to content is not permitted.");
-        }
+        const XMLCh* getTextContent(unsigned int position=0) const;
+        void setTextContent(const XMLCh*, unsigned int position=0);
 
         xercesc::DOMElement* marshall(
             xercesc::DOMDocument* document=NULL
@@ -75,13 +69,7 @@ namespace xmltooling {
         XMLObject* unmarshall(xercesc::DOMElement* element, bool bindDocument=false);
         
     protected:
-        void setDocumentElement(xercesc::DOMDocument* document, xercesc::DOMElement* element) const {
-            xercesc::DOMElement* documentRoot = document->getDocumentElement();
-            if (documentRoot)
-                document->replaceChild(element, documentRoot);
-            else
-                document->appendChild(element);
-        }
+        void setDocumentElement(xercesc::DOMDocument* document, xercesc::DOMElement* element) const;
 
         mutable std::string m_xml;
 
index 0157327..3a6064e 100644 (file)
@@ -43,6 +43,23 @@ using namespace xmltooling;
 using namespace xercesc;
 using namespace std;
 
+AbstractXMLObjectMarshaller::AbstractXMLObjectMarshaller()
+{
+}
+
+AbstractXMLObjectMarshaller::~AbstractXMLObjectMarshaller()
+{
+}
+
+void AbstractXMLObjectMarshaller::setDocumentElement(DOMDocument* document, DOMElement* element) const
+{
+    DOMElement* documentRoot = document->getDocumentElement();
+    if (documentRoot)
+        document->replaceChild(element, documentRoot);
+    else
+        document->appendChild(element);
+}
+
 DOMElement* AbstractXMLObjectMarshaller::marshall(
     DOMDocument* document
 #ifndef XMLTOOLING_NO_XMLSEC
@@ -361,3 +378,7 @@ void AbstractXMLObjectMarshaller::marshallContent(
         }
     }
 }
+
+void AbstractXMLObjectMarshaller::marshallAttributes(DOMElement* domElement) const
+{
+}
index 9481deb..bffe944 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright 2001-2007 Internet2
+*  Copyright 2001-2009 Internet2
  * 
 * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ namespace xmltooling {
     class XMLTOOL_API AbstractXMLObjectMarshaller : public virtual AbstractXMLObject
     {
     public:
-        virtual ~AbstractXMLObjectMarshaller() {}
+        virtual ~AbstractXMLObjectMarshaller();
 
         xercesc::DOMElement* marshall(
             xercesc::DOMDocument* document=NULL
@@ -57,7 +57,7 @@ namespace xmltooling {
             ) const;
         
     protected:
-        AbstractXMLObjectMarshaller() {}
+        AbstractXMLObjectMarshaller();
 
         /**
          * Sets the given element as the Document Element of the given Document.
@@ -66,13 +66,7 @@ namespace xmltooling {
          * @param document the document
          * @param element the Element that will serve as the Document Element
          */
-        void setDocumentElement(xercesc::DOMDocument* document, xercesc::DOMElement* element) const {
-            xercesc::DOMElement* documentRoot = document->getDocumentElement();
-            if (documentRoot)
-                document->replaceChild(element, documentRoot);
-            else
-                document->appendChild(element);
-        }
+        void setDocumentElement(xercesc::DOMDocument* document, xercesc::DOMElement* element) const;
     
 #ifndef XMLTOOLING_NO_XMLSEC
         /**
@@ -146,7 +140,7 @@ namespace xmltooling {
          * 
          * @throws MarshallingException thrown if there is a problem marshalling an attribute
          */
-        virtual void marshallAttributes(xercesc::DOMElement* domElement) const {}
+        virtual void marshallAttributes(xercesc::DOMElement* domElement) const;
     };
     
 };
index e633b70..b200f5b 100644 (file)
@@ -35,6 +35,13 @@ using namespace xmltooling;
 using namespace xercesc;
 using namespace std;
 
+AbstractXMLObjectUnmarshaller::AbstractXMLObjectUnmarshaller()
+{
+}
+
+AbstractXMLObjectUnmarshaller::~AbstractXMLObjectUnmarshaller()
+{
+}
 
 XMLObject* AbstractXMLObjectUnmarshaller::unmarshall(DOMElement* element, bool bindDocument)
 {
index fc23c97..d25c18a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright 2001-2007 Internet2
+*  Copyright 2001-2009 Internet2
  * 
 * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,12 +38,12 @@ namespace xmltooling {
     class XMLTOOL_API AbstractXMLObjectUnmarshaller : public virtual AbstractXMLObject
     {
     public:
-        virtual ~AbstractXMLObjectUnmarshaller() {}
+        virtual ~AbstractXMLObjectUnmarshaller();
 
         XMLObject* unmarshall(xercesc::DOMElement* element, bool bindDocument=false);
             
     protected:
-        AbstractXMLObjectUnmarshaller() {}
+        AbstractXMLObjectUnmarshaller();
 
         /**
          * Unmarshalls the attributes from the given DOM Element into the XMLObject. If the attribute
index e540b2e..a874040 100644 (file)
@@ -42,9 +42,9 @@ namespace xmltooling {
     class XMLTOOL_API GenericRequest {
         MAKE_NONCOPYABLE(GenericRequest);
     protected:
-        GenericRequest() {}
+        GenericRequest();
     public:
-        virtual ~GenericRequest() {}
+        virtual ~GenericRequest();
 
         /**
          * Returns the URL scheme of the request (http, https, ftp, ldap, etc.)
index 57a459d..6b0d55c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,9 +36,9 @@ namespace xmltooling {
     class XMLTOOL_API GenericResponse {
         MAKE_NONCOPYABLE(GenericResponse);
     protected:
-        GenericResponse() {}
+        GenericResponse();
     public:
-        virtual ~GenericResponse() {}        
+        virtual ~GenericResponse();
 
         /**
          * Sets or clears the MIME type of the response.
index ff73107..2a71c30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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 @@
 /**
  * HTTPRequest.cpp
  * 
- * Interface to HTTP requests  
+ * Interface to HTTP requests.
  */
 
 #include "internal.h"
 using namespace xmltooling;
 using namespace std;
 
+GenericRequest::GenericRequest()
+{
+}
+
+GenericRequest::~GenericRequest()
+{
+}
+
+HTTPRequest::HTTPRequest()
+{
+}
+
+HTTPRequest::~HTTPRequest()
+{
+}
+
+bool HTTPRequest::isSecure() const
+{
+    return strcmp(getScheme(),"https")==0;
+}
+
 const char* HTTPRequest::getCookie(const char* name) const
 {
     if (m_cookieMap.empty()) {
index a600be2..b2c65f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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/io/HTTPRequest.h
  * 
- * Interface to HTTP requests 
+ * Interface to HTTP requests.
  */
 
 #ifndef __xmltooling_httpreq_h__
@@ -46,13 +46,11 @@ namespace xmltooling {
      */
     class XMLTOOL_API HTTPRequest : public GenericRequest {
     protected:
-        HTTPRequest() {}
+        HTTPRequest();
     public:
-        virtual ~HTTPRequest() {}
+        virtual ~HTTPRequest();
 
-        bool isSecure() const {
-            return strcmp(getScheme(),"https")==0;
-        }
+        bool isSecure() const;
           
         /**
          * Returns the HTTP method of the request (GET, POST, etc.)
index 934de5e..ab2255a 100644 (file)
 #include "HTTPResponse.h"
 
 using namespace xmltooling;
+using std::istream;
+
+GenericResponse::GenericResponse()
+{
+}
+
+GenericResponse::~GenericResponse()
+{
+}
+
+HTTPResponse::HTTPResponse()
+{
+}
+
+HTTPResponse::~HTTPResponse()
+{
+}
+
+void HTTPResponse::setContentType(const char* type)
+{
+    setResponseHeader("Content-Type", type);
+}
 
 void HTTPResponse::setCookie(const char* name, const char* value)
 {
@@ -31,3 +53,13 @@ void HTTPResponse::setCookie(const char* name, const char* value)
     cookie = cookie + '=' + value;
     setResponseHeader("Set-Cookie", cookie.c_str());
 }
+
+long HTTPResponse::sendError(istream& inputStream)
+{
+    return sendResponse(inputStream, XMLTOOLING_HTTP_STATUS_ERROR);
+}
+
+long HTTPResponse::sendResponse(istream& inputStream)
+{
+    return sendResponse(inputStream, XMLTOOLING_HTTP_STATUS_OK);
+}
index ab36b93..6c38321 100644 (file)
@@ -38,13 +38,11 @@ namespace xmltooling {
      */
     class XMLTOOL_API HTTPResponse : public GenericResponse {
     protected:
-        HTTPResponse() {}
+        HTTPResponse();
     public:
-        virtual ~HTTPResponse() {}
+        virtual ~HTTPResponse();
         
-        void setContentType(const char* type) {
-            setResponseHeader("Content-Type", type);
-        }
+        void setContentType(const char* type);
         
         /**
          * Sets or clears a response header.
@@ -81,15 +79,10 @@ namespace xmltooling {
             XMLTOOLING_HTTP_STATUS_ERROR = 500
         };
         
-        using GenericResponse::sendResponse;
-
-        long sendError(std::istream& inputStream) {
-            return sendResponse(inputStream, XMLTOOLING_HTTP_STATUS_ERROR);
-        }
+        long sendError(std::istream& inputStream);
 
-        long sendResponse(std::istream& inputStream) {
-            return sendResponse(inputStream, XMLTOOLING_HTTP_STATUS_OK);
-        }
+        using GenericResponse::sendResponse;
+        long sendResponse(std::istream& inputStream);
     };
 };
 
index 9c6ef91..5d1a0d8 100644 (file)
 
 #include <xmltooling/security/OpenSSLTrustEngine.h>
 #include <xmltooling/security/SignatureTrustEngine.h>
-#include <xmltooling/security/XSECCryptoX509CRL.h>
 
 namespace xmltooling {
 
+    class XMLTOOL_API XSECCryptoX509CRL;
+
     /**
      * A trust engine that uses X.509 trust anchors and CRLs associated with a peer
      * to perform PKIX validation of signatures and credentials.
@@ -69,7 +70,7 @@ namespace xmltooling {
         bool checkEntityNames(X509* certEE, const CredentialResolver& credResolver, const CredentialCriteria& criteria) const;
 
     public:
-        virtual ~AbstractPKIXTrustEngine() {}
+        virtual ~AbstractPKIXTrustEngine();
 
         bool validate(
             xmlsignature::Signature& sig,
@@ -110,10 +111,10 @@ namespace xmltooling {
         class XMLTOOL_API PKIXValidationInfoIterator {
             MAKE_NONCOPYABLE(PKIXValidationInfoIterator);
         protected:
-            PKIXValidationInfoIterator() {}
+            PKIXValidationInfoIterator();
             
         public:
-            virtual ~PKIXValidationInfoIterator() {}
+            virtual ~PKIXValidationInfoIterator();
             
             /**
              * Advances to the next set of information, if any.
index 0d899fd..09d9ffe 100644 (file)
 #define __xmltooling_basicx509cred_h__
 
 #include <xmltooling/security/X509Credential.h>
-#include <xmltooling/signature/KeyInfo.h>
 
-#include <algorithm>
+#include <set>
+#include <vector>
+#include <string>
+
+namespace xmlsignature {
+    class XMLTOOL_API KeyInfo;
+};
 
 namespace xmltooling {
 
@@ -101,7 +106,7 @@ namespace xmltooling {
     public:
         virtual ~BasicX509Credential();
         
-        // Virtual overrides.
+        // Virtual function overrides.
         unsigned int getUsage() const;
         const char* getAlgorithm() const;
         unsigned int getKeySize() const;
index 696e539..ebee77e 100644 (file)
@@ -26,6 +26,8 @@
 #include <xmltooling/security/OpenSSLTrustEngine.h>
 #include <xmltooling/security/SignatureTrustEngine.h>
 
+#include <vector>
+
 namespace xmltooling {
 
     /**
index ecd575a..781c3d8 100644 (file)
 #define __xmltooling_cred_h__
 
 #include <xmltooling/base.h>
-#include <xsec/enc/XSECCryptoKey.hpp>
 
 #include <set>
 #include <string>
 
+class XSECCryptoKey;
+
 namespace xmlsignature {
     class XMLTOOL_API KeyInfo;
 };
@@ -48,10 +49,10 @@ namespace xmltooling {
     {
         MAKE_NONCOPYABLE(Credential);
     protected:
-        Credential() {}
+        Credential();
 
     public:
-        virtual ~Credential() {}
+        virtual ~Credential();
 
         /**
          * Bitmask constants for limiting resolution process inside a CredentialResolver.
@@ -139,9 +140,7 @@ namespace xmltooling {
          *
          * @return resolution context of the credential
          */
-        virtual const CredentialContext* getCredentalContext() const {
-            return NULL;
-        }
+        virtual const CredentialContext* getCredentalContext() const;
     };
 };
 
index 7cd3abd..aa38656 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@ namespace xmltooling {
     {
         MAKE_NONCOPYABLE(CredentialContext);
     protected:
-        CredentialContext() {}
+        CredentialContext();
         
     public:
-        virtual ~CredentialContext() {}
+        virtual ~CredentialContext();
         
     };
 };
index 711b431..c7b711d 100644 (file)
@@ -69,76 +69,56 @@ namespace xmltooling {
          * 
          * @return the usage mask
          */
-        unsigned int getUsage() const {
-            return m_keyUsage;
-        }
+        unsigned int getUsage() const;
     
         /**
          * Set key usage criteria.
          * 
          * @param usage the usage mask to set
          */
-        void setUsage(unsigned int usage) {
-            m_keyUsage = usage;
-        }
+        void setUsage(unsigned int usage);
 
         /**
          * Get the peer name criteria.
          * 
          * @return the peer name
          */
-        const char* getPeerName() const {
-            return m_peerName.c_str();
-        }
+        const char* getPeerName() const;
     
         /**
          * Set the peer name criteria.
          * 
          * @param peerName peer name to set
          */
-        void setPeerName(const char* peerName) {
-            m_peerName.erase();
-            if (peerName)
-                m_peerName = peerName;
-        }
+        void setPeerName(const char* peerName);
     
         /**
          * Get the key algorithm criteria.
          * 
          * @return the key algorithm
          */
-        const char* getKeyAlgorithm() const {
-            return m_keyAlgorithm.c_str();
-        }
+        const char* getKeyAlgorithm() const;
     
         /**
          * Set the key algorithm criteria.
          * 
          * @param keyAlgorithm The key algorithm to set
          */
-        void setKeyAlgorithm(const char* keyAlgorithm) {
-            m_keyAlgorithm.erase();
-            if (keyAlgorithm)
-                m_keyAlgorithm = keyAlgorithm;
-        }
+        void setKeyAlgorithm(const char* keyAlgorithm);
 
         /**
          * Get the key size criteria.
          *
          * @return  the key size, or 0
          */
-        unsigned int getKeySize() const {
-            return m_keySize;
-        }
+        unsigned int getKeySize() const;
 
         /**
          * Set the key size criteria.
          *
          * @param keySize Key size to set
          */
-        void setKeySize(unsigned int keySize) {
-            m_keySize = keySize;
-        }
+        void setKeySize(unsigned int keySize);
     
         /**
          * Set the key algorithm and size criteria based on an XML algorithm specifier.
@@ -152,27 +132,21 @@ namespace xmltooling {
          * 
          * @return an immutable set of key names
          */
-        const std::set<std::string>& getKeyNames() const {
-            return m_keyNames;
-        }
+        const std::set<std::string>& getKeyNames() const;
 
         /**
          * Gets key name criteria.
          * 
          * @return a mutable set of key names
          */
-        std::set<std::string>& getKeyNames() {
-            return m_keyNames;
-        }
+        std::set<std::string>& getKeyNames();
 
         /**
          * Returns the public key criteria.
          * 
          * @return  a public key
          */
-        virtual XSECCryptoKey* getPublicKey() const {
-            return m_key;
-        }
+        virtual XSECCryptoKey* getPublicKey() const;
 
         /**
          * Sets the public key criteria.
@@ -182,9 +156,7 @@ namespace xmltooling {
          * 
          * @param key a public key
          */
-        void setPublicKey(XSECCryptoKey* key) {
-            m_key = key;
-        }
+        void setPublicKey(XSECCryptoKey* key);
 
         /**
          * Bitmask constants controlling the kinds of criteria set automatically
@@ -200,9 +172,7 @@ namespace xmltooling {
          * 
          * @return the KeyInfo criteria
          */
-        const xmlsignature::KeyInfo* getKeyInfo() const {
-            return m_keyInfo;
-        }
+        const xmlsignature::KeyInfo* getKeyInfo() const;
     
         /**
          * Sets the KeyInfo criteria.
@@ -217,9 +187,7 @@ namespace xmltooling {
          * 
          * @return the native KeyInfo criteria
          */
-        DSIGKeyInfoList* getNativeKeyInfo() const {
-            return m_nativeKeyInfo;
-        }
+        DSIGKeyInfoList* getNativeKeyInfo() const;
 
         /**
          * Sets the KeyInfo criteria.
index 2c4b2cf..5cd31fc 100644 (file)
@@ -37,10 +37,10 @@ namespace xmltooling {
     {
         MAKE_NONCOPYABLE(CredentialResolver);
     protected:
-        CredentialResolver() {}
+        CredentialResolver();
         
     public:
-        virtual ~CredentialResolver() {}
+        virtual ~CredentialResolver();
         
         /**
          * Returns a single Credential according to the supplied criteria.
index 589d2cf..56d927a 100644 (file)
@@ -44,36 +44,30 @@ namespace xmltooling {
          *
          * @param keyInfo   surrounding KeyInfo context object
          */
-        KeyInfoCredentialContext(const xmlsignature::KeyInfo* keyInfo=NULL) : m_keyInfo(keyInfo), m_nativeKeyInfo(NULL) {
-        }
+        KeyInfoCredentialContext(const xmlsignature::KeyInfo* keyInfo=NULL);
 
         /**
          * Constructor
          *
          * @param keyInfo   surrounding native KeyInfo context object
          */
-        KeyInfoCredentialContext(DSIGKeyInfoList* keyInfo) : m_keyInfo(NULL), m_nativeKeyInfo(keyInfo) {
-        }
+        KeyInfoCredentialContext(DSIGKeyInfoList* keyInfo);
 
-        virtual ~KeyInfoCredentialContext() {}
+        virtual ~KeyInfoCredentialContext();
 
         /**
          * Gets the KeyInfo context.
          * 
          * @return the KeyInfo context
          */
-        const xmlsignature::KeyInfo* getKeyInfo() const {
-            return m_keyInfo;
-        }
+        const xmlsignature::KeyInfo* getKeyInfo() const;
 
         /**
          * Gets the native KeyInfo context.
          * 
          * @return the native KeyInfo context
          */
-        DSIGKeyInfoList* getNativeKeyInfo() const {
-            return m_nativeKeyInfo;
-        }
+        DSIGKeyInfoList* getNativeKeyInfo() const;
 
     private:
         const xmlsignature::KeyInfo* m_keyInfo;
index b2f5350..06163b8 100644 (file)
@@ -50,9 +50,9 @@ namespace xmltooling {
     class XMLTOOL_API KeyInfoResolver {
         MAKE_NONCOPYABLE(KeyInfoResolver);
     protected:
-        KeyInfoResolver() {}
+        KeyInfoResolver();
     public:
-        virtual ~KeyInfoResolver() {}
+        virtual ~KeyInfoResolver();
         
         /**
          * Returns a credential based on the supplied KeyInfo information.
index 73915dc..24ccf42 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@ namespace xmltooling {
     class XMLTOOL_API OpenSSLCredential : public virtual X509Credential
     {
     protected:
-        OpenSSLCredential() {}
+        OpenSSLCredential();
         
     public:
-        virtual ~OpenSSLCredential() {}
+        virtual ~OpenSSLCredential();
         
         /**
          * Attaches credential to an OpenSSL SSL context object.
index fd243ae..1328420 100644 (file)
@@ -35,16 +35,12 @@ namespace xmltooling {
     class XMLTOOL_API OpenSSLCryptoX509CRL : public XSECCryptoX509CRL {
     public:
         /** Default constructor. */
-       OpenSSLCryptoX509CRL() : mp_X509CRL(NULL), m_DERX509CRL("") {}
+       OpenSSLCryptoX509CRL();
        virtual ~OpenSSLCryptoX509CRL();
 
-       const XMLCh* getProviderName() const {
-            return DSIGConstants::s_unicodeStrPROVOpenSSL;
-        }
+       const XMLCh* getProviderName() const;
        void loadX509CRLBase64Bin(const char* buf, unsigned int len);
-       safeBuffer& getDEREncodingSB(void) {
-            return m_DERX509CRL;
-        }
+       safeBuffer& getDEREncodingSB();
     
         /**
          * Constructor
@@ -58,9 +54,7 @@ namespace xmltooling {
          * 
          * @return  native CRL object, or NULL
          */
-       X509_CRL* getOpenSSLX509CRL() {
-            return mp_X509CRL;
-        }
+       X509_CRL* getOpenSSLX509CRL();
 
         XSECCryptoX509CRL* clone() const;
     
index 3218cbc..46f68f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -49,10 +49,10 @@ namespace xmltooling {
          * 
          * @param e DOM to supply configuration for provider
          */
-        OpenSSLTrustEngine(const xercesc::DOMElement* e=NULL) : X509TrustEngine(e) {}
+        OpenSSLTrustEngine(const xercesc::DOMElement* e=NULL);
         
     public:
-        virtual ~OpenSSLTrustEngine() {}
+        virtual ~OpenSSLTrustEngine();
 
         using X509TrustEngine::validate;
 
index 3b69ada..7ad65d9 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <xmltooling/base.h>
 
+#include <string>
 #include <vector>
 
 class XSECCryptoKey;
index 6288951..fe17c16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,10 +53,10 @@ namespace xmltooling {
          * 
          * @param e DOM to supply configuration for provider
          */
-        SignatureTrustEngine(const xercesc::DOMElement* e=NULL) : TrustEngine(e) {}
+        SignatureTrustEngine(const xercesc::DOMElement* e=NULL);
         
     public:
-        virtual ~SignatureTrustEngine() {}
+        virtual ~SignatureTrustEngine();
 
         /**
          * Determines whether an XML signature is correct and valid with respect to
index c187648..1e50c43 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index edd83f4..86df5e2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #define __xmltooling_x509cred_h__
 
 #include <xmltooling/security/Credential.h>
-#include <xmltooling/security/XSECCryptoX509CRL.h>
 
-#include <xsec/enc/XSECCryptoX509.hpp>
+class XSECCryptoX509;
 
 namespace xmltooling {
 
+    class XMLTOOL_API XSECCryptoX509CRL;
+
     /**
      * Wraps an X.509-based Credential.
      */
     class XMLTOOL_API X509Credential : public virtual Credential
     {
     protected:
-        X509Credential() {}
+        X509Credential();
         
     public:
-        virtual ~X509Credential() {}
+        virtual ~X509Credential();
 
         /**
          * Bitmask constants for limiting resolution process inside a CredentialResolver. 
index b73ff0b..40590ee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,7 +26,8 @@
 #include <xmltooling/security/TrustEngine.h>
 
 #include <vector>
-#include <xsec/enc/XSECCryptoX509.hpp>
+
+class XSECCryptoX509;
 
 namespace xmltooling {
 
@@ -51,10 +52,10 @@ namespace xmltooling {
          * 
          * @param e DOM to supply configuration for provider
          */
-        X509TrustEngine(const xercesc::DOMElement* e=NULL) : TrustEngine(e) {}
+        X509TrustEngine(const xercesc::DOMElement* e=NULL);
         
     public:
-        virtual ~X509TrustEngine() {}
+        virtual ~X509TrustEngine();
 
         /**
          * Determines whether an X.509 credential is valid with respect to the
index e545293..ccfe05c 100644 (file)
@@ -36,9 +36,9 @@ namespace xmltooling {
     class XMLTOOL_API XSECCryptoX509CRL {
         MAKE_NONCOPYABLE(XSECCryptoX509CRL);
     protected:
-        XSECCryptoX509CRL() {}
+        XSECCryptoX509CRL();
     public:
-       virtual ~XSECCryptoX509CRL() {}
+       virtual ~XSECCryptoX509CRL();
     
        /**
         * Returns a string that identifies the crypto owner of this library.
index a20f034..1f0f8fc 100644 (file)
@@ -163,6 +163,14 @@ namespace {
     }
 };
 
+AbstractPKIXTrustEngine::PKIXValidationInfoIterator::PKIXValidationInfoIterator()
+{
+}
+
+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);
@@ -170,6 +178,10 @@ AbstractPKIXTrustEngine::AbstractPKIXTrustEngine(const xercesc::DOMElement* e) :
     m_fullCRLChain = (flag && (*flag == xercesc::chLatin_t || *flag == xercesc::chDigit_1));
 }
 
+AbstractPKIXTrustEngine::~AbstractPKIXTrustEngine()
+{
+}
+
 bool AbstractPKIXTrustEngine::checkEntityNames(
     X509* certEE, const CredentialResolver& credResolver, const CredentialCriteria& criteria
     ) const
index 9ceaf89..595dc8b 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "internal.h"
 #include "security/BasicX509Credential.h"
+#include "security/KeyInfoCredentialContext.h"
+#include "security/OpenSSLCredential.h"
+#include "security/XSECCryptoX509CRL.h"
 #include "signature/KeyInfo.h"
 
 #include <algorithm>
@@ -32,6 +35,65 @@ using namespace xmlsignature;
 using namespace xmltooling;
 using namespace std;
 
+Credential::Credential()
+{
+}
+
+Credential::~Credential()
+{
+}
+
+const CredentialContext* Credential::getCredentalContext() const
+{
+    return NULL;
+}
+
+X509Credential::X509Credential()
+{
+}
+
+X509Credential::~X509Credential()
+{
+}
+
+OpenSSLCredential::OpenSSLCredential()
+{
+}
+
+OpenSSLCredential::~OpenSSLCredential()
+{
+}
+
+CredentialContext::CredentialContext()
+{
+}
+
+CredentialContext::~CredentialContext()
+{
+}
+
+KeyInfoCredentialContext::KeyInfoCredentialContext(const KeyInfo* keyInfo) : m_keyInfo(keyInfo), m_nativeKeyInfo(NULL)
+{
+}
+
+KeyInfoCredentialContext::KeyInfoCredentialContext(DSIGKeyInfoList* keyInfo) : m_keyInfo(NULL), m_nativeKeyInfo(keyInfo)
+{
+}
+
+KeyInfoCredentialContext::~KeyInfoCredentialContext()
+{
+}
+
+const KeyInfo* KeyInfoCredentialContext::getKeyInfo() const
+{
+    return m_keyInfo;
+}
+
+DSIGKeyInfoList* KeyInfoCredentialContext::getNativeKeyInfo() const
+{
+    return m_nativeKeyInfo;
+}
+
 BasicX509Credential::BasicX509Credential(bool ownCerts) : m_key(NULL), m_ownCerts(ownCerts), m_keyInfo(NULL), m_compactKeyInfo(NULL)
 {
 }
index 12a6993..2e9a635 100644 (file)
@@ -35,6 +35,8 @@
 #include <xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.hpp>
 #include <xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp>
 
+using xmlsignature::KeyInfo;
+using xmlsignature::Signature;
 using namespace xmltooling;
 using namespace std;
 
@@ -49,6 +51,50 @@ CredentialCriteria::~CredentialCriteria()
     delete m_credential;
 }
 
+unsigned int CredentialCriteria::getUsage() const
+{
+    return m_keyUsage;
+}
+
+void CredentialCriteria::setUsage(unsigned int usage)
+{
+    m_keyUsage = usage;
+}
+
+const char* CredentialCriteria::getPeerName() const
+{
+    return m_peerName.c_str();
+}
+
+void CredentialCriteria::setPeerName(const char* peerName)
+{
+    m_peerName.erase();
+    if (peerName)
+        m_peerName = peerName;
+}
+
+const char* CredentialCriteria::getKeyAlgorithm() const
+{
+    return m_keyAlgorithm.c_str();
+}
+
+void CredentialCriteria::setKeyAlgorithm(const char* keyAlgorithm)
+{
+    m_keyAlgorithm.erase();
+    if (keyAlgorithm)
+        m_keyAlgorithm = keyAlgorithm;
+}
+
+unsigned int CredentialCriteria::getKeySize() const
+{
+    return m_keySize;
+}
+
+void CredentialCriteria::setKeySize(unsigned int keySize)
+{
+    m_keySize = keySize;
+}
+
 void CredentialCriteria::setXMLAlgorithm(const XMLCh* algorithm)
 {
     if (algorithm) {
@@ -62,7 +108,32 @@ void CredentialCriteria::setXMLAlgorithm(const XMLCh* algorithm)
     }
 }
 
-void CredentialCriteria::setKeyInfo(const xmlsignature::KeyInfo* keyInfo, int extraction)
+const set<string>& CredentialCriteria::getKeyNames() const
+{
+    return m_keyNames;
+}
+
+set<string>& CredentialCriteria::getKeyNames()
+{
+    return m_keyNames;
+}
+
+XSECCryptoKey* CredentialCriteria::getPublicKey() const
+{
+    return m_key;
+}
+
+void CredentialCriteria::setPublicKey(XSECCryptoKey* key)
+{
+    m_key = key;
+}
+
+const KeyInfo* CredentialCriteria::getKeyInfo() const
+{
+    return m_keyInfo;
+}
+
+void CredentialCriteria::setKeyInfo(const KeyInfo* keyInfo, int extraction)
 {
     delete m_credential;
     m_credential = NULL;
@@ -80,7 +151,12 @@ void CredentialCriteria::setKeyInfo(const xmlsignature::KeyInfo* keyInfo, int ex
         if (xcred)
             xcred->extract();
     }
-} 
+}
+
+DSIGKeyInfoList* CredentialCriteria::getNativeKeyInfo() const
+{
+    return m_nativeKeyInfo;
+}
 
 void CredentialCriteria::setNativeKeyInfo(DSIGKeyInfoList* keyInfo, int extraction)
 {
@@ -102,10 +178,10 @@ void CredentialCriteria::setNativeKeyInfo(DSIGKeyInfoList* keyInfo, int extracti
     }
 }
 
-void CredentialCriteria::setSignature(const xmlsignature::Signature& sig, int extraction)
+void CredentialCriteria::setSignature(const Signature& sig, int extraction)
 {
     setXMLAlgorithm(sig.getSignatureAlgorithm());
-    xmlsignature::KeyInfo* k = sig.getKeyInfo();
+    KeyInfo* k = sig.getKeyInfo();
     if (k)
         return setKeyInfo(k, extraction);
     DSIGSignature* dsig = sig.getXMLSignature();
index 75585d5..58c135c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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 @@
 /**
  * CredentialResolver.cpp
  * 
- * Registration of factories for built-in resolvers
+ * An API for resolving keys and certificates based on application criteria.
  */
 
 #include "internal.h"
@@ -36,3 +36,11 @@ void XMLTOOL_API xmltooling::registerCredentialResolvers()
     conf.CredentialResolverManager.registerFactory(FILESYSTEM_CREDENTIAL_RESOLVER, FilesystemCredentialResolverFactory);
     conf.CredentialResolverManager.registerFactory(CHAINING_CREDENTIAL_RESOLVER, ChainingCredentialResolverFactory);
 }
+
+CredentialResolver::CredentialResolver()
+{
+}
+
+CredentialResolver::~CredentialResolver()
+{
+}
index 2ae0edd..d7dd073 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2008 Internet2
+ *  Copyright 2001-2009 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 @@
 /**
  * FilesystemCredentialResolver.cpp
  *
- * Supplies credentials from local files
+ * Supplies credentials from local files.
  */
 
 #include "internal.h"
 #include "security/KeyInfoResolver.h"
 #include "security/OpenSSLCredential.h"
 #include "security/SecurityHelper.h"
+#include "security/XSECCryptoX509CRL.h"
 #include "util/NDC.h"
 #include "util/PathResolver.h"
+#include "util/Threads.h"
 #include "util/XMLHelper.h"
 
+#include <algorithm>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <openssl/pkcs12.h>
index f437ac4..252539b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
 #include "security/BasicX509Credential.h"
 #include "security/KeyInfoCredentialContext.h"
 #include "security/KeyInfoResolver.h"
+#include "security/XSECCryptoX509CRL.h"
 #include "signature/KeyInfo.h"
 #include "signature/Signature.h"
 #include "util/NDC.h"
index 8e28538..0700fb8 100644 (file)
@@ -17,7 +17,7 @@
 /**
  * KeyInfoResolver.cpp
  * 
- * Registration of factories for built-in resolvers
+ * Resolves credentials from KeyInfo information.
  */
 
 #include "internal.h"
@@ -39,6 +39,14 @@ void XMLTOOL_API xmltooling::registerKeyInfoResolvers()
     conf.KeyInfoResolverManager.registerFactory(INLINE_KEYINFO_RESOLVER, InlineKeyInfoResolverFactory);
 }
 
+KeyInfoResolver::KeyInfoResolver()
+{
+}
+
+KeyInfoResolver::~KeyInfoResolver()
+{
+}
+
 Credential* KeyInfoResolver::resolve(const Signature* sig, int types) const
 {
     const KeyInfo* keyInfo = sig->getKeyInfo();
index fc8f7c6..54dd804 100644 (file)
@@ -34,6 +34,10 @@ XSEC_USING_XERCES(Janitor);
 
 using namespace xmltooling;
 
+OpenSSLCryptoX509CRL::OpenSSLCryptoX509CRL() : mp_X509CRL(NULL), m_DERX509CRL("")
+{
+}
+
 OpenSSLCryptoX509CRL::~OpenSSLCryptoX509CRL()
 {
        if (mp_X509CRL)
@@ -73,7 +77,13 @@ OpenSSLCryptoX509CRL::OpenSSLCryptoX509CRL(X509_CRL* x) {
        BIO_free_all(b64);
 }
 
-void OpenSSLCryptoX509CRL::loadX509CRLBase64Bin(const char* buf, unsigned int len) {
+const XMLCh* OpenSSLCryptoX509CRL::getProviderName() const
+{
+    return DSIGConstants::s_unicodeStrPROVOpenSSL;
+}
+
+void OpenSSLCryptoX509CRL::loadX509CRLBase64Bin(const char* buf, unsigned int len)
+{
 
        // Free anything currently held.
        
@@ -111,6 +121,16 @@ void OpenSSLCryptoX509CRL::loadX509CRLBase64Bin(const char* buf, unsigned int le
 
 }
 
+safeBuffer& OpenSSLCryptoX509CRL::getDEREncodingSB()
+{
+    return m_DERX509CRL;
+}
+
+X509_CRL* OpenSSLCryptoX509CRL::getOpenSSLX509CRL()
+{
+    return mp_X509CRL;
+}
+
 XSECCryptoX509CRL* OpenSSLCryptoX509CRL::clone() const
 {
     OpenSSLCryptoX509CRL* copy = new OpenSSLCryptoX509CRL();
index 1c67741..d00a611 100644 (file)
@@ -22,7 +22,8 @@
 
 #include "internal.h"
 #include "security/KeyInfoResolver.h"
-#include "security/TrustEngine.h"
+#include "security/SignatureTrustEngine.h"
+#include "security/OpenSSLTrustEngine.h"
 #include "util/XMLHelper.h"
 
 #include <xercesc/util/XMLUniDefs.hpp>
@@ -65,3 +66,27 @@ TrustEngine::~TrustEngine()
 {
     delete m_keyInfoResolver;
 }
+
+SignatureTrustEngine::SignatureTrustEngine(const DOMElement* e) : TrustEngine(e)
+{
+}
+
+SignatureTrustEngine::~SignatureTrustEngine()
+{
+}
+
+X509TrustEngine::X509TrustEngine(const DOMElement* e) : TrustEngine(e)
+{
+}
+
+X509TrustEngine::~X509TrustEngine()
+{
+}
+
+OpenSSLTrustEngine::OpenSSLTrustEngine(const DOMElement* e) : X509TrustEngine(e)
+{
+}
+
+OpenSSLTrustEngine::~OpenSSLTrustEngine()
+{
+}
index 787a101..8111609 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2007 The Apache Software Foundation.
+ * Copyright 2001-2009 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.
 
 using namespace xmltooling;
 
+XSECCryptoX509CRL::XSECCryptoX509CRL()
+{
+}
+
+XSECCryptoX509CRL::~XSECCryptoX509CRL()
+{
+}
+
 void XSECCryptoX509CRL::loadX509CRLPEM(const char* buf, unsigned int len)
 {
        const char * b;
index a24c9d0..f902ee4 100644 (file)
@@ -35,7 +35,7 @@ namespace xmlsignature {
     {
         MAKE_NONCOPYABLE(ContentReference);
     public:
-        virtual ~ContentReference() {}
+        virtual ~ContentReference();
 
         /**
          * Given a native signature, asks the object to create the reference(s).
@@ -46,7 +46,7 @@ namespace xmlsignature {
         
     protected:
         /** Default constructor. */
-        ContentReference() {}
+        ContentReference();
     };
 };
 
index 58b5570..007f78b 100644 (file)
@@ -23,8 +23,8 @@
 #if !defined(__xmltooling_sig_h__) && !defined(XMLTOOLING_NO_XMLSEC)
 #define __xmltooling_sig_h__
 
-#include <xmltooling/ConcreteXMLObjectBuilder.h>
 #include <xmltooling/exceptions.h>
+#include <xmltooling/ConcreteXMLObjectBuilder.h>
 
 class DSIGSignature;
 class XSECCryptoKey;
@@ -46,7 +46,7 @@ namespace xmlsignature {
     class XMLTOOL_API Signature : public virtual xmltooling::XMLObject
     {
     public:
-        virtual ~Signature() {}
+        virtual ~Signature();
 
         /** Element local name */
         static const XMLCh LOCAL_NAME[];
@@ -195,7 +195,7 @@ namespace xmlsignature {
 
     protected:
         /** Default constructor. */
-        Signature() {}
+        Signature();
     };
 
     /**
index e948e40..f4f23e6 100644 (file)
@@ -17,7 +17,7 @@
 /**
  * @file xmltooling/signature/SignatureValidator.h
  * 
- * Validator for signatures based on an externally-supplied key 
+ * Validator for signatures based on an externally-supplied key.
  */
 
 #if !defined(__xmltooling_sigval_h__) && !defined(XMLTOOLING_NO_XMLSEC)
@@ -55,7 +55,7 @@ namespace xmlsignature {
          */
         SignatureValidator(const xmltooling::Credential* credential);
 
-        virtual ~SignatureValidator() {}
+        virtual ~SignatureValidator();
 
         void validate(const xmltooling::XMLObject* xmlObject) const;
 
index 32b12a7..22684ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright 2001-2007 Internet2
+*  Copyright 2001-2009 Internet2
  * 
 * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 #include "internal.h"
 #include "exceptions.h"
 #include "signature/KeyInfo.h"
+#include "validation/Validator.h"
 #include "validation/ValidatorSuite.h"
 
 using namespace xmlsignature;
index 4c7df2b..3fbd883 100644 (file)
@@ -40,6 +40,10 @@ SignatureValidator::SignatureValidator(const Credential* credential) : m_key(NUL
 {
 }
 
+SignatureValidator::~SignatureValidator()
+{
+}
+
 void SignatureValidator::setKey(XSECCryptoKey* key)
 {
     m_key = key;
index 1ef0838..7bce903 100644 (file)
@@ -53,12 +53,12 @@ using namespace std;
 using xmlconstants::XMLSIG_NS;
 using xmlconstants::XMLSIG_PREFIX;
 
+namespace xmlsignature {
+
 #if defined (_MSC_VER)
     #pragma warning( push )
     #pragma warning( disable : 4250 4251 )
 #endif
-
-namespace xmlsignature {
     
     class XMLTOOL_DLLLOCAL XMLSecSignatureImpl : public UnknownElementImpl, public virtual Signature
     {
@@ -129,12 +129,27 @@ namespace xmlsignature {
         mutable KeyInfo* m_keyInfo;
         ContentReference* m_reference;
     };
-    
-};
 
 #if defined (_MSC_VER)
     #pragma warning( pop )
 #endif
+};
+
+ContentReference::ContentReference()
+{
+}
+
+ContentReference::~ContentReference()
+{
+}
+
+Signature::Signature()
+{
+}
+
+Signature::~Signature()
+{
+}
 
 XMLSecSignatureImpl::~XMLSecSignatureImpl()
 {
index 3623f04..ed2171e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,9 +35,9 @@ namespace xmltooling {
     class XMLTOOL_API HTTPSOAPTransport : public virtual SOAPTransport 
     {
     protected:
-        HTTPSOAPTransport() {}
+        HTTPSOAPTransport();
     public:
-        virtual ~HTTPSOAPTransport() {}
+        virtual ~HTTPSOAPTransport();
         
         /**
          * Indicate whether content should be sent using HTTP 1.1 and
index 13bdc59..eb38ef0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,9 +35,9 @@ namespace xmltooling {
     class XMLTOOL_API OpenSSLSOAPTransport : public virtual SOAPTransport 
     {
     protected:
-        OpenSSLSOAPTransport() {}
+        OpenSSLSOAPTransport();
     public:
-        virtual ~OpenSSLSOAPTransport() {}
+        virtual ~OpenSSLSOAPTransport();
         
         /** OpenSSL context callback for manipulating credentials and validation behavior. */
         typedef bool (*ssl_ctx_callback_fn)(OpenSSLSOAPTransport* transport, SSL_CTX* ssl_ctx, void* userptr);
index 641040d..429f54f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2008 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
 #include <xmltooling/ConcreteXMLObjectBuilder.h>
 #include <xmltooling/ElementProxy.h>
 #include <xmltooling/util/XMLConstants.h>
-#include <xercesc/util/XMLUniDefs.hpp>
 
 /**
  * Macro for declaring SOAP builders.
index 963c396..3752adf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@
 #ifndef __xmltooling_soap11client_h__
 #define __xmltooling_soap11client_h__
 
-#include <xmltooling/security/CredentialResolver.h>
 #include <xmltooling/soap/SOAPTransport.h>
 
 namespace soap11 {
@@ -46,7 +45,7 @@ namespace soap11 {
          * 
          * @param validate  true iff schema validation should be used 
          */
-        SOAPClient(bool validate=false) : m_validate(validate), m_transport(NULL) {}
+        SOAPClient(bool validate=false);
         
         virtual ~SOAPClient();
         
@@ -57,9 +56,7 @@ namespace soap11 {
          * 
          * @param validate  true iff the client should use a validating XML parser
          */
-        void setValidating(bool validate=true) {
-            m_validate = validate;
-        }
+        void setValidating(bool validate=true);
         
         /**
          * Sends the supplied envelope to the identified recipient/endpoint.
@@ -97,7 +94,7 @@ namespace soap11 {
          * 
          * @param transport reference to transport layer
          */
-        virtual void prepareTransport(xmltooling::SOAPTransport& transport) {}
+        virtual void prepareTransport(xmltooling::SOAPTransport& transport);
 
         /**
          * Handling of SOAP faults.
index b2e7ef3..3a5c345 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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 {
     {
         MAKE_NONCOPYABLE(SOAPTransport);
     protected:
-        SOAPTransport() {}
+        SOAPTransport();
     public:
-        virtual ~SOAPTransport() {}
+        virtual ~SOAPTransport();
 
         /**
          * A simple structure to capture SOAP addressing information.
@@ -166,9 +166,7 @@ namespace xmltooling {
          * @param value     implementation- and option-specific string to use
          * @return  true iff the transport supports the option and value supplied
          */
-        virtual bool setProviderOption(const char* provider, const char* option, const char* value) {
-            return false;
-        }
+        virtual bool setProviderOption(const char* provider, const char* option, const char* value);
 
         /**
          * Sends a stream of data over the transport. The function may return without
index ebf6f85..62d00e2 100644 (file)
@@ -264,6 +264,35 @@ void xmltooling::termSOAPTransports()
     g_CURLPool = NULL;
 }
 
+SOAPTransport::SOAPTransport()
+{
+}
+
+SOAPTransport::~SOAPTransport()
+{
+}
+
+bool SOAPTransport::setProviderOption(const char* provider, const char* option, const char* value)
+{
+    return false;
+}
+
+HTTPSOAPTransport::HTTPSOAPTransport()
+{
+}
+
+HTTPSOAPTransport::~HTTPSOAPTransport()
+{
+}
+
+OpenSSLSOAPTransport::OpenSSLSOAPTransport()
+{
+}
+
+OpenSSLSOAPTransport::~OpenSSLSOAPTransport()
+{
+}
+
 CURLPool::~CURLPool()
 {
     for (poolmap_t::iterator i=m_bindingMap.begin(); i!=m_bindingMap.end(); i++) {
index 43e4c19..8eaeaed 100644 (file)
@@ -36,11 +36,8 @@ using namespace xmltooling;
 using namespace xercesc;
 using namespace std;
 
-void SOAPTransport::send(istream* in)
+SOAPClient::SOAPClient(bool validate) : m_validate(validate), m_transport(NULL)
 {
-    if (!in)
-        throw IOException("SOAP transport does not support an empty request body.");
-    return send(*in);
 }
 
 SOAPClient::~SOAPClient()
@@ -48,12 +45,24 @@ SOAPClient::~SOAPClient()
     delete m_transport;
 }
 
+void SOAPClient::setValidating(bool validate)
+{
+    m_validate = validate;
+}
+
 void SOAPClient::reset()
 {
     delete m_transport;
     m_transport=NULL;
 }
 
+void SOAPTransport::send(istream* in)
+{
+    if (!in)
+        throw IOException("SOAP transport does not support an empty request body.");
+    return send(*in);
+}
+
 void SOAPClient::send(const Envelope& env, const SOAPTransport::Address& addr)
 {
     // Prepare a transport object.
@@ -128,6 +137,10 @@ Envelope* SOAPClient::receive()
     return env;
 }
 
+void SOAPClient::prepareTransport(SOAPTransport& transport)
+{
+}
+
 bool SOAPClient::handleFault(const Fault& fault)
 {
     const xmltooling::QName* code = (fault.getFaultcode() ? fault.getFaultcode()->getCode() : NULL);
index be701b8..8bea6d6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright 2001-2007 Internet2
+*  Copyright 2001-2009 Internet2
  * 
 * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 /**
  * SOAPSchemaValidators.cpp
  * 
- * Schema validators for SOAP schema
+ * Schema validators for SOAP schema.
  */
 
 #include "internal.h"
 #include "exceptions.h"
 #include "soap/SOAP.h"
+#include "validation/Validator.h"
 #include "validation/ValidatorSuite.h"
 
 using namespace soap11;
index ffe55cf..9183420 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1555,3 +1555,72 @@ void DateTime::searchMiliSeconds(XMLCh*& miliStartPtr, XMLCh*& miliEndPtr) const
     return;
 }
 
+void DateTime::setBuffer(const XMLCh* const aString)
+{
+    reset();
+    fEnd = (int) xercesc::XMLString::stringLen(aString);
+    if (fEnd > 0) {
+        if (fEnd > fBufferMaxLen) {
+            delete[] fBuffer;
+            fBufferMaxLen = fEnd + 8;
+            fBuffer = new XMLCh[fBufferMaxLen+1];
+        }
+        memcpy(fBuffer, aString, (fEnd+1) * sizeof(XMLCh));
+    }
+}
+
+void DateTime::reset()
+{
+    for ( int i=0; i < xercesc::XMLDateTime::TOTAL_SIZE; i++ )
+        fValue[i] = 0;
+
+    fMiliSecond   = 0;
+    fHasTime      = false;
+    fTimeZone[hh] = fTimeZone[mm] = 0;
+    fStart = fEnd = 0;
+
+    if (fBuffer)
+        *fBuffer = 0;
+}
+
+void DateTime::copy(const DateTime& rhs)
+{
+    for ( int i = 0; i < xercesc::XMLDateTime::TOTAL_SIZE; i++ )
+        fValue[i] = rhs.fValue[i];
+
+    fMiliSecond   = rhs.fMiliSecond;
+    fHasTime      = rhs.fHasTime;
+    fTimeZone[hh] = rhs.fTimeZone[hh];
+    fTimeZone[mm] = rhs.fTimeZone[mm];
+    fStart = rhs.fStart;
+    fEnd   = rhs.fEnd;
+
+    if (fEnd > 0) {
+        if (fEnd > fBufferMaxLen) {
+            delete[] fBuffer;
+            fBufferMaxLen = rhs.fBufferMaxLen;
+            fBuffer = new XMLCh[fBufferMaxLen+1];
+        }
+        memcpy(fBuffer, rhs.fBuffer, (fEnd+1) * sizeof(XMLCh));
+    }
+}
+
+void DateTime::initParser()
+{
+    fStart = 0;   // to ensure scan from the very first beginning
+                  // in case the pointer is updated accidentally by someone else.
+}
+
+bool DateTime::isNormalized() const
+{
+    return (fValue[xercesc::XMLDateTime::utc] == xercesc::XMLDateTime::UTC_STD ? true : false);
+}
+
+int DateTime::getRetVal(int c1, int c2)
+{
+    if ((c1 == xercesc::XMLDateTime::LESS_THAN && c2 == xercesc::XMLDateTime::GREATER_THAN) ||
+        (c1 == xercesc::XMLDateTime::GREATER_THAN && c2 == xercesc::XMLDateTime::LESS_THAN))
+        return xercesc::XMLDateTime::INDETERMINATE;
+
+    return (c1 != xercesc::XMLDateTime::INDETERMINATE) ? c1 : c2;
+}
index b3fa78f..7a1ced1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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
         DateTime& operator=(const DateTime&);
         ~DateTime();
 
-        inline void setBuffer(const XMLCh* const);
+        void setBuffer(const XMLCh* const);
 
         const XMLCh* getRawData() const;
         const XMLCh* getFormattedString() const;
@@ -117,14 +117,14 @@ namespace xmltooling
         static int compareResult(int, int, bool);
         static void addDuration(DateTime* pDuration, const DateTime* const pBaseDate, int index);
         static int compareResult(const DateTime* const, const DateTime* const, bool, int);
-        static inline int getRetVal(int, int);
+        static int getRetVal(int, int);
 
-        inline void reset();
+        void reset();
         //inline void assertBuffer() const;
-        inline void copy(const DateTime&);
+        void copy(const DateTime&);
 
-        inline void initParser();
-        inline bool isNormalized() const;
+        void initParser();
+        bool isNormalized() const;
 
         void getDate();
         void getTime();
@@ -157,77 +157,6 @@ namespace xmltooling
         double fMiliSecond;
         bool fHasTime;
     };
-
-    inline void DateTime::setBuffer(const XMLCh* const aString)
-    {
-        reset();
-        fEnd = (int) xercesc::XMLString::stringLen(aString);
-        if (fEnd > 0) {
-            if (fEnd > fBufferMaxLen) {
-                delete[] fBuffer;
-                fBufferMaxLen = fEnd + 8;
-                fBuffer = new XMLCh[fBufferMaxLen+1];
-            }
-            memcpy(fBuffer, aString, (fEnd+1) * sizeof(XMLCh));
-        }
-    }
-
-    inline void DateTime::reset()
-    {
-        for ( int i=0; i < xercesc::XMLDateTime::TOTAL_SIZE; i++ )
-            fValue[i] = 0;
-
-        fMiliSecond   = 0;
-        fHasTime      = false;
-        fTimeZone[hh] = fTimeZone[mm] = 0;
-        fStart = fEnd = 0;
-
-        if (fBuffer)
-            *fBuffer = 0;
-    }
-
-    inline void DateTime::copy(const DateTime& rhs)
-    {
-        for ( int i = 0; i < xercesc::XMLDateTime::TOTAL_SIZE; i++ )
-            fValue[i] = rhs.fValue[i];
-
-        fMiliSecond   = rhs.fMiliSecond;
-        fHasTime      = rhs.fHasTime;
-        fTimeZone[hh] = rhs.fTimeZone[hh];
-        fTimeZone[mm] = rhs.fTimeZone[mm];
-        fStart = rhs.fStart;
-        fEnd   = rhs.fEnd;
-
-        if (fEnd > 0) {
-            if (fEnd > fBufferMaxLen) {
-                delete[] fBuffer;
-                fBufferMaxLen = rhs.fBufferMaxLen;
-                fBuffer = new XMLCh[fBufferMaxLen+1];
-            }
-            memcpy(fBuffer, rhs.fBuffer, (fEnd+1) * sizeof(XMLCh));
-        }
-    }
-
-    inline void DateTime::initParser()
-    {
-        fStart = 0;   // to ensure scan from the very first beginning
-                      // in case the pointer is updated accidentally by someone else.
-    }
-
-    inline bool DateTime::isNormalized() const
-    {
-        return (fValue[xercesc::XMLDateTime::utc] == xercesc::XMLDateTime::UTC_STD ? true : false);
-    }
-
-    inline int DateTime::getRetVal(int c1, int c2)
-    {
-        if ((c1 == xercesc::XMLDateTime::LESS_THAN && c2 == xercesc::XMLDateTime::GREATER_THAN) ||
-            (c1 == xercesc::XMLDateTime::GREATER_THAN && c2 == xercesc::XMLDateTime::LESS_THAN))
-            return xercesc::XMLDateTime::INDETERMINATE;
-
-        return (c1 != xercesc::XMLDateTime::INDETERMINATE) ? c1 : c2;
-    }
-
 }
 
 #endif /* __xmltool_datetime_h__ */
index 25e4324..6da2911 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2008 Internet2
+ *  Copyright 2001-2009 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
 #include "util/CurlURLInputStream.h"
 #include "util/NDC.h"
 #include "util/ParserPool.h"
+#include "util/Threads.h"
 #include "util/XMLHelper.h"
 
 #include <algorithm>
@@ -440,6 +441,36 @@ void ParserPool::checkinBuilder(DOMBuilder* builder)
 
 #endif
 
+StreamInputSource::StreamInputSource(istream& is, const char* systemId) : InputSource(systemId), m_is(is)
+{
+}
+
+BinInputStream* StreamInputSource::makeStream() const
+{
+    return new StreamBinInputStream(m_is);
+}
+
+StreamInputSource::StreamBinInputStream::StreamBinInputStream(istream& is) : m_is(is), m_pos(0)
+{
+}
+
+#ifdef XMLTOOLING_XERCESC_64BITSAFE
+XMLFilePos
+#else
+unsigned int
+#endif
+StreamInputSource::StreamBinInputStream::curPos() const
+{
+    return m_pos;
+}
+
+#ifdef XMLTOOLING_XERCESC_64BITSAFE
+const XMLCh* StreamInputSource::StreamBinInputStream::getContentType() const
+{
+    return NULL;
+}
+#endif
+
 xsecsize_t StreamInputSource::StreamBinInputStream::readBytes(XMLByte* const toFill, const xsecsize_t maxToRead)
 {
     XMLByte* target=toFill;
index e901a02..87ba21e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2008 Internet2
+ *  Copyright 2001-2009 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@
 #define __xmltooling_pool_h__
 
 #include <xmltooling/unicode.h>
-#include <xmltooling/util/Threads.h>
 
 #include <map>
 #include <stack>
@@ -46,6 +45,8 @@
 
 namespace xmltooling {
 
+    class XMLTOOL_API Mutex;
+
     /**
      * A thread-safe pool of DOMBuilders that share characteristics.
      */
@@ -176,9 +177,9 @@ 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) : xercesc::InputSource(systemId), m_is(is) {}
+        StreamInputSource(std::istream& is, const char* systemId=NULL);
         /// @cond off
-        virtual xercesc::BinInputStream* makeStream() const { return new StreamBinInputStream(m_is); }
+        xercesc::BinInputStream* makeStream() const;
         /// @endcond
 
         /**
@@ -192,18 +193,15 @@ namespace xmltooling {
              *
              * @param is            reference to an input stream
              */
-            StreamBinInputStream(std::istream& is) : m_is(is), m_pos(0) {}
+            StreamBinInputStream(std::istream& is);
             /// @cond off
 #ifdef XMLTOOLING_XERCESC_64BITSAFE
-            XMLFilePos
+            XMLFilePos curPos() const;
+            const XMLCh* getContentType() const;
 #else
-            unsigned int
+            unsigned int curPos() const;
 #endif
-                curPos() const { return m_pos; }
             xsecsize_t readBytes(XMLByte* const toFill, const xsecsize_t maxToRead);
-#ifdef XMLTOOLING_XERCESC_64BITSAFE
-            const XMLCh* getContentType() const { return NULL; }
-#endif
             /// @endcond
         private:
             std::istream& m_is;
index ff69c40..c0f2c11 100644 (file)
@@ -36,6 +36,45 @@ PathResolver::PathResolver() : m_defaultPackage(PACKAGE_NAME), m_defaultPrefix("
     setCfgDir("/etc");
 }
 
+PathResolver::~PathResolver()
+{
+}
+
+void PathResolver::setDefaultPackageName(const char* pkgname)
+{
+    m_defaultPackage = pkgname;
+}
+
+void PathResolver::setDefaultPrefix(const char* prefix)
+{
+    m_defaultPrefix = prefix;
+}
+
+void PathResolver::setLibDir(const char* dir)
+{
+    m_lib = dir;
+}
+
+void PathResolver::setLogDir(const char* dir)
+{
+    m_log = dir;
+}
+
+void PathResolver::setXMLDir(const char* dir)
+{
+    m_xml = dir;
+}
+
+void PathResolver::setRunDir(const char* dir)
+{
+    m_run = dir;
+}
+
+void PathResolver::setCfgDir(const char* dir)
+{
+    m_cfg = dir;
+}
+
 bool PathResolver::isAbsolute(const char* s) const
 {
     switch (*s) {
index 80ce6c4..a6b6363 100644 (file)
@@ -36,7 +36,7 @@ namespace xmltooling {
         MAKE_NONCOPYABLE(PathResolver);
     public:
         PathResolver();
-        virtual ~PathResolver() {}
+        virtual ~PathResolver();
 
         /** Types of file resources to resolve. */
         enum file_type_t {
@@ -52,18 +52,14 @@ namespace xmltooling {
          *
          * @param pkgname name of default package to use
          */
-        virtual void setDefaultPackageName(const char* pkgname) {
-            m_defaultPackage = pkgname;
-        }
+        virtual void setDefaultPackageName(const char* pkgname);
 
         /**
          * Set the default installation prefix to use when resolving files.
          *
          * @param prefix name of default prefix to use
          */
-        virtual void setDefaultPrefix(const char* prefix) {
-            m_defaultPrefix = prefix;
-        }
+        virtual void setDefaultPrefix(const char* prefix);
 
         /**
          * Set the lib directory to use when resolving files.
@@ -71,9 +67,7 @@ namespace xmltooling {
          *
          * @param dir    the library directory to use
          */
-        virtual void setLibDir(const char* dir) {
-            m_lib = dir;
-        }
+        virtual void setLibDir(const char* dir);
 
         /**
          * Set the log directory to use when resolving files.
@@ -81,9 +75,7 @@ namespace xmltooling {
          *
          * @param dir    the log directory to use
          */
-        virtual void setLogDir(const char* dir) {
-            m_log = dir;
-        }
+        virtual void setLogDir(const char* dir);
 
         /**
          * Set the XML directory to use when resolving files.
@@ -91,9 +83,7 @@ namespace xmltooling {
          *
          * @param dir    the XML directory to use
          */
-        virtual void setXMLDir(const char* dir) {
-            m_xml = dir;
-        }
+        virtual void setXMLDir(const char* dir);
 
         /**
          * Set the run directory to use when resolving files.
@@ -101,9 +91,7 @@ namespace xmltooling {
          *
          * @param dir    the run directory to use
          */
-        virtual void setRunDir(const char* dir) {
-            m_run = dir;
-        }
+        virtual void setRunDir(const char* dir);
 
         /**
          * Set the config directory to use when resolving files.
@@ -111,9 +99,7 @@ namespace xmltooling {
          *
          * @param dir    the config directory to use
          */
-        virtual void setCfgDir(const char* dir) {
-            m_cfg = dir;
-        }
+        virtual void setCfgDir(const char* dir);
 
         /**
          * Changes the input filename into an absolute pathname to the same file.
index 0ea5ca5..726ad74 100644 (file)
-/*\r
- *  Copyright 2001-2009 Internet2\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-/**\r
- * @file ReloadableXMLFile.cpp\r
- *\r
- * Base class for file-based XML configuration.\r
- */\r
-\r
-#include "internal.h"\r
-#include "util/NDC.h"\r
-#include "util/PathResolver.h"\r
-#include "util/ReloadableXMLFile.h"\r
-#include "util/XMLConstants.h"\r
-#include "util/XMLHelper.h"\r
-\r
-#include <fstream>\r
-#include <sys/types.h>\r
-#include <sys/stat.h>\r
-\r
-#include <xercesc/framework/LocalFileInputSource.hpp>\r
-#include <xercesc/framework/Wrapper4InputSource.hpp>\r
-#include <xercesc/util/XMLUniDefs.hpp>\r
-\r
-using namespace xmltooling::logging;\r
-using namespace xmltooling;\r
-using namespace xercesc;\r
-using namespace std;\r
-\r
-static const XMLCh uri[] =              UNICODE_LITERAL_3(u,r,i);\r
-static const XMLCh url[] =              UNICODE_LITERAL_3(u,r,l);\r
-static const XMLCh path[] =             UNICODE_LITERAL_4(p,a,t,h);\r
-static const XMLCh pathname[] =         UNICODE_LITERAL_8(p,a,t,h,n,a,m,e);\r
-static const XMLCh file[] =             UNICODE_LITERAL_4(f,i,l,e);\r
-static const XMLCh filename[] =         UNICODE_LITERAL_8(f,i,l,e,n,a,m,e);\r
-static const XMLCh validate[] =         UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);\r
-static const XMLCh reloadChanges[] =    UNICODE_LITERAL_13(r,e,l,o,a,d,C,h,a,n,g,e,s);\r
-static const XMLCh reloadInterval[] =   UNICODE_LITERAL_14(r,e,l,o,a,d,I,n,t,e,r,v,a,l);\r
-static const XMLCh backingFilePath[] =  UNICODE_LITERAL_15(b,a,c,k,i,n,g,F,i,l,e,P,a,t,h);\r
-\r
+/*
+ *  Copyright 2001-2009 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file ReloadableXMLFile.cpp
+ *
+ * Base class for file-based XML configuration.
+ */
+
+#include "internal.h"
+#include "util/NDC.h"
+#include "util/PathResolver.h"
+#include "util/ReloadableXMLFile.h"
+#include "util/Threads.h"
+#include "util/XMLConstants.h"
+#include "util/XMLHelper.h"
+
+#include <fstream>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <xercesc/framework/LocalFileInputSource.hpp>
+#include <xercesc/framework/Wrapper4InputSource.hpp>
+#include <xercesc/util/XMLUniDefs.hpp>
+
+using namespace xmltooling::logging;
+using namespace xmltooling;
+using namespace xercesc;
+using namespace std;
+
+static const XMLCh uri[] =              UNICODE_LITERAL_3(u,r,i);
+static const XMLCh url[] =              UNICODE_LITERAL_3(u,r,l);
+static const XMLCh path[] =             UNICODE_LITERAL_4(p,a,t,h);
+static const XMLCh pathname[] =         UNICODE_LITERAL_8(p,a,t,h,n,a,m,e);
+static const XMLCh file[] =             UNICODE_LITERAL_4(f,i,l,e);
+static const XMLCh filename[] =         UNICODE_LITERAL_8(f,i,l,e,n,a,m,e);
+static const XMLCh validate[] =         UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);
+static const XMLCh reloadChanges[] =    UNICODE_LITERAL_13(r,e,l,o,a,d,C,h,a,n,g,e,s);
+static const XMLCh reloadInterval[] =   UNICODE_LITERAL_14(r,e,l,o,a,d,I,n,t,e,r,v,a,l);
+static const XMLCh backingFilePath[] =  UNICODE_LITERAL_15(b,a,c,k,i,n,g,F,i,l,e,P,a,t,h);
+
 
 ReloadableXMLFile::~ReloadableXMLFile()
 {
     delete m_lock;
 }
-\r
-ReloadableXMLFile::ReloadableXMLFile(const DOMElement* e, Category& log)\r
-    : m_root(e), m_local(true), m_validate(false), m_filestamp(0), m_reloadInterval(0), m_lock(NULL), m_log(log)\r
-{\r
-#ifdef _DEBUG\r
-    NDC ndc("ReloadableXMLFile");\r
-#endif\r
-\r
-    // Establish source of data...\r
-    const XMLCh* source=e->getAttributeNS(NULL,uri);\r
-    if (!source || !*source) {\r
-        source=e->getAttributeNS(NULL,url);\r
-        if (!source || !*source) {\r
-            source=e->getAttributeNS(NULL,path);\r
-            if (!source || !*source) {\r
-                source=e->getAttributeNS(NULL,pathname);\r
-                if (!source || !*source) {\r
-                    source=e->getAttributeNS(NULL,file);\r
-                    if (!source || !*source) {\r
-                        source=e->getAttributeNS(NULL,filename);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        else\r
-            m_local=false;\r
-    }\r
-    else\r
-        m_local=false;\r
-\r
-    if (source && *source) {\r
-        const XMLCh* flag=e->getAttributeNS(NULL,validate);\r
-        m_validate=(XMLString::equals(flag,xmlconstants::XML_TRUE) || XMLString::equals(flag,xmlconstants::XML_ONE));\r
-\r
-        auto_ptr_char temp(source);\r
-        m_source=temp.get();\r
-\r
-        if (!m_local && !strstr(m_source.c_str(),"://")) {\r
-            log.warn("deprecated usage of uri/url attribute for a local resource, use path instead");\r
-            m_local=true;\r
-        }\r
-\r
-        if (m_local) {\r
-            XMLToolingConfig::getConfig().getPathResolver()->resolve(m_source, PathResolver::XMLTOOLING_CFG_FILE);\r
-\r
-            flag=e->getAttributeNS(NULL,reloadChanges);\r
-            if (!XMLString::equals(flag,xmlconstants::XML_FALSE) && !XMLString::equals(flag,xmlconstants::XML_ZERO)) {\r
-#ifdef WIN32\r
-                struct _stat stat_buf;\r
-                if (_stat(m_source.c_str(), &stat_buf) == 0)\r
-#else\r
-                struct stat stat_buf;\r
-                if (stat(m_source.c_str(), &stat_buf) == 0)\r
-#endif\r
-                    m_filestamp=stat_buf.st_mtime;\r
-                else\r
-                    throw IOException("Unable to access local file ($1)", params(1,m_source.c_str()));\r
-                m_lock=RWLock::create();\r
-            }\r
-            log.debug("using local resource (%s), will %smonitor for changes", m_source.c_str(), m_lock ? "" : "not ");\r
-        }\r
-        else {\r
-            log.debug("using remote resource (%s)", m_source.c_str());\r
-            source = e->getAttributeNS(NULL,backingFilePath);\r
-            if (source && *source) {\r
-                auto_ptr_char temp2(source);\r
-                m_backing=temp2.get();\r
-                XMLToolingConfig::getConfig().getPathResolver()->resolve(m_backing, PathResolver::XMLTOOLING_RUN_FILE);\r
-                log.debug("backup remote resource with (%s)", m_backing.c_str());\r
-            }\r
-            source = e->getAttributeNS(NULL,reloadInterval);\r
-            if (source && *source) {\r
-                m_reloadInterval = XMLString::parseInt(source);\r
-                if (m_reloadInterval > 0) {\r
-                    m_log.debug("will reload remote resource at most every %d seconds", m_reloadInterval);\r
-                    m_lock=RWLock::create();\r
-                }\r
-            }\r
-            m_filestamp = time(NULL);   // assume it gets loaded initially\r
-        }\r
-    }\r
-    else {\r
-        log.debug("no resource uri/path/name supplied, will load inline configuration");\r
-    }\r
-}\r
-\r
-pair<bool,DOMElement*> ReloadableXMLFile::load(bool backup)\r
-{\r
-#ifdef _DEBUG\r
-    NDC ndc("init");\r
-#endif\r
-\r
-    try {\r
-        if (m_source.empty()) {\r
-            // Data comes from the DOM we were handed.\r
-            m_log.debug("loading inline configuration...");\r
-            return make_pair(false,XMLHelper::getFirstChildElement(m_root));\r
-        }\r
-        else {\r
-            // Data comes from a file we have to parse.\r
-            if (backup)\r
-                m_log.warn("using local backup of remote resource");\r
-            else\r
-                m_log.debug("loading configuration from external resource...");\r
-\r
-            DOMDocument* doc=NULL;\r
-            if (m_local || backup) {\r
-                auto_ptr_XMLCh widenit(backup ? m_backing.c_str() : m_source.c_str());\r
-                LocalFileInputSource src(widenit.get());\r
-                Wrapper4InputSource dsrc(&src,false);\r
-                if (m_validate)\r
-                    doc=XMLToolingConfig::getConfig().getValidatingParser().parse(dsrc);\r
-                else\r
-                    doc=XMLToolingConfig::getConfig().getParser().parse(dsrc);\r
-            }\r
-            else {\r
-                URLInputSource src(m_root);\r
-                Wrapper4InputSource dsrc(&src,false);\r
-                if (m_validate)\r
-                    doc=XMLToolingConfig::getConfig().getValidatingParser().parse(dsrc);\r
-                else\r
-                    doc=XMLToolingConfig::getConfig().getParser().parse(dsrc);\r
-            }\r
-\r
-            m_log.infoStream() << "loaded XML resource (" << (backup ? m_backing : m_source) << ")" << logging::eol;\r
-\r
-            if (!backup && !m_backing.empty()) {\r
-                m_log.debug("backing up remote resource to (%s)", m_backing.c_str());\r
-                try {\r
-                    ofstream backer(m_backing.c_str());\r
-                    backer << *doc;\r
-                }\r
-                catch (exception& ex) {\r
-                    m_log.crit("exception while backing up resource: %s", ex.what());\r
-                }\r
-            }\r
-\r
-            return make_pair(true,doc->getDocumentElement());\r
-        }\r
-    }\r
-    catch (XMLException& e) {\r
-        auto_ptr_char msg(e.getMessage());\r
-        m_log.errorStream() << "Xerces error while loading resource (" << (backup ? m_backing : m_source) << "): "\r
-            << msg.get() << logging::eol;\r
-        if (!backup && !m_backing.empty())\r
-            return load(true);\r
-        throw XMLParserException(msg.get());\r
-    }\r
-    catch (exception& e) {\r
-        m_log.errorStream() << "error while loading configuration from ("\r
-            << (m_source.empty() ? "inline" : (backup ? m_backing : m_source)) << "): " << e.what() << logging::eol;\r
-        if (!backup && !m_backing.empty())\r
-            return load(true);\r
-        throw;\r
-    }\r
-}\r
-\r
-Lockable* ReloadableXMLFile::lock()\r
-{\r
-    if (!m_lock)\r
-        return this;\r
-\r
-    m_lock->rdlock();\r
-\r
-    // Check if we need to refresh.\r
-    if (m_local) {\r
-#ifdef WIN32\r
-        struct _stat stat_buf;\r
-        if (_stat(m_source.c_str(), &stat_buf) != 0)\r
-            return this;\r
-#else\r
-        struct stat stat_buf;\r
-        if (stat(m_source.c_str(), &stat_buf) != 0)\r
-            return this;\r
-#endif\r
-        if (m_filestamp>=stat_buf.st_mtime)\r
-            return this;\r
-\r
-        // Elevate lock and recheck.\r
-        m_log.debug("timestamp of local resource changed, elevating to a write lock");\r
-        m_lock->unlock();\r
-        m_lock->wrlock();\r
-        if (m_filestamp>=stat_buf.st_mtime) {\r
-            // Somebody else handled it, just downgrade.\r
-            m_log.debug("update of local resource handled by another thread, downgrading lock");\r
-            m_lock->unlock();\r
-            m_lock->rdlock();\r
-            return this;\r
-        }\r
-\r
-        // Update the timestamp regardless. No point in repeatedly trying.\r
-        m_filestamp=stat_buf.st_mtime;\r
-        m_log.info("change detected, reloading local resource...");\r
-    }\r
-    else {\r
-        time_t now = time(NULL);\r
-\r
-        // Time to reload? If we have no data, filestamp is zero\r
-        // and there's no way current time is less than the interval.\r
-        if (now - m_filestamp < m_reloadInterval)\r
-            return this;\r
-\r
-        // Elevate lock and recheck.\r
-        m_log.debug("reload interval for remote resource elapsed, elevating to a write lock");\r
-        m_lock->unlock();\r
-        m_lock->wrlock();\r
-        if (now - m_filestamp < m_reloadInterval) {\r
-            // Somebody else handled it, just downgrade.\r
-            m_log.debug("update of remote resource handled by another thread, downgrading lock");\r
-            m_lock->unlock();\r
-            m_lock->rdlock();\r
-            return this;\r
-        }\r
-\r
-        m_filestamp = now;\r
-        m_log.info("reloading remote resource...");\r
-    }\r
-\r
-    // Do this once...\r
-    try {\r
-        // At this point we're holding the write lock, so make sure we pop it.\r
-        SharedLock lockwrap(m_lock,false);\r
-        pair<bool,DOMElement*> ret=load();\r
-        if (ret.first)\r
-            ret.second->getOwnerDocument()->release();\r
-    } catch (exception& ex) {\r
-        m_log.crit("maintaining existing configuration, error reloading resource (%s): %s", m_source.c_str(), ex.what());\r
-    }\r
-\r
-    // If we made it here, the swap may or may not have worked, but we need to relock.\r
-    m_log.debug("attempt to update resource complete, relocking");\r
-    m_lock->rdlock();\r
-    return this;\r
-}\r
-\r
+
+ReloadableXMLFile::ReloadableXMLFile(const DOMElement* e, Category& log)
+    : m_root(e), m_local(true), m_validate(false), m_filestamp(0), m_reloadInterval(0), m_lock(NULL), m_log(log)
+{
+#ifdef _DEBUG
+    NDC ndc("ReloadableXMLFile");
+#endif
+
+    // Establish source of data...
+    const XMLCh* source=e->getAttributeNS(NULL,uri);
+    if (!source || !*source) {
+        source=e->getAttributeNS(NULL,url);
+        if (!source || !*source) {
+            source=e->getAttributeNS(NULL,path);
+            if (!source || !*source) {
+                source=e->getAttributeNS(NULL,pathname);
+                if (!source || !*source) {
+                    source=e->getAttributeNS(NULL,file);
+                    if (!source || !*source) {
+                        source=e->getAttributeNS(NULL,filename);
+                    }
+                }
+            }
+        }
+        else
+            m_local=false;
+    }
+    else
+        m_local=false;
+
+    if (source && *source) {
+        const XMLCh* flag=e->getAttributeNS(NULL,validate);
+        m_validate=(XMLString::equals(flag,xmlconstants::XML_TRUE) || XMLString::equals(flag,xmlconstants::XML_ONE));
+
+        auto_ptr_char temp(source);
+        m_source=temp.get();
+
+        if (!m_local && !strstr(m_source.c_str(),"://")) {
+            log.warn("deprecated usage of uri/url attribute for a local resource, use path instead");
+            m_local=true;
+        }
+
+        if (m_local) {
+            XMLToolingConfig::getConfig().getPathResolver()->resolve(m_source, PathResolver::XMLTOOLING_CFG_FILE);
+
+            flag=e->getAttributeNS(NULL,reloadChanges);
+            if (!XMLString::equals(flag,xmlconstants::XML_FALSE) && !XMLString::equals(flag,xmlconstants::XML_ZERO)) {
+#ifdef WIN32
+                struct _stat stat_buf;
+                if (_stat(m_source.c_str(), &stat_buf) == 0)
+#else
+                struct stat stat_buf;
+                if (stat(m_source.c_str(), &stat_buf) == 0)
+#endif
+                    m_filestamp=stat_buf.st_mtime;
+                else
+                    throw IOException("Unable to access local file ($1)", params(1,m_source.c_str()));
+                m_lock=RWLock::create();
+            }
+            log.debug("using local resource (%s), will %smonitor for changes", m_source.c_str(), m_lock ? "" : "not ");
+        }
+        else {
+            log.debug("using remote resource (%s)", m_source.c_str());
+            source = e->getAttributeNS(NULL,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 with (%s)", m_backing.c_str());
+            }
+            source = e->getAttributeNS(NULL,reloadInterval);
+            if (source && *source) {
+                m_reloadInterval = XMLString::parseInt(source);
+                if (m_reloadInterval > 0) {
+                    m_log.debug("will reload remote resource at most every %d seconds", m_reloadInterval);
+                    m_lock=RWLock::create();
+                }
+            }
+            m_filestamp = time(NULL);   // assume it gets loaded initially
+        }
+    }
+    else {
+        log.debug("no resource uri/path/name supplied, will load inline configuration");
+    }
+}
+
+pair<bool,DOMElement*> ReloadableXMLFile::load(bool backup)
+{
+#ifdef _DEBUG
+    NDC ndc("init");
+#endif
+
+    try {
+        if (m_source.empty()) {
+            // Data comes from the DOM we were handed.
+            m_log.debug("loading inline configuration...");
+            return make_pair(false,XMLHelper::getFirstChildElement(m_root));
+        }
+        else {
+            // Data comes from a file we have to parse.
+            if (backup)
+                m_log.warn("using local backup of remote resource");
+            else
+                m_log.debug("loading configuration from external resource...");
+
+            DOMDocument* doc=NULL;
+            if (m_local || backup) {
+                auto_ptr_XMLCh widenit(backup ? m_backing.c_str() : m_source.c_str());
+                LocalFileInputSource src(widenit.get());
+                Wrapper4InputSource dsrc(&src,false);
+                if (m_validate)
+                    doc=XMLToolingConfig::getConfig().getValidatingParser().parse(dsrc);
+                else
+                    doc=XMLToolingConfig::getConfig().getParser().parse(dsrc);
+            }
+            else {
+                URLInputSource src(m_root);
+                Wrapper4InputSource dsrc(&src,false);
+                if (m_validate)
+                    doc=XMLToolingConfig::getConfig().getValidatingParser().parse(dsrc);
+                else
+                    doc=XMLToolingConfig::getConfig().getParser().parse(dsrc);
+            }
+
+            m_log.infoStream() << "loaded XML resource (" << (backup ? m_backing : m_source) << ")" << logging::eol;
+
+            if (!backup && !m_backing.empty()) {
+                m_log.debug("backing up remote resource to (%s)", m_backing.c_str());
+                try {
+                    ofstream backer(m_backing.c_str());
+                    backer << *doc;
+                }
+                catch (exception& ex) {
+                    m_log.crit("exception while backing up resource: %s", ex.what());
+                }
+            }
+
+            return make_pair(true,doc->getDocumentElement());
+        }
+    }
+    catch (XMLException& e) {
+        auto_ptr_char msg(e.getMessage());
+        m_log.errorStream() << "Xerces error while loading resource (" << (backup ? m_backing : m_source) << "): "
+            << msg.get() << logging::eol;
+        if (!backup && !m_backing.empty())
+            return load(true);
+        throw XMLParserException(msg.get());
+    }
+    catch (exception& e) {
+        m_log.errorStream() << "error while loading configuration from ("
+            << (m_source.empty() ? "inline" : (backup ? m_backing : m_source)) << "): " << e.what() << logging::eol;
+        if (!backup && !m_backing.empty())
+            return load(true);
+        throw;
+    }
+}
+
+Lockable* ReloadableXMLFile::lock()
+{
+    if (!m_lock)
+        return this;
+
+    m_lock->rdlock();
+
+    // Check if we need to refresh.
+    if (m_local) {
+#ifdef WIN32
+        struct _stat stat_buf;
+        if (_stat(m_source.c_str(), &stat_buf) != 0)
+            return this;
+#else
+        struct stat stat_buf;
+        if (stat(m_source.c_str(), &stat_buf) != 0)
+            return this;
+#endif
+        if (m_filestamp>=stat_buf.st_mtime)
+            return this;
+
+        // Elevate lock and recheck.
+        m_log.debug("timestamp of local resource changed, elevating to a write lock");
+        m_lock->unlock();
+        m_lock->wrlock();
+        if (m_filestamp>=stat_buf.st_mtime) {
+            // Somebody else handled it, just downgrade.
+            m_log.debug("update of local resource handled by another thread, downgrading lock");
+            m_lock->unlock();
+            m_lock->rdlock();
+            return this;
+        }
+
+        // Update the timestamp regardless. No point in repeatedly trying.
+        m_filestamp=stat_buf.st_mtime;
+        m_log.info("change detected, reloading local resource...");
+    }
+    else {
+        time_t now = time(NULL);
+
+        // Time to reload? If we have no data, filestamp is zero
+        // and there's no way current time is less than the interval.
+        if (now - m_filestamp < m_reloadInterval)
+            return this;
+
+        // Elevate lock and recheck.
+        m_log.debug("reload interval for remote resource elapsed, elevating to a write lock");
+        m_lock->unlock();
+        m_lock->wrlock();
+        if (now - m_filestamp < m_reloadInterval) {
+            // Somebody else handled it, just downgrade.
+            m_log.debug("update of remote resource handled by another thread, downgrading lock");
+            m_lock->unlock();
+            m_lock->rdlock();
+            return this;
+        }
+
+        m_filestamp = now;
+        m_log.info("reloading remote resource...");
+    }
+
+    // Do this once...
+    try {
+        // At this point we're holding the write lock, so make sure we pop it.
+        SharedLock lockwrap(m_lock,false);
+        pair<bool,DOMElement*> ret=load();
+        if (ret.first)
+            ret.second->getOwnerDocument()->release();
+    } catch (exception& ex) {
+        m_log.crit("maintaining existing configuration, error reloading resource (%s): %s", m_source.c_str(), ex.what());
+    }
+
+    // If we made it here, the swap may or may not have worked, but we need to relock.
+    m_log.debug("attempt to update resource complete, relocking");
+    m_lock->rdlock();
+    return this;
+}
+
 void ReloadableXMLFile::unlock()
 {
     if (m_lock)
         m_lock->unlock();
 }
-\r
+
 pair<bool,DOMElement*> ReloadableXMLFile::load()
 {
     return load(false);
index 7b53891..ea91d82 100644 (file)
@@ -47,3 +47,9 @@ bool ReplayCache::check(const char* context, const char* s, time_t expires)
     m_storage->createString(context, s, "x", expires);
     return true;
 }
+
+bool ReplayCache::check(const char* context, const XMLCh* s, time_t expires)
+{
+    auto_ptr_char temp(s);
+    return check(context, temp.get(), expires);
+}
index 0f0d6e2..b208646 100644 (file)
@@ -65,10 +65,7 @@ namespace xmltooling {
          * @param s         value to check
          * @param expires   time for disposal of value from cache
          */
-        bool check(const char* context, const XMLCh* s, time_t expires) {
-            auto_ptr_char temp(s);
-            return check(context, temp.get(), expires);
-        }
+        bool check(const char* context, const XMLCh* s, time_t expires);
         
     private:
         bool m_owned;
index 7b6717a..6c563b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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 @@
 /**
  * StorageService.cpp
  * 
- * Registration of factories for built-in storage services
+ * Generic data storage interface.
  */
 
 #include "internal.h"
@@ -35,3 +35,11 @@ void XMLTOOL_API xmltooling::registerStorageServices()
     XMLToolingConfig& conf=XMLToolingConfig::getConfig();
     conf.StorageServiceManager.registerFactory(MEMORY_STORAGE_SERVICE, MemoryStorageServiceFactory);
 }
+
+StorageService::StorageService()
+{
+}
+
+StorageService::~StorageService()
+{
+}
index 2948b8e..04ee2c9 100644 (file)
@@ -43,7 +43,7 @@ namespace xmltooling {
     {
         MAKE_NONCOPYABLE(StorageService);
     public:
-        virtual ~StorageService() {}
+        virtual ~StorageService();
         
         /**
          * Creates a new "short" record in the storage service.
@@ -189,7 +189,7 @@ namespace xmltooling {
         virtual void deleteContext(const char* context)=0;
 
     protected:
-        StorageService() {}
+        StorageService();
     };
 
     /**
index 4062fca..3ff09ae 100644 (file)
@@ -31,6 +31,23 @@ namespace {
     static const pair<const string,string> emptyPair;
 }
 
+TemplateEngine::TemplateEngine()
+{
+    setTagPrefix("mlp");
+}
+
+TemplateEngine::~TemplateEngine()
+{
+}
+
+TemplateEngine::TemplateParameters::TemplateParameters() : m_request(NULL)
+{
+}
+
+TemplateEngine::TemplateParameters::~TemplateParameters()
+{
+}
+
 const char* TemplateEngine::TemplateParameters::getParameter(const char* name) const
 {
     map<string,string>::const_iterator i=m_map.find(name);
index a501f62..71606be 100644 (file)
@@ -58,11 +58,9 @@ namespace xmltooling {
     MAKE_NONCOPYABLE(TemplateEngine);
     public:
         /** Default constructor. */
-        TemplateEngine() {
-            setTagPrefix("mlp");
-        }
+        TemplateEngine();
 
-        virtual ~TemplateEngine() {}
+        virtual ~TemplateEngine();
 
         /**
          * Sets the tag name to use when locating template replacement tags.
@@ -77,8 +75,8 @@ namespace xmltooling {
          */
         class XMLTOOL_API TemplateParameters {
         public:
-            TemplateParameters() : m_request(NULL) {}
-            virtual ~TemplateParameters() {}
+            TemplateParameters();
+            virtual ~TemplateParameters();
 
             /** Map of known parameters to supply to template. */
             std::map<std::string,std::string> m_map;
index 88e316c..0196f2b 100644 (file)
@@ -37,6 +37,14 @@ static char x2c(char *what)
     return(digit);
 }
 
+URLEncoder::URLEncoder()
+{
+}
+
+URLEncoder::~URLEncoder()
+{
+}
+
 void URLEncoder::decode(char* s) const
 {
     register int x,y;
index f07080a..1ba61b6 100644 (file)
@@ -37,10 +37,9 @@ namespace xmltooling {
     class XMLTOOL_API URLEncoder {
         MAKE_NONCOPYABLE(URLEncoder);
     public:
-        /** Default constructor. */
-        URLEncoder() {}
+        URLEncoder();
 
-        virtual ~URLEncoder() {}
+        virtual ~URLEncoder();
 
         /**
          * Produce a URL-safe but equivalent version of the input string.
index 9ebde32..73e6681 100644 (file)
@@ -167,6 +167,11 @@ DOMElement* XMLHelper::appendChildElement(DOMElement* parentElement, DOMElement*
     return childElement;
 }
 
+bool XMLHelper::isNodeNamed(const xercesc::DOMNode* n, const XMLCh* ns, const XMLCh* local)
+{
+    return (n && XMLString::equals(local,n->getLocalName()) && XMLString::equals(ns,n->getNamespaceURI()));
+}
+
 const XMLCh* XMLHelper::getTextContent(const DOMElement* e)
 {
     DOMNode* child=e->getFirstChild();
index 81c86c4..98dff81 100644 (file)
@@ -176,9 +176,7 @@ namespace xmltooling {
          * @param local local name to compare with
          * @return  true iff the node's qualified name matches the other parameters
          */
-        static bool isNodeNamed(const xercesc::DOMNode* n, const XMLCh* ns, const XMLCh* local) {
-            return (n && xercesc::XMLString::equals(local,n->getLocalName()) && xercesc::XMLString::equals(ns,n->getNamespaceURI()));
-        }
+        static bool isNodeNamed(const xercesc::DOMNode* n, const XMLCh* ns, const XMLCh* local);
 
         /**
          * Returns the first matching child element of the node if any.
index 72c2e95..afb7605 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 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/validation/Validator.h
  * 
- * Rules checking of XMLObjects 
+ * Rules checking of XMLObjects.
  */
 
 #ifndef __xmltooling_validator_h__
@@ -35,7 +35,7 @@ namespace xmltooling {
     {
     MAKE_NONCOPYABLE(Validator);
     public:
-        virtual ~Validator() {}
+        virtual ~Validator();
         
         /**
          * Checks to see if an XMLObject is valid.
@@ -47,7 +47,7 @@ namespace xmltooling {
         virtual void validate(const XMLObject* xmlObject) const=0;
 
     protected:
-        Validator() {}
+        Validator();
     };
 
 };
index 05b484a..766418d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 #include "internal.h"
+#include "validation/Validator.h"
 #include "validation/ValidatorSuite.h"
-#include "util/XMLHelper.h"
 
 using namespace xmltooling;
 using namespace std;
 
+Validator::Validator()
+{
+}
+
+Validator::~Validator()
+{
+}
+
 ValidatorSuite xmltooling::SchemaValidators("SchemaValidators");
 
+ValidatorSuite::ValidatorSuite(const char* id) : m_id(id)
+{
+}
+
+ValidatorSuite::~ValidatorSuite()
+{
+    destroyValidators();
+}
+
+const char* ValidatorSuite::getId()
+{
+    return m_id.c_str();
+}
+
+void ValidatorSuite::registerValidator(const QName& key, Validator* validator)
+{
+    m_map.insert(pair<const QName,Validator*>(key, validator));
+}
+
 void ValidatorSuite::deregisterValidators(const QName& key)
 {
     pair<multimap<QName,Validator*>::iterator,multimap<QName,Validator*>::iterator> range=m_map.equal_range(key);
index 62feec0..a7d4ff1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
 #define __xmltooling_valsuite_h__
 
 #include <xmltooling/QName.h>
-#include <xmltooling/validation/Validator.h>
 
 #include <map>
+#include <string>
 
 #if defined (_MSC_VER)
     #pragma warning( push )
@@ -35,6 +35,8 @@
 
 namespace xmltooling {
 
+    class XMLTOOL_API Validator;
+
     /**
      * A collection of validators that can be applied to an XMLObject and its children. These collections can represent
      * usage specific checks, such as those outlined in schemas or profiles of specific XML specifications.
@@ -51,20 +53,16 @@ namespace xmltooling {
          * 
          * @param id    an identifier for the suite
          */
-        ValidatorSuite(const char* id) : m_id(id) {}
+        ValidatorSuite(const char* id);
         
-        ~ValidatorSuite() {
-            destroyValidators();
-        }
+        ~ValidatorSuite();
 
         /**
          * Gets a unique ID for this suite.
          * 
          * @return a unique ID for this suite
          */
-        const char* getId() {
-            return m_id.c_str();
-        }
+        const char* getId();
 
         /**
          * Evaluates the registered validators against the given XMLObject and it's children.
@@ -81,9 +79,7 @@ namespace xmltooling {
          * @param key       the key used to retrieve the validator
          * @param validator the validator
          */
-        void registerValidator(const QName& key, Validator* validator) {
-            m_map.insert(std::pair<const QName,Validator*>(key, validator));
-        }
+        void registerValidator(const QName& key, Validator* validator);
 
         /**
          * Deregisters validators.
index 0fd03ca..ca08327 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath=".\Lockable.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath=".\Namespace.cpp"\r
                                >\r
                        </File>\r
index 5529d5b..f04bbe5 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath=".\Lockable.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath=".\Namespace.cpp"\r
                                >\r
                        </File>\r
index 7cd05e6..38edea7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
 
 #include <xmltooling/encryption/Decrypter.h>
 #include <xmltooling/encryption/Encrypter.h>
+#include <xmltooling/encryption/Encryption.h>
 #include <xmltooling/security/Credential.h>
 #include <xmltooling/security/CredentialCriteria.h>
 #include <xmltooling/security/CredentialResolver.h>
index 007af8c..cc13252 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 #include <xmltooling/security/X509Credential.h>
 #include <xmltooling/security/KeyInfoResolver.h>
 #include <xmltooling/signature/KeyInfo.h>
+#include <xsec/enc/XSECCryptoKey.hpp>
 
 using namespace xmlsignature;