[libxml++] Replace some auto_ptr by unique_ptr



commit b3155523855b628589a0fa088cbee3a51e7a678f
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Sun Aug 2 16:39:24 2015 +0200

    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.

 libxml++/parsers/parser.cc              |    4 ++--
 libxml++/parsers/saxparser.cc           |    2 +-
 libxml++/validators/relaxngvalidator.cc |    2 +-
 libxml++/validators/validator.cc        |    4 ++--
 libxml++/validators/xsdvalidator.cc     |    2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/libxml++/parsers/parser.cc b/libxml++/parsers/parser.cc
index 41d1a39..34ad6e4 100644
--- a/libxml++/parsers/parser.cc
+++ b/libxml++/parsers/parser.cc
@@ -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();
   }
diff --git a/libxml++/parsers/saxparser.cc b/libxml++/parsers/saxparser.cc
index eae8a77..e89f1df 100644
--- a/libxml++/parsers/saxparser.cc
+++ b/libxml++/parsers/saxparser.cc
@@ -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.
 
diff --git a/libxml++/validators/relaxngvalidator.cc b/libxml++/validators/relaxngvalidator.cc
index aca9ec8..0d00560 100644
--- a/libxml++/validators/relaxngvalidator.cc
+++ b/libxml++/validators/relaxngvalidator.cc
@@ -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);
 }
diff --git a/libxml++/validators/validator.cc b/libxml++/validators/validator.cc
index 9d0dbfa..3323e19 100644
--- a/libxml++/validators/validator.cc
+++ b/libxml++/validators/validator.cc
@@ -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();
   }
diff --git a/libxml++/validators/xsdvalidator.cc b/libxml++/validators/xsdvalidator.cc
index 80ca3f6..674296e 100644
--- a/libxml++/validators/xsdvalidator.cc
+++ b/libxml++/validators/xsdvalidator.cc
@@ -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);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]