Commit b3155523 authored by Kjell Ahlstedt's avatar Kjell Ahlstedt

Replace some auto_ptr by unique_ptr

* libxml++/parsers/parser.cc:
* libxml++/parsers/saxparser.cc:
* libxml++/validators/relaxngvalidator.cc:
* libxml++/validators/validator.cc:
* libxml++/validators/xsdvalidator.cc: Replace the deprecated std::auto_ptr
by std::unique_ptr. There are still auto_ptrs in header files. Replacing
them would break ABI. Bug #753123.
parent 69e01a60
......@@ -12,7 +12,7 @@
#include <libxml/parser.h>
#include <memory> //For auto_ptr.
#include <memory> //For unique_ptr.
#include <map>
//TODO: See several TODOs in parser.h for changes at the next API/ABI break.
......@@ -371,7 +371,7 @@ void Parser::check_for_exception()
if(exception_)
{
std::auto_ptr<exception> tmp ( exception_ );
std::unique_ptr<exception> tmp(exception_);
exception_ = nullptr;
tmp->Raise();
}
......
......@@ -150,7 +150,7 @@ void SaxParser::parse()
// in entity_resolver_doc_ should be deleted and replaced by a new one.
// Otherwise entity declarations from a previous parsing may erroneously affect
// this parsing. This would be much easier if entity_resolver_doc_ were a
// std::auto_ptr<Document>, so the xmlpp::Document could be deleted and a new
// std::unique_ptr<Document>, so the xmlpp::Document could be deleted and a new
// one created. A good place for such code would be in an overridden
// SaxParser::initialize_context(). It would be an ABI break.
......
......@@ -72,7 +72,7 @@ void RelaxNGValidator::parse_file(const Glib::ustring& filename)
void RelaxNGValidator::parse_memory(const Glib::ustring& contents)
{
std::auto_ptr<RelaxNGSchema> schema(new RelaxNGSchema());
std::unique_ptr<RelaxNGSchema> schema(new RelaxNGSchema());
schema->parse_memory(contents);
set_schema(schema.release(), true);
}
......
......@@ -10,7 +10,7 @@
#include <libxml/parser.h>
#include <cstdarg> //For va_list.
#include <memory> //For auto_ptr.
#include <memory> //For unique_ptr.
namespace xmlpp {
......@@ -165,7 +165,7 @@ void Validator::check_for_exception()
if(exception_)
{
std::auto_ptr<exception> tmp(exception_);
std::unique_ptr<exception> tmp(exception_);
exception_ = nullptr;
tmp->Raise();
}
......
......@@ -69,7 +69,7 @@ void XsdValidator::parse_file(const Glib::ustring& filename)
void XsdValidator::parse_memory(const Glib::ustring& contents)
{
std::auto_ptr<XsdSchema> schema(new XsdSchema());
std::unique_ptr<XsdSchema> schema(new XsdSchema());
schema->parse_memory(contents);
set_schema(schema.release(), true);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment