Fix some gcc compiler issues
[shibboleth/cpp-xmltooling.git] / xmltooling / util / ParserPool.h
index 004f7c7..93c2af4 100644 (file)
@@ -1,17 +1,21 @@
-/*
- *  Copyright 2001-2009 Internet2
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
  *
- * 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
+ * UCAID licenses this file to you 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
+ * 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.
+ * 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.
  */
 
 /**
@@ -26,6 +30,7 @@
 #include <xmltooling/unicode.h>
 
 #include <map>
+#include <memory>
 #include <stack>
 #include <string>
 #include <istream>
@@ -110,6 +115,17 @@ namespace xmltooling {
          * @param pathname  path to a catalog file
          * @return true iff the catalog was successfully processed
          */
+        bool loadCatalog(const char* pathname);
+
+        /**
+         * Load an OASIS catalog file to map schema namespace URIs to filenames.
+         *
+         * This does not provide real catalog support; only the &lt;uri&gt; element
+         * is supported to map from a namespace URI to a relative path or file:// URI.
+         *
+         * @param pathname  path to a catalog file
+         * @return true iff the catalog was successfully processed
+         */
         bool loadCatalog(const XMLCh* pathname);
 
         /**
@@ -161,8 +177,8 @@ namespace xmltooling {
 #else
         std::stack<xercesc::DOMBuilder*> m_pool;
 #endif
-        Mutex* m_lock;
-        xercesc::SecurityManager* m_security;
+        std::auto_ptr<Mutex> m_lock;
+        std::auto_ptr<xercesc::SecurityManager> m_security;
     };
 
     /**
@@ -178,7 +194,7 @@ namespace xmltooling {
          * @param is        reference to an input stream
          * @param systemId  optional system identifier to attach to the stream
          */
-        StreamInputSource(std::istream& is, const char* systemId=NULL);
+        StreamInputSource(std::istream& is, const char* systemId=nullptr);
         /// @cond off
         xercesc::BinInputStream* makeStream() const;
         /// @endcond
@@ -227,7 +243,7 @@ namespace xmltooling {
          * @param systemId  optional system identifier to attach to the source
          * @param cacheTag  optional pointer to string used for cache management
          */
-        URLInputSource(const XMLCh* url, const char* systemId=NULL, std::string* cacheTag=NULL);
+        URLInputSource(const XMLCh* url, const char* systemId=nullptr, std::string* cacheTag=nullptr);
 
         /**
          * Constructor taking a DOM element supporting the following content:
@@ -245,7 +261,7 @@ namespace xmltooling {
          * @param systemId  optional system identifier to attach to the source
          * @param cacheTag  optional pointer to string used for cache management
          */
-        URLInputSource(const xercesc::DOMElement* e, const char* systemId=NULL, std::string* cacheTag=NULL);
+        URLInputSource(const xercesc::DOMElement* e, const char* systemId=nullptr, std::string* cacheTag=nullptr);
 
         /// @cond off
         virtual xercesc::BinInputStream* makeStream() const;