VS10 solution files, convert from NULL macro to nullptr.
[shibboleth/sp.git] / shibsp / util / DOMPropertySet.h
index ced66c8..24e11fc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2006 Internet2
+ *  Copyright 2001-2010 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,8 @@
 #define __shibsp_dompropset_h__
 
 #include <shibsp/util/PropertySet.h>
-#include <log4cpp/Category.hh>
+
+#include <xmltooling/logging.h>
 
 namespace shibsp {
 
@@ -34,37 +35,38 @@ namespace shibsp {
     class SHIBSP_API DOMPropertySet : public virtual PropertySet
     {
     public:
-        DOMPropertySet() : m_root(NULL) {}
+        DOMPropertySet();
         
         virtual ~DOMPropertySet();
 
-        std::pair<bool,bool> getBool(const char* name, const char* ns=NULL) const;
-        std::pair<bool,const char*> getString(const char* name, const char* ns=NULL) const;
-        std::pair<bool,const XMLCh*> getXMLString(const char* name, const char* ns=NULL) const;
-        std::pair<bool,unsigned int> getUnsignedInt(const char* name, const char* ns=NULL) const;
-        std::pair<bool,int> getInt(const char* name, const char* ns=NULL) const;
-        const PropertySet* getPropertySet(const char* name, const char* ns="urn:mace:shibboleth:target:config:1.0") const;
-
-        const xercesc::DOMElement* getElement() const {
-            return m_root;
-        }
+        const PropertySet* getParent() const;
+        void setParent(const PropertySet* parent);
+        std::pair<bool,bool> getBool(const char* name, const char* ns=nullptr) const;
+        std::pair<bool,const char*> getString(const char* name, const char* ns=nullptr) const;
+        std::pair<bool,const XMLCh*> getXMLString(const char* name, const char* ns=nullptr) const;
+        std::pair<bool,unsigned int> getUnsignedInt(const char* name, const char* ns=nullptr) const;
+        std::pair<bool,int> getInt(const char* name, const char* ns=nullptr) const;
+        void getAll(std::map<std::string,const char*>& properties) const;
+        const PropertySet* getPropertySet(const char* name, const char* ns=shibspconstants::ASCII_SHIB2SPCONFIG_NS) const;
+        const xercesc::DOMElement* getElement() const;
 
         /**
          * Loads the property set from a DOM element.
          * 
          * @param e         root element of property set
-         * @param log       log object for tracing
+         * @param log       optional log object for tracing
          * @param filter    optional filter controls what child elements to include as nested PropertySets
          * @param remapper  optional map of property rename rules for legacy property support
          */
         void load(
             const xercesc::DOMElement* e,
-            log4cpp::Category& log,
-            xercesc::DOMNodeFilter* filter,
-            const std::map<std::string,std::string>* remapper=NULL
+            xmltooling::logging::Category* log=nullptr,
+            xercesc::DOMNodeFilter* filter=nullptr,
+            const std::map<std::string,std::string>* remapper=nullptr
             );
 
     private:
+        const PropertySet* m_parent;
         const xercesc::DOMElement* m_root;
         std::map<std::string,std::pair<char*,const XMLCh*> > m_map;
         std::map<std::string,DOMPropertySet*> m_nested;