diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37a5b9b4..c59c3b4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,13 +7,13 @@ cmake_minimum_required(VERSION 3.5)
project(arabica)
-# Enable C++11 support
-set(CMAKE_CXX_STANDARD 11)
+# Enable C++14 support
+set(CMAKE_CXX_STANDARD 14)
set(LIB_NAME arabica)
-set(ARABICA_MAJOR_VERSION 2016)
-set(ARABICA_MINOR_VERSION January)
+set(ARABICA_MAJOR_VERSION 2020)
+set(ARABICA_MINOR_VERSION April)
#
# Packaging details
@@ -196,8 +196,6 @@ set(PUBLIC_HEADER_FILES
include/SAX/helpers/InputSourceResolver.hpp
include/SAX/helpers/LocatorImpl.hpp
include/SAX/helpers/NamespaceSupport.hpp
- include/SAX/helpers/ParserAdaptor.hpp
- include/SAX/helpers/PropertyNames.hpp
include/SAX/helpers/XMLBaseSupport.hpp
include/SAX/helpers/XMLFilterImpl.hpp
include/SAX/parsers/saxgarden.hpp
@@ -582,4 +580,5 @@ if(BUILD_ARABICA_EXAMPLES)
endif()
include(CPack)
-
+
+
diff --git a/configure.ac b/configure.ac
index dad81111..1cbbae2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([Arabica],[2016-January],[jez@jezuk.co.uk])
+AC_INIT([Arabica],[2020-April],[jez@jezuk.co.uk])
AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 dist-zip subdir-objects])
@@ -8,6 +8,7 @@ AC_PROG_CXX
LT_INIT
AC_LANG([C++])
+AX_CXX_COMPILE_STDCXX([14])
ARABICA_SELECT_XML_PARSER
ARABICA_HAS_EXPAT
diff --git a/examples/SAX/wrapper.cpp b/examples/SAX/wrapper.cpp
index 628fe172..60272dfb 100644
--- a/examples/SAX/wrapper.cpp
+++ b/examples/SAX/wrapper.cpp
@@ -5,7 +5,6 @@
#include "SimpleHandler.hpp"
#include
#include
-#include
#include
#include
@@ -20,7 +19,6 @@ int main(int argc, char* argv[])
SimpleHandler myHandler;
Arabica::SAX::FeatureNames fNames;
- Arabica::SAX::PropertyNames pNames;
for(int i = 1; i < argc; ++i)
{
diff --git a/examples/XSLT/mangle.cpp b/examples/XSLT/mangle.cpp
index 9e99abb6..b3e8d6ec 100755
--- a/examples/XSLT/mangle.cpp
+++ b/examples/XSLT/mangle.cpp
@@ -25,7 +25,7 @@ int main(int argc, const char* argv[])
try
{
Arabica::SAX::InputSource source(argv[2]);
- std::auto_ptr > stylesheet = compiler.compile(source);
+ std::unique_ptr > stylesheet = compiler.compile(source);
if(stylesheet.get() == 0)
{
std::cerr << "Couldn't compile stylesheet: " << compiler.error() << std::endl;
diff --git a/include/DOM/SAX2DOM/SAX2DOM.hpp b/include/DOM/SAX2DOM/SAX2DOM.hpp
index 229b79fc..19152c95 100644
--- a/include/DOM/SAX2DOM/SAX2DOM.hpp
+++ b/include/DOM/SAX2DOM/SAX2DOM.hpp
@@ -13,7 +13,6 @@
#include
#include
*
* To set the DeclHandler for an XML reader, use the
- * {@link XMLReader#setProperty setProperty} method
- * with the propertyId "http://xml.org/sax/properties/declaration-handler".
- * If the reader does not support declaration events, it will throw a
- * {@link SAXNotRecognizedException SAXNotRecognizedException}
- * or a
- * {@link SAXNotSupportedException SAXNotSupportedException}
- * when you attempt to register the handler.
+ * {@link XMLReader#setDeclHandler setDeclHandler}.
*
* @since 2.0
* @author Jez Higgins,
diff --git a/include/SAX/ext/LexicalHandler.hpp b/include/SAX/ext/LexicalHandler.hpp
index 3e57576a..a5feb254 100644
--- a/include/SAX/ext/LexicalHandler.hpp
+++ b/include/SAX/ext/LexicalHandler.hpp
@@ -28,21 +28,13 @@ namespace SAX
* endDocument events.
*
* To set the LexicalHandler for an XML reader, use the
- * {@link XMLReader#setProperty setProperty} method
- * with the propertyId "http://xml.org/sax/properties/lexical-handler".
- * If the reader does not support lexical events, it will throw a
- * {@link SAXNotRecognizedException SAXNotRecognizedException}
- * or a
- * {@link SAXNotSupportedException SAXNotSupportedException}
- * when you attempt to register the handler.
+ * {@link XMLReader#setLexicalHandler setLexicalHandler} method.
*
* @since 2.0
* @author Jez Higgins,
* jez@jezuk.co.uk
* @version 1.0
- * @see XMLReader#setProperty
- * @see SAXNotRecognizedException
- * @see SAXNotSupportedException
+ * @see XMLReader#setLexicalHandler
*/
template >
class LexicalHandler
diff --git a/include/SAX/ext/ProgressiveParser.hpp b/include/SAX/ext/ProgressiveParser.hpp
index e33dc8e4..884bccad 100644
--- a/include/SAX/ext/ProgressiveParser.hpp
+++ b/include/SAX/ext/ProgressiveParser.hpp
@@ -3,8 +3,7 @@
#include
#include
-
-// $Id$
+#include
namespace Arabica
{
@@ -27,16 +26,16 @@ namespace SAX
class XMLPScanToken
{
public:
- void setParserData(std::auto_ptr& data)
+ void setParserData(std::unique_ptr&& data)
{
- data_ = data;
+ data_.swap(data);
}
XMLPScanTokenParserImpl* parserImpl()
{
return data_.get();
}
private:
- std::auto_ptr data_;
+ std::unique_ptr data_;
}; // XMLPScanToken
template
diff --git a/include/SAX/filter/Writer.hpp b/include/SAX/filter/Writer.hpp
index aab435e8..213f080c 100644
--- a/include/SAX/filter/Writer.hpp
+++ b/include/SAX/filter/Writer.hpp
@@ -8,7 +8,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -42,7 +41,6 @@ class Writer : public XMLFilterImpl
typedef LexicalHandler LexicalHandlerT;
typedef DeclHandler DeclHandlerT;
typedef typename XMLReaderT::InputSourceT InputSourceT;
- typedef typename XMLReaderT::PropertyBase PropertyBaseT;
using XMLFilterT::getParent;
public:
@@ -167,8 +165,6 @@ class Writer : public XMLFilterImpl
ostreamT* stream_;
string_type encoding_;
enum { startTag, endTag, docTag } lastTag_;
- const SAX::PropertyNames properties_;
-
}; // class Writer
template
diff --git a/include/SAX/helpers/ParserAdaptor.hpp b/include/SAX/helpers/ParserAdaptor.hpp
deleted file mode 100644
index dbb733db..00000000
--- a/include/SAX/helpers/ParserAdaptor.hpp
+++ /dev/null
@@ -1,548 +0,0 @@
-#ifndef ARABICA_PARSER_ADAPTOR_H
-#define ARABICA_PARSER_ADAPTOR_H
-
-// ParserAdaptor
-// Adapts a SAX1 Parser to a SAX2 XMLReader.
-// $Id$
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace Arabica
-{
-namespace SAX
-{
-
-/**
- * Adapt a SAX1 Parser as a SAX2 XMLReader.
- *
- * This class wraps a SAX1 {@link Parser Parser}
- * and makes it act as a SAX2 {@link XMLReader XMLReader},
- * with feature, property, and Namespace support. Note
- * that it is not possible to report {@link ContentHandler#skippedEntity
- * skippedEntity} events, since SAX1 does not make that information available.
- *
- * This adapter does not test for duplicate Namespace-qualified
- * attribute names.
- *
- * @since SAX 2.0
- * @author Jez Higgins,
- * jez@jezuk.co.uk
- * @version 2.0
- * @see XMLReader
- * @see Parser
- */
-template
-class ParserAdaptor : public XMLReaderInterface,
- public DocumentHandler
-{
-public:
- typedef Parser ParserT;
- typedef EntityResolver EntityResolverT;
- typedef DTDHandler DTDHandlerT;
- typedef DocumentHandler DocumentHandlerT;
- typedef ContentHandler ContentHandlerT;
- typedef InputSource InputSourceT;
- typedef Locator LocatorT;
- typedef SAXParseException SAXParseExceptionT;
- typedef AttributeList AttributeListT;
-
- ParserAdaptor(ParserT& parser) :
- parser_(parser),
- parsing_(false),
- locator_(0),
- namespaces_(true),
- prefixes_(false),
- entityResolver_(0),
- dtdHandler_(0),
- contentHandler_(0),
- errorHandler_(0)
- {
- } // ParserAdaptor
-
- ////////////////////////////////
- // implement XMLReader
- /**
- * Set a feature for the parser.
- *
- * The only features supported are namespaces and
- * namespace-prefixes.
- *
- * @param name The feature name, as a complete URI.
- * @param value The requested feature value.
- * @exception SAXNotRecognizedException If the feature
- * name is not known.
- * @exception SAXNotSupportedException If the feature
- * state is not supported.
- * @see XMLReader#setFeature
- */
- virtual void setFeature(const string_type& name, bool value)
- {
- if(name == NAMESPACES)
- {
- checkNotParsing("feature", name);
- namespaces_ = value;
- if(!namespaces_ && !prefixes_)
- prefixes_ = true;
- }
- else if(name == NAMESPACE_PREFIXES)
- {
- checkNotParsing("feature", name);
- prefixes_ = value;
- if(!prefixes_ && !namespaces_)
- namespaces_ = true;
- }
- else if(name == VALIDATION ||
- name == EXTERNAL_GENERAL ||
- name == EXTERNAL_PARAMETER)
- {
- throw SAXNotSupportedException("Feature not supported " + makeString(name));
- }
- else
- {
- throw SAXNotRecognizedException("Feature not recognized " + makeString(name));
- }
- } // setFeature
-
- /**
- * Check a parser feature.
- *
- * The only features supported are namespaces and
- * namespace-prefixes.
- *
- * @param name The feature name, as a complete URI.
- * @return The current feature state.
- * @exception SAXNotRecognizedException If the feature
- * name is not known.
- * @exception SAXNotSupportedException If querying the
- * feature state is not supported.
- * @see XMLReader#setFeature
- */
- virtual bool getFeature(const string_type& name) const
- {
- if(name == NAMESPACES)
- {
- return namespaces_;
- }
- else if(name == NAMESPACE_PREFIXES)
- {
- return prefixes_;
- }
- else if(name == VALIDATION ||
- name == EXTERNAL_GENERAL ||
- name == EXTERNAL_PARAMETER)
- {
- throw SAXNotSupportedException("Feature not supported " + makeString(name));
- }
- else
- {
- throw SAXNotRecognizedException("Feature not recognized " + makeString(name));
- }
- } // getFeature
-
-protected:
- virtual std::auto_ptr doGetProperty(const string_type& name)
- {
- throw SAXNotRecognizedException("Property not recognized " + makeString(name));
- } // doGetProperty
-
- virtual void doSetProperty(const string_type& name, std::auto_ptr value)
- {
- throw SAXNotRecognizedException("Property not recognized " + makeString(name));
- } // doSetProperty
-
-public:
- /**
- * Set the entity resolver.
- *
- * @param resolver The new entity resolver.
- * @see XMLReader#setEntityResolver
- */
- virtual void setEntityResolver(EntityResolverT& resolver) { entityResolver_ = &resolver; }
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none was supplied.
- * @see XMLReader#getEntityResolver
- */
- virtual EntityResolverT* getEntityResolver() const { return entityResolver_; }
-
- /**
- * Set the DTD handler.
- *
- * @param handler The new DTD handler.
- * @see XMLReader#setEntityResolver
- */
- virtual void setDTDHandler(DTDHandlerT& handler) { dtdHandler_ = &handler; }
- /**
- * Return the current DTD handler.
- *
- * @return The current DTD handler, or null if none was supplied.
- * @see XMLReader#getEntityResolver
- */
- virtual DTDHandlerT* getDTDHandler() const { return dtdHandler_; }
-
- /**
- * Set the content handler.
- *
- * @param handler The new content handler.
- * @see XMLReader#setEntityResolver
- */
- virtual void setContentHandler(ContentHandlerT& handler) { contentHandler_ = &handler; }
- /**
- * Return the current content handler.
- *
- * @return The current content handler, or null if none was supplied.
- * @see XMLReader#getEntityResolver
- */
- virtual ContentHandlerT* getContentHandler() const { return contentHandler_; }
-
- /**
- * Set the error handler.
- *
- * @param handler The new error handler.
- * @see XMLReader#setEntityResolver
- */
- virtual void setErrorHandler(ErrorHandler& handler) { errorHandler_ = &handler; }
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none was supplied.
- * @see XMLReader#getEntityResolver
- */
- virtual ErrorHandler* getErrorHandler() const { return errorHandler_; }
-
- /**
- * Parse an XML document.
- *
- * @param input An input source for the document.
- * @see Parser#parse(InputSource&)
- */
- virtual void parse(InputSourceT& input)
- {
- if(parsing_)
- throw SAXException("Parser is already in use.");
- setupParser();
- parsing_ = true;
- try
- {
- parser_.parse(input);
- }
- catch(...)
- {
- parsing_ = false;
- throw;
- }
- parsing_ = false;
- } // parse
-
- /////////////////////////////////////
- // DocumentHandler implementation
- /**
- * Adapt a SAX1 document locator event.
- *
- * @param locator A document locator.
- * @see ContentHandler#setDocumentLocator
- */
- virtual void setDocumentLocator(const LocatorT& locator)
- {
- locator_ = &locator;
- if(contentHandler_)
- contentHandler_->setDocumentLocator(locator);
- } // setDocumentLocator
-
- /**
- * Adapt a SAX1 start document event.
- *
- * @see DocumentHandler#startDocument
- */
- virtual void startDocument()
- {
- if(contentHandler_)
- contentHandler_->startDocument();
- } // startDocument
-
- /**
- * Adapt a SAX1 end document event.
- *
- * @see DocumentHandler#endDocument
- */
- virtual void endDocument()
- {
- if(contentHandler_)
- contentHandler_->endDocument();
- } // endDocument
-
- /**
- * Adapt a SAX1 startElement event.
- *
- * If necessary, perform Namespace processing.
- *
- * @param qName The qualified (prefixed) name.
- * @param qAtts The XML 1.0 attribute list (with qnames).
- */
- virtual void startElement(const string_type& qName,
- const AttributeListT& qAtts)
- {
- if(!namespaces_)
- {
- if(contentHandler_)
- {
- attAdaptor_.setAttributeList(qAtts);
- contentHandler_->startElement(NULL_STRING, NULL_STRING, qName, attAdaptor_);
- } // if(contentHandler_)
- return;
- } // if(!namespaces)
-
- // OK we're doing Namespaces
- nsSupport_.pushContext();
- bool seenDecl = false;
- atts_.clear();
-
- // take a first pass and copy all the attributes, noting any declarations
- int length = qAtts.getLength();
- for(int i = 0; i < length; ++i)
- {
- string_type attQName = qAtts.getName(i);
- string_type type = qAtts.getType(i);
- string_type value = qAtts.getValue(i);
-
- // declaration?
- if(attQName.find(NamespaceSupportT::XMLNS) == 0)
- {
- string_type prefix;
- int n = attQName.find(NamespaceSupportT::COLON);
- if(n != string_type::npos())
- prefix = string_type(attQName.begin() + n + 1, attQName.end());
- if(!nsSupport_.declarePrefix(prefix, value))
- reportError("Illegal Namespace prefix " + makeString(prefix));
- if(contentHandler_)
- contentHandler_->startPrefixMapping(prefix, value);
- if(prefixes_)
- atts_.addAttribute(NULL_STRING, NULL_STRING, attQName, type, value);
- seenDecl = true;
- }
- else
- {
- NamespaceSupportT::Parts attName = processName(attQName, true);
- atts_.addAttribute(attName.URI, attName.localName, attName.rawName, type, value);
- }
- } // for ...
-
- // if there was a Namespace decl we have to go around again
- if(seenDecl)
- {
- int length = atts_.getLength();
- for(int i = 0; i < length; ++i)
- {
- string_type attQName = atts_.getQName(i);
- if(attQName.find(NamespaceSupportT::XMLNS))
- {
- NamespaceSupportT::Parts attName = processName(attQName, true);
- atts_.setURI(i, attName.URI);
- atts_.setLocalName(i, attName.localName);
- } // if ...
- } // for ...
- } // if(seenDecl)
-
- // at last! report the event
- if(contentHandler_)
- {
- NamespaceSupportT::Parts name = processName(qName, false);
- contentHandler_->startElement(name.URI, name.localName, name.rawName, atts_);
- } // if(contentHandler_)
- } // startElement
-
-
- /**
- * Adapt a SAX1 end element event.
- *
- * @param qName The qualified (prefixed) name.
- * @see DocumentHandler#endElement
- */
- void endElement(const string_type& qName)
- {
- if(!namespaces_)
- {
- if(contentHandler_)
- contentHandler_->endElement(NULL_STRING, NULL_STRING, qName);
- return;
- } // if(!namespaces_)
-
- NamespaceSupportT::Parts name = processName(qName, false);
- if(contentHandler_)
- {
- contentHandler_->endElement(name.URI, name.localName, name.rawName);
- NamespaceSupportT::stringListT prefixes = nsSupport_.getDeclaredPrefixes();
- for(int i = 0, end = prefixes.size(); i != end; ++i)
- contentHandler_->endPrefixMapping(prefixes[i]);
- } // if(contentHandler_)
- nsSupport_.popContext();
- } // endElement
-
- /**
- * Adapt a SAX1 characters event.
- *
- * @param ch The characters.
- * @see DocumentHandler#characters
- */
- virtual void characters(const string_type& ch)
- {
- if(contentHandler_)
- contentHandler_->characters(ch);
- } // characters
-
- /**
- * Adapt a SAX1 ignorable whitespace event.
- *
- * @param ch Thecharacters.
- * @see DocumentHandler#ignorableWhitespace
- */
- virtual void ignorableWhitespace(const string_type& ch)
- {
- if(contentHandler_)
- contentHandler_->ignorableWhitespace(ch);
- } // ignorableWhitespace
-
- /**
- * Adapt a SAX1 processing instruction event.
- *
- * @param target The processing instruction target.
- * @param data The remainder of the processing instruction
- * @see DocumentHandler#processingInstruction
- */
- virtual void processingInstruction(const string_type& target, const string_type& data)
- {
- if(contentHandler_)
- contentHandler_->processingInstruction(target, data);
- } // processingInstruction
-
-private:
- typedef NamespaceSupport NamespaceSupportT;
- typedef AttributesImpl AttributesImplT;
-
- void setupParser()
- {
- nsSupport_.reset();
-
- if(entityResolver_)
- parser_.setEntityResolver(*entityResolver_);
- if(dtdHandler_)
- parser_.setDTDHandler(*dtdHandler_);
- if(errorHandler_)
- parser_.setErrorHandler(*errorHandler_);
- parser_.setDocumentHandler(*this);
- locator_ = 0;
- } // setupParser
-
- NamespaceSupportT::Parts processName(const string_type& qName, bool isAttribute)
- {
- NamespaceSupportT::Parts p = nsSupport_.processName(qName, isAttribute);
- if(p.URI == NULL_STRING && p.prefix != NULL_STRING)
- reportError("Undeclared prefix " + makeString(qName));
- return p;
- } // processName
-
- void reportError(const std::string& message)
- {
- if(errorHandler_ == 0)
- return;
-
- if(locator_)
- errorHandler_->error(SAXParseExceptionT(message, *locator_));
- else
- errorHandler_->error(SAXParseExceptionT(message, NULL_STRING, NULL_STRING, -1, -1));
- } // reportError
-
- void checkNotParsing(const std::string& type, const string_type& name)
- {
- if(parsing_)
- throw SAXNotSupportedException("Can't change feature while parsing");
- } // checkNotParsing
-
- std::string makeString(const string_type& str) const
- {
- return string_adaptor::asStdString(str);
- } // makeString
-
- // This wrapper is used only when Namespace support is disabled.
- class AttributesListAdaptor : public Attributes
- {
- public:
- typedef typename ParserAdaptor ParserAdaptorT;
- typedef typename AttributeList AttributeListT;
-
- void setAttributeList(const AttributeListT& attList)
- {
- attList_ = &attList;
- } // setAttributeList
-
- virtual int getLength() const { return attList_->getLength(); }
- virtual string_type getURI(int) const { return string_type(); }
- virtual string_type getLocalName(int) const { return string_type(); }
- virtual string_type getQName(int i) const { return attList_->getName(i); }
- virtual string_type getType(int i) const { return attList_->getType(i); }
- virtual string_type getValue(int i) const { return attList_->getValue(i); }
-
- virtual int getIndex(const string_type&, const string_type&) const { return -1; }
- virtual int getIndex(const string_type& qName) const
- {
- int max = attList_->getLength();
- for(int i = 0; i < max; ++i)
- if(attList_->getName(i) == qName)
- return i;
- return -1;
- } // getIndex
- virtual string_type getType(const string_type&, const string_type&) const { return string_type(); }
- virtual string_type getType(const string_type& qName) const { return attList_->getType(qName); }
- virtual string_type getValue(const string_type&, const string_type&) const { return string_type(); }
- virtual string_type getValue(const string_type& qName) const { return attList_->getValue(qName); }
-
- private:
- static string_type empty_;
- const AttributeListT* attList_;
- }; // AttributesListAdaptor
-
- // member variables
- NamespaceSupportT nsSupport_;
- AttributesListAdaptor attAdaptor_;
-
- bool parsing_;
- // strings?
- ParserT& parser_;
- AttributesImplT atts_;
-
- // features
- bool namespaces_;
- bool prefixes_;
-
- // handlers
- const LocatorT* locator_;
- EntityResolverT* entityResolver_;
- DTDHandlerT* dtdHandler_;
- ContentHandlerT* contentHandler_;
- ErrorHandler* errorHandler_;
-
-public:
- const string_type NULL_STRING;
-
-private:
- ParserAdaptor();
- ParserAdaptor(const ParserAdaptor&);
- ParserAdaptor& operator=(const ParserAdaptor&);
- bool operator==(const ParserAdaptor&);
-}; // ParserAdaptor
-
-} // namespace SAX
-} // namespace Arabica
-
-#endif
diff --git a/include/SAX/helpers/PropertyNames.hpp b/include/SAX/helpers/PropertyNames.hpp
deleted file mode 100644
index 2d1f0d9a..00000000
--- a/include/SAX/helpers/PropertyNames.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef ARABICA_PROPERTY_NAMES_H
-#define ARABICA_PROPERTY_NAMES_H
-/*
- * $Id$
- */
-
-#include
-#include
-#include
-
-namespace Arabica
-{
-namespace SAX
-{
-
-/** The core SAX 2 parser properties. */
-template >
-struct PropertyNames
-{
- /** @name SAX 2 Properties
- * @{ */
- /** Register a lexical handler.
- *
- * The Lexical Handler is used to see some syntax events that are essential
- * in some applications: comments, CDATA delimiters, selected general
- * entity inclusions, and the start and end of the DTD (and declaration of
- * document element name).
- *
- * The value assigned must implement SAX::LexicalHandler.
- */
- const string_type lexicalHandler;
- /** Register a Declaration Handler.
- *
- * Used to see most DTD declarations except those treated as lexical
- * ("document element name is ...") or which are mandatory for all SAX
- * parsers (DTDHandler).
- *
- * The value assigned must implement SAX::DeclHandler */
- const string_type declHandler;
- /** @} */
-
- PropertyNames() :
- lexicalHandler(string_adaptor_type::construct_from_utf8("http://xml.org/sax/handlers/LexicalHandler")),
- declHandler(string_adaptor_type::construct_from_utf8("http://xml.org/sax/handlers/DeclHandler"))
- {
- } // PropertyNames
-}; // struct PropertyNames
-
-} // namespace SAX
-} // namespace Arabica
-
-#endif
-// end of file
diff --git a/include/SAX/helpers/XMLFilterImpl.hpp b/include/SAX/helpers/XMLFilterImpl.hpp
index 98abec27..b605b122 100644
--- a/include/SAX/helpers/XMLFilterImpl.hpp
+++ b/include/SAX/helpers/XMLFilterImpl.hpp
@@ -223,29 +223,6 @@ public:
parent_->parse(input);
} // parse
- virtual std::auto_ptr doGetProperty(const string_type& name)
- {
- if(parent_)
- return parent_->doGetProperty(name);
-
- string_type ex = string_adaptor::construct_from_utf8("Property: ");
- string_adaptor::append(ex, name);
- throw SAXNotRecognizedException(string_adaptor::asStdString(ex));
- } // doGetProperty
-
- virtual void doSetProperty(const string_type& name, typename std::auto_ptr value)
- {
- if(parent_)
- {
- parent_->doSetProperty(name, value);
- return;
- } // if(parent_)
-
- string_type ex = string_adaptor::construct_from_utf8("Property: ");
- string_adaptor::append(ex, name);
- throw SAXNotRecognizedException(string_adaptor::asStdString(ex));
- } // doSetProperty
-
public:
//////////////////////////////////////////////////
// EntityResolver
diff --git a/include/SAX/parsers/saxgarden.hpp b/include/SAX/parsers/saxgarden.hpp
index 3708bb42..ae1b5197 100644
--- a/include/SAX/parsers/saxgarden.hpp
+++ b/include/SAX/parsers/saxgarden.hpp
@@ -48,7 +48,6 @@ public:
typedef ErrorHandler ErrorHandlerT;
typedef DeclHandler declHandlerT;
typedef LexicalHandler lexicalHandlerT;
- typedef typename XMLReaderT::PropertyBase PropertyBaseT;
Garden();
@@ -70,9 +69,6 @@ public:
virtual void parse(InputSourceT& input);
- virtual std::auto_ptr doGetProperty(const string_type& name);
- virtual void doSetProperty(const string_type& name, std::auto_ptr value);
-
private:
void reportError(const std::string& message, bool fatal = false);
@@ -256,20 +252,6 @@ void Garden::setFeature(const string_type& name, bool value
throw SAXNotRecognizedException(string_adaptor::asStdString(name));
} // setFeature
-///////////////////////////////////////
-// properties
-template
-std::auto_ptr::PropertyBaseT> Garden::doGetProperty(const string_type& name)
-{
- throw SAXNotRecognizedException(string_adaptor::asStdString(name));
-} // doGetProperty
-
-template
-void Garden::doSetProperty(const string_type& name, std::auto_ptr value)
-{
- throw SAXNotRecognizedException(string_adaptor::asStdString(name));
-} // doSetProperty
-
//////////////////////////////////////////
// parse
template
diff --git a/include/SAX/wrappers/XercesPropertyNames.hpp b/include/SAX/wrappers/XercesPropertyNames.hpp
index 1e9b864a..96a82b39 100644
--- a/include/SAX/wrappers/XercesPropertyNames.hpp
+++ b/include/SAX/wrappers/XercesPropertyNames.hpp
@@ -5,7 +5,6 @@
*/
#include
-#include
namespace Arabica
{
@@ -13,8 +12,7 @@ namespace SAX
{
template >
- struct XercesPropertyNames : public PropertyNames
+ struct XercesPropertyNames
{
/** \name Xerces properties.
* @{ */
diff --git a/include/SAX/wrappers/saxexpat.hpp b/include/SAX/wrappers/saxexpat.hpp
index ea8a4cd2..a7955500 100644
--- a/include/SAX/wrappers/saxexpat.hpp
+++ b/include/SAX/wrappers/saxexpat.hpp
@@ -19,7 +19,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -226,11 +225,6 @@ class expat_wrapper :
typedef SAX::NamespaceSupport namespaceSupportT;
typedef SAX::ErrorHandler errorHandlerT;
typedef SAX::SAXParseException SAXParseExceptionT;
- typedef typename XMLReaderT::PropertyBase PropertyBaseT;
- typedef typename XMLReaderT::template Property getLexicalHandlerT;
- typedef typename XMLReaderT::template Property setLexicalHandlerT;
- typedef typename XMLReaderT::template Property getDeclHandlerT;
- typedef typename XMLReaderT::template Property setDeclHandlerT;
typedef XML::QualifiedName qualifiedNameT;
expat_wrapper();
@@ -270,11 +264,6 @@ class expat_wrapper :
virtual size_t getLineNumber() const;
virtual size_t getColumnNumber() const;
- ///////////////////////////////////////////////////
- // properties
- protected:
- virtual std::auto_ptr doGetProperty(const string_type& name);
- virtual void doSetProperty(const string_type& name, std::auto_ptr value);
private:
qualifiedNameT processName(const string_type& qName, bool isAttribute);
void reportError(const std::string& message, bool fatal = false);
@@ -347,7 +336,6 @@ class expat_wrapper :
string_type emptyString_;
const SAX::FeatureNames features_;
- const SAX::PropertyNames properties_;
const SAX::NamespaceConstants nsc_;
const SAX::AttributeDefaults attrDefaults_;
@@ -520,52 +508,6 @@ bool expat_wrapper::do_parse(inputSourceT& source, XML_Pars
return true;
} // do_parse
-template
-std::auto_ptr::PropertyBaseT> expat_wrapper::doGetProperty(const string_type& name)
-{
- if(name == properties_.lexicalHandler)
- {
- getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_);
- return std::auto_ptr(prop);
- }
- if(name == properties_.declHandler)
- {
- getDeclHandlerT* prop = new getDeclHandlerT(declHandler_);
- return std::auto_ptr(prop);
- }
-
- throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + SA::asStdString(name));
-} // doGetProperty
-
-template
-void expat_wrapper::doSetProperty(const string_type& name, std::auto_ptr value)
-{
- if(name == properties_.lexicalHandler)
- {
- setLexicalHandlerT* prop = dynamic_cast(value.get());
-
- if(!prop)
- throw std::bad_cast();
-
- lexicalHandler_ = &(prop->get());
- }
- else if(name == properties_.declHandler)
- {
- setDeclHandlerT* prop = dynamic_cast(value.get());
-
- if(!prop)
- throw std::bad_cast();
-
- declHandler_ = &(prop->get());
- }
- else
- {
- std::ostringstream os;
- os << "Property not recognized " << SA::asStdString(name);
- throw SAX::SAXNotRecognizedException(os.str());
- }
-} // doSetProperty
-
// Locator implementation
template
string_type expat_wrapper::getPublicId() const
diff --git a/include/SAX/wrappers/saxlibxml2.hpp b/include/SAX/wrappers/saxlibxml2.hpp
index 76072d83..b693b52e 100644
--- a/include/SAX/wrappers/saxlibxml2.hpp
+++ b/include/SAX/wrappers/saxlibxml2.hpp
@@ -17,7 +17,6 @@
#include
#include
-#include
#include
#include
#include
@@ -145,11 +144,6 @@ class libxml2_wrapper :
typedef SAX::NamespaceSupport namespaceSupportT;
typedef SAX::ErrorHandler errorHandlerT;
typedef SAX::SAXParseException SAXParseExceptionT;
- typedef typename XMLReaderT::PropertyBase PropertyBaseT;
- typedef typename XMLReaderT::template Property getLexicalHandlerT;
- typedef typename XMLReaderT::template Property setLexicalHandlerT;
- typedef typename XMLReaderT::template Property getDeclHandlerT;
- typedef typename XMLReaderT::template Property setDeclHandlerT;
typedef XML::QualifiedName qualifiedNameT;
libxml2_wrapper();
@@ -179,12 +173,6 @@ class libxml2_wrapper :
// parsing
virtual void parse(inputSourceT& source);
- protected:
- ////////////////////////////////////////////////
- // properties
- virtual std::auto_ptr doGetProperty(const string_type& name);
- virtual void doSetProperty(const string_type& name, std::auto_ptr value);
-
public:
virtual string_type getPublicId() const;
virtual string_type getSystemId() const;
@@ -245,7 +233,6 @@ class libxml2_wrapper :
string_type emptyString_;
const FeatureNames features_;
- const PropertyNames properties_;
const NamespaceConstants nsc_;
const AttributeDefaults attrDefaults_;
const AttributeTypes attrTypes_;
@@ -354,48 +341,6 @@ void libxml2_wrapper::setFeature(const string_type& name, b
}
} // setFeature
-template
-std::auto_ptr::PropertyBaseT> libxml2_wrapper::doGetProperty(const string_type& name)
-{
- if(name == properties_.declHandler)
- {
- getDeclHandlerT* prop = new getDeclHandlerT(declHandler_);
- return std::auto_ptr(prop);
- }
- if(name == properties_.lexicalHandler)
- {
- getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_);
- return std::auto_ptr(prop);
- }
-
- throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + string_adaptor::asStdString(name));
-} // doGetProperty
-
-template
-void libxml2_wrapper::doSetProperty(const string_type& name, std::auto_ptr value)
-{
- if(name == properties_.declHandler)
- {
- setDeclHandlerT* prop = dynamic_cast(value.get());
-
- if(!prop)
- throw std::bad_cast();
-
- declHandler_ = &(prop->get());
- }
- if(name == properties_.lexicalHandler)
- {
- setLexicalHandlerT* prop = dynamic_cast(value.get());
-
- if(!prop)
- throw std::bad_cast();
-
- lexicalHandler_ = &(prop->get());
- }
-
- throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + string_adaptor::asStdString(name));
-} // doSetProperty
-
template
typename XML::QualifiedName::string_adaptor> libxml2_wrapper::processName(const string_type& qName, bool isAttribute)
{
diff --git a/include/SAX/wrappers/saxmsxml2.hpp b/include/SAX/wrappers/saxmsxml2.hpp
index d3766058..37719106 100644
--- a/include/SAX/wrappers/saxmsxml2.hpp
+++ b/include/SAX/wrappers/saxmsxml2.hpp
@@ -10,7 +10,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -118,48 +117,7 @@ class msxml2_wrapper :
// Parsing
virtual void parse(inputSourceT& input);
- protected:
- virtual std::auto_ptr doGetProperty(const string_type& name)
- {
- if(name == properties_.lexicalHandler)
- {
- Property* prop = new Property(lexicalHandler_.getLexicalHandler());
- return std::auto_ptr(prop);
- }
- if(name == properties_.declHandler)
- {
- Property* prop = new Property(declHandler_.getDeclHandler());
- return std::auto_ptr(prop);
- }
- throw SAX::SAXNotRecognizedException("Property not recognized ");
- } // doGetProperty
-
- virtual void doSetProperty(const string_type& name, std::auto_ptr value)
- {
- if(name == properties_.lexicalHandler)
- {
- Property* prop = dynamic_cast*>(value.get());
-
- if(!prop)
- throw std::runtime_error("bad_cast: Property LexicalHandler is wrong type, should be SAX::LexicalHandler&");
-
- lexicalHandler_.setLexicalHandler(prop->get());
- return;
- } // if ...
- if(name == properties_.declHandler)
- {
- Property* prop = dynamic_cast*>(value.get());
-
- if(!prop)
- throw std::runtime_error("bad_cast: Property DeclHandler is wrong type, should be SAX::DeclHandler&");
-
- declHandler_.setDeclHandler(prop->get());
- return;
- } // if ...
- throw SAX::SAXNotRecognizedException("Property not recognized ");
- } // doSetProperty
-
- private:
+ private:
//////////////////////////////////////////////////////
// COM interface -> C++ interface adaptors
class LocatorAdaptor : public locatorT
@@ -995,7 +953,6 @@ class msxml2_wrapper :
DeclHandlerAdaptor declHandler_;
ISAXXMLReaderPtr reader_;
- SAX::PropertyNames properties_;
}; // class msxml
template
@@ -1006,8 +963,7 @@ msxml2_wrapper::msxml2_wrapper() :
contentHandler_(errorHandler_),
lexicalHandler_(),
declHandler_(),
- reader_(),
- properties_()
+ reader_()
{
reader_.CreateInstance("Msxml2.SAXXMLReader.6.0");
if(reader_.GetInterfacePtr() == 0)
diff --git a/include/SAX/wrappers/saxxerces.hpp b/include/SAX/wrappers/saxxerces.hpp
index 4d583cb3..9ca6061e 100644
--- a/include/SAX/wrappers/saxxerces.hpp
+++ b/include/SAX/wrappers/saxxerces.hpp
@@ -4,35 +4,6 @@
// A SAX2 wrapper class for Xerces.
//---------------------------------------------------------------------------
-// Debugging code for the doSetProperty and doGetProperty methods.
-// Since these methods use runtime casting, it is often helpful to
-// know the exact type of a method's arguments to compare with
-// what is expected. This is hard, even with current (2003)
-// debuggers, so this code can print it out, assuming you've
-// compiled with gcc 3.2
-//
-// Example usage is given in doSetProperty
-
-// Use only with GCC 3.2
-#ifdef SAXXERCES_DEBUG
-
-#include
-#include
-#include
-
-// Demangle Run-Time Type Information std::type_info struct.
-std::ostream& operator<<(std::ostream& o, const std::type_info& ti)
-{
- int status;
- char *realname = abi::__cxa_demangle(ti.name(), 0, 0, &status);
- if (status != 0)
- o.setstate(std::ios_base::failbit);
- o << realname;
- free(realname);
- return o;
-}
-#endif
-
#include
#include
#include
@@ -189,10 +160,6 @@ class xerces_wrapper : public ProgressiveParser doGetProperty(const string_type& name);
- virtual void doSetProperty(const string_type& name, std::auto_ptr value);
-
private:
///////////////////////////////
// String adaptor for XMLCh
@@ -282,7 +249,7 @@ class xerces_wrapper : public ProgressiveParser(bytes), length);
} // construct_from_XMLByte
- static std::auto_ptr transcoder_;
+ static std::unique_ptr transcoder_;
static void kickoff()
{
XERCES_CPP_NAMESPACE::XMLTransService::Codes res;
@@ -841,7 +808,7 @@ class xerces_wrapper : public ProgressiveParser initializer_;
+ std::unique_ptr initializer_;
XERCES_CPP_NAMESPACE::SAX2XMLReader* xerces_;
ContentHandlerAdaptor contentHandlerAdaptor_;
EntityResolverAdaptor entityResolverAdaptor_;
@@ -858,7 +825,7 @@ class xerces_wrapper : public ProgressiveParser
-std::auto_ptr xerces_wrapper::xerces_string_adaptor::transcoder_;
+std::unique_ptr xerces_wrapper::xerces_string_adaptor::transcoder_;
#endif
template
@@ -866,8 +833,7 @@ xerces_wrapper::xerces_wrapper()
{
try
{
- std::auto_ptr init(new XercesImpl::xerces_initializer());
- initializer_ = init;
+ initializer_.reset(new XercesImpl::xerces_initializer());
#ifdef ARABICA_NO_WCHAR_T
xerces_string_adaptor::kickoff();
#endif
@@ -933,143 +899,6 @@ void xerces_wrapper::setFeature(const string_type& name, bo
} // catch(SAXNotRecognizedException& e)
} // setFeature
-template
-std::auto_ptr::XMLReaderT::PropertyBase> xerces_wrapper::doGetProperty(const string_type& name)
-{
- if(name == properties_.lexicalHandler)
- {
- typedef typename XMLReaderT::template Property Prop;
- Prop *prop = new Prop(lexicalHandlerAdaptor_.getLexicalHandler());
- return std::auto_ptr(prop);
- }
- if(name == properties_.declHandler)
- {
- typedef typename XMLReaderT::template Property Prop;
- Prop* prop = new Prop(declHandlerAdaptor_.getDeclHandler());
- return std::auto_ptr(prop);
- }
- if (name == properties_.externalSchemaLocation)
- {
- typedef typename XMLReaderT::template Property StringPropertyType;
-
- XMLCh* xercesExternalSchemaLocation =
- static_cast(xerces_->getProperty(
- XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchemaExternalSchemaLocation));
-
- externalSchemaLocation_ = XSA::makeStringT(xercesExternalSchemaLocation);
- std::auto_ptr toReturn(new StringPropertyType(externalSchemaLocation_));
-#ifdef SAXXERCES_DEBUG
- std::cerr << "Returning " << typeid(toReturn)
- << "(*(" << typeid(*toReturn.get()) << ")"
- << toReturn.get() << ")"
- << " containing value [" << externalSchemaLocation_ << "]"
- << std::endl;
-#endif
- return toReturn;
- }
- if (name == properties_.externalNoNamespaceSchemaLocation)
- {
- typedef typename XMLReaderT::template Property StringPropertyType;
-
- XMLCh* xercesExternalNoNamespaceSchemaLocation =
- static_cast(xerces_->getProperty(
- XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation));
-
- externalNoNamespaceSchemaLocation_ = XSA::makeStringT(xercesExternalNoNamespaceSchemaLocation);
- return std::auto_ptr(new StringPropertyType(externalNoNamespaceSchemaLocation_));
- }
- throw SAX::SAXNotRecognizedException("Property not recognized ");
-} // doGetProperty
-
-template
-void xerces_wrapper::doSetProperty(const string_type& name, std::auto_ptr value)
-{
- if(name == properties_.lexicalHandler)
- {
- typedef typename XMLReaderT::template Property Prop;
- Prop* prop = dynamic_cast(value.get());
-
- if(!prop)
- throw std::runtime_error("bad_cast: Property LexicalHandler is wrong type, should be SAX::LexicalHandler&");
-
- lexicalHandlerAdaptor_.setLexicalHandler(prop->get());
- return;
- } // if ...
-
- if(name == properties_.declHandler)
- {
- typedef typename XMLReaderT::template Property Prop;
- Prop* prop = dynamic_cast(value.get());
-
- if(!prop)
- throw std::runtime_error("bad_cast: Property DeclHandler is wrong type, should be SAX::DeclHandler&");
-
- declHandlerAdaptor_.setDeclHandler(prop->get());
- return;
- } // if ...
-
- if (name == properties_.externalSchemaLocation)
- {
- typename XMLReaderT::PropertyBase* propBase = value.get();
-#ifdef SAXXERCES_DEBUG
- std::cerr << "doSetProperty(externalSchemaLocation, &("
- << typeid(*propBase) << "))" << std::endl;
-#endif
- typedef typename XMLReaderT::template Property propertyType;
- propertyType* prop = dynamic_cast(propBase);
-#ifdef SAXXERCES_DEBUG
- std::cerr << " Extracted property to " << typeid(prop)
- << "(" << prop << ")" << std::endl;
-#endif
- if (prop)
- {
- externalSchemaLocation_ = prop->get();
-#ifdef SAXXERCES_DEBUG
- std::cerr << " Setting property to " << externalSchemaLocation_ << std::endl;
-#endif
- xerces_string_janitor toDelete(XSA::asXMLChString(externalSchemaLocation_));
- xerces_->setProperty(XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchemaExternalSchemaLocation, const_cast(toDelete.get()));
- }
- else
- {
- throw SAXNotSupportedException("Property ExternalShemaLocation is wrong type, should be string_type");
- }
- return;
- }
-
- if (name == properties_.externalNoNamespaceSchemaLocation)
- {
- typename XMLReaderT::PropertyBase* propBase = value.get();
- typedef typename XMLReaderT::template Property propertyType;
-#ifdef SAXXERCES_DEBUG
- std::cerr << "doSetProperty(externalNoNamespaceSchemaLocation, &("
- << typeid(*propBase) << "))" << std::endl;
-#endif
- propertyType* prop = dynamic_cast(propBase);
-#ifdef SAXXERCES_DEBUG
- std::cerr << " Extracted property to " << typeid(prop)
- << "(" << prop << ")" << std::endl;
-#endif
- if (prop)
- {
- externalNoNamespaceSchemaLocation_ = prop->get();
-#ifdef SAXXERCES_DEBUG
- std::cerr << " Setting property to " << externalNoNamespaceSchemaLocation_ << std::endl;
-#endif
- xerces_string_janitor toDelete(XSA::asXMLChString(externalNoNamespaceSchemaLocation_));
- xerces_->setProperty(XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation, const_cast(toDelete.get()));
- }
- else
- {
- throw SAXNotSupportedException("Property ExternalNoNamespaceSchemaLocation is wrong type, should be string_type");
- }
- return;
- }
-
- throw SAX::SAXNotRecognizedException("Property not recognized ");
-}
-
-
template
void xerces_wrapper::parse(InputSourceT& source)
{
@@ -1089,7 +918,7 @@ bool xerces_wrapper::parseFirst(InputSourceT& input,
XMLPScanToken& toFill)
{
- std::auto_ptr newToken(new XercesXMLPScanToken);
+ auto newToken = std::make_unique();
// To store the result from Xerces parseFirst().
bool result = false;
if (input.getByteStream() == 0)
@@ -1110,9 +939,9 @@ bool xerces_wrapperparseFirst(isAdaptor, newToken->token_);
}
if (result) {
- // We need to explicitly convert to auto_ptr.
- std::auto_ptr toSet(newToken.release());
- toFill.setParserData(toSet);
+ // We need to explicitly convert to unique_ptr.
+ std::unique_ptr toSet(newToken.release());
+ toFill.setParserData(std::move(toSet));
}
return result;
} // parseFirst
diff --git a/include/Taggle/impl/Parser.hpp b/include/Taggle/impl/Parser.hpp
index a6630540..41d4b0e1 100644
--- a/include/Taggle/impl/Parser.hpp
+++ b/include/Taggle/impl/Parser.hpp
@@ -396,90 +396,7 @@ public:
CDATAElements = value;
} // setFeature
- typedef typename XMLReaderInterface::PropertyBase PropertyBaseT;
- virtual std::auto_ptr doGetProperty(const string_type& /*name*/)
- {
- return std::auto_ptr(0);
- } // doGetProperty
-
- virtual void doSetProperty(const string_type& /*name*/, std::auto_ptr /*value*/)
- {
- } // doSetProperty
-
- /*
- Object getProperty (std::string name)
- {
- if(name.equals(lexicalHandlerProperty))
- {
- return lexicalHandler_ == this ? null : lexicalHandler_;
- }
- else if(name.equals(scannerProperty))
- {
- return scanner_;
- }
- else if(name.equals(schemaProperty))
- {
- return schema_;
- }
- else if(name.equals(autoDetectorProperty))
- {
- return theAutoDetector;
- }
- else
- {
- throw new SAXNotRecognizedException("Unknown property " + name);
- }
- } // getProperty
-
- void setProperty (std::string name, Object value)
- {
- if(name.equals(lexicalHandlerProperty))
- {
- if(value == null)
- {
- lexicalHandler_ = this;
- }
- else if(value instanceof LexicalHandler)
- {
- lexicalHandler_ = (LexicalHandler)value;
- }
- else
- {
- throw new SAXNotSupportedException("Your lexical handler is not a LexicalHandler");
- }
- }
- else if(name.equals(scannerProperty))
- {
- if(value instanceof Scanner) {
- scanner_ = (Scanner)value;
- }
- else {
- throw new SAXNotSupportedException("Your scanner is not a Scanner");
- }
- }
- else if(name.equals(schemaProperty)) {
- if(value instanceof Schema) {
- schema_ = (Schema)value;
- }
- else {
- throw new SAXNotSupportedException("Your schema is not a Schema");
- }
- }
- else if(name.equals(autoDetectorProperty)) {
- if(value instanceof AutoDetector) {
- theAutoDetector = (AutoDetector)value;
- }
- else {
- throw new SAXNotSupportedException("Your auto-detector is not an AutoDetector");
- }
- }
- else {
- throw new SAXNotRecognizedException("Unknown property " + name);
- }
- }
-*/
-
- virtual void setEntityResolver(EntityResolverT& resolver)
+ virtual void setEntityResolver(EntityResolverT& resolver)
{
entityResolver_ = &resolver;
} // setEntityResolver
diff --git a/include/XPath/impl/xpath_step.hpp b/include/XPath/impl/xpath_step.hpp
index 5550e0e9..3d35a7aa 100644
--- a/include/XPath/impl/xpath_step.hpp
+++ b/include/XPath/impl/xpath_step.hpp
@@ -219,8 +219,8 @@ public:
Axis axis,
bool is_attr = false)
{
- std::auto_ptr > test(getTest(node, end, !is_attr ? axis : ATTRIBUTE, context.namespaceContext()));
- std::auto_ptr > thing;
+ std::unique_ptr > test(getTest(node, end, !is_attr ? axis : ATTRIBUTE, context.namespaceContext()));
+ std::unique_ptr > thing;
if(test.get() == 0)
thing.reset(XPath::compile_expression(node++, end, context));
@@ -489,14 +489,14 @@ public:
const ExecutionContext& executionContext) const
{
NodeSet ns;
-
- NodeSet nodes = expr_->evaluate(context, executionContext).asNodeSet();
- for(typename NodeSet::const_iterator n = nodes.begin(), ne = nodes.end(); n != ne; ++n)
- if(context == *n)
- {
- ns.push_back(context);
- break;
- } // if ...
+
+ NodeSet nodes = expr_->evaluate(context, executionContext).asNodeSet();
+ for(typename NodeSet::const_iterator n = nodes.begin(), ne = nodes.end(); n != ne; ++n)
+ if(context == *n)
+ {
+ ns.push_back(context);
+ break;
+ } // if ...
return XPathValue(new NodeSetValue(ns));
} // evaluate
diff --git a/include/XSLT/impl/xslt_stylesheet_compiler.hpp b/include/XSLT/impl/xslt_stylesheet_compiler.hpp
index d94064b6..9077f042 100644
--- a/include/XSLT/impl/xslt_stylesheet_compiler.hpp
+++ b/include/XSLT/impl/xslt_stylesheet_compiler.hpp
@@ -227,11 +227,11 @@ public:
{
} // ~StylesheetCompiler
- std::auto_ptr > compile(InputSourceT& source)
+ std::unique_ptr > compile(InputSourceT& source)
{
error_ = "";
- std::auto_ptr > stylesheet(new CompiledStylesheet());
+ auto stylesheet = std::make_unique>();
StylesheetParser parser;
CompilationContext context(parser, *stylesheet.get());
@@ -252,7 +252,7 @@ public:
stylesheet.reset();
} // catch
- return std::auto_ptr >(stylesheet.release());
+ return std::unique_ptr >(stylesheet.release());
} // compile
const std::string& error() const
diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4
new file mode 100644
index 00000000..43087b2e
--- /dev/null
+++ b/m4/ax_cxx_compile_stdcxx.m4
@@ -0,0 +1,951 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the specified
+# version of the C++ standard. If necessary, add switches to CXX and
+# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
+# or '14' (for the C++14 standard).
+#
+# The second argument, if specified, indicates whether you insist on an
+# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
+# -std=c++11). If neither is specified, you get whatever works, with
+# preference for an extended mode.
+#
+# The third argument, if specified 'mandatory' or if left unspecified,
+# indicates that baseline support for the specified C++ standard is
+# required and that the macro should error out if no mode with that
+# support is found. If specified 'optional', then configuration proceeds
+# regardless, after defining HAVE_CXX${VERSION} if and only if a
+# supporting mode is found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik
+# Copyright (c) 2012 Zack Weinberg
+# Copyright (c) 2013 Roy Stogner
+# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov