[libxml++] xmlpp::exception and its subclasses: Remove Raise() and Clone()



commit 485a960122a574f345a24ef587ff87e707bc95d9
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Wed Sep 23 15:50:05 2015 +0200

    xmlpp::exception and its subclasses: Remove Raise() and Clone()
    
    Remove the virtual methods Raise() and Clone() from xmlpp::exception and
    its subclasses. These methods are not needed now that std::exception_ptr
    is used for storing and later rethrowing an exception. Bug #754673.

 examples/sax_exception/myparser.cc    |   12 ------------
 examples/sax_exception/myparser.h     |    4 ----
 libxml++/exceptions/exception.cc      |   11 -----------
 libxml++/exceptions/exception.h       |    8 +-------
 libxml++/exceptions/internal_error.cc |   13 -------------
 libxml++/exceptions/internal_error.h  |    7 +------
 libxml++/exceptions/parse_error.cc    |   11 -----------
 libxml++/exceptions/parse_error.h     |    7 +------
 libxml++/exceptions/validity_error.cc |   11 -----------
 libxml++/exceptions/validity_error.h  |    7 +------
 10 files changed, 4 insertions(+), 87 deletions(-)
---
diff --git a/examples/sax_exception/myparser.cc b/examples/sax_exception/myparser.cc
index 19b5417..9c9013d 100644
--- a/examples/sax_exception/myparser.cc
+++ b/examples/sax_exception/myparser.cc
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
 /* myparser.cc
  *
  * Copyright (C) 2002 The libxml++ development team
@@ -36,16 +34,6 @@ MyException::~MyException() throw ()
 {
 }
 
-void MyException::Raise() const
-{
-  throw *this;
-}
-
-xmlpp::exception * MyException::Clone() const
-{
-  return new MyException(*this);
-}
-
 /*
  * MySaxParser implementation
  */
diff --git a/examples/sax_exception/myparser.h b/examples/sax_exception/myparser.h
index 7eb3a5d..3e1c2ee 100644
--- a/examples/sax_exception/myparser.h
+++ b/examples/sax_exception/myparser.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
 /* myparser.h
  *
  * Copyright (C) 2002 The libxml++ development team
@@ -29,8 +27,6 @@ class MyException: public xmlpp::exception
   public:
     MyException();
     ~MyException() noexcept override;
-    void Raise() const override;
-    xmlpp::exception * Clone() const override;
 };
 
 class MySaxParser : public xmlpp::SaxParser
diff --git a/libxml++/exceptions/exception.cc b/libxml++/exceptions/exception.cc
index 89b5a4d..3805779 100644
--- a/libxml++/exceptions/exception.cc
+++ b/libxml++/exceptions/exception.cc
@@ -17,16 +17,6 @@ const char* exception::what() const noexcept
   return message_.c_str();
 }
 
-void exception::Raise() const
-{
-  throw *this;
-}
-
-exception * exception::Clone() const
-{
-  return new exception(*this);
-}
-
 Glib::ustring format_xml_error(const _xmlError* error)
 {
   if (!error)
@@ -103,4 +93,3 @@ Glib::ustring format_xml_parser_error(const _xmlParserCtxt* parser_context)
 }
 
 } //namespace xmlpp
-
diff --git a/libxml++/exceptions/exception.h b/libxml++/exceptions/exception.h
index dffbe5a..4510075 100644
--- a/libxml++/exceptions/exception.h
+++ b/libxml++/exceptions/exception.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
 /* exception.h
  *
  * Copyright (C) 2002 The libxml++ development team
@@ -37,7 +35,7 @@ namespace xmlpp
 
 /** Base class for all xmlpp exceptions.
  */
-class LIBXMLPP_API exception: public std::exception
+class LIBXMLPP_API exception : public std::exception
 {
 public:
   explicit exception(const Glib::ustring& message);
@@ -45,10 +43,6 @@ public:
 
   const char* what() const noexcept override;
 
-  //TODO: Use lower-case names when we can break ABI?
-  virtual void Raise() const;
-  virtual exception * Clone() const;
-
 private:
   Glib::ustring message_;
 };
diff --git a/libxml++/exceptions/internal_error.cc b/libxml++/exceptions/internal_error.cc
index 13f6392..9f48cac 100644
--- a/libxml++/exceptions/internal_error.cc
+++ b/libxml++/exceptions/internal_error.cc
@@ -1,6 +1,5 @@
 #include "internal_error.h"
 
-
 namespace xmlpp {
 
 internal_error::internal_error(const Glib::ustring& message)
@@ -11,16 +10,4 @@ internal_error::internal_error(const Glib::ustring& message)
 internal_error::~internal_error() noexcept
 {}
 
-void internal_error::Raise() const
-{
-  throw *this;
-}
-
-exception * internal_error::Clone() const
-{
-  return new internal_error(*this);
-}
-
 } //namespace xmlpp
-
-
diff --git a/libxml++/exceptions/internal_error.h b/libxml++/exceptions/internal_error.h
index 887dd65..303109f 100644
--- a/libxml++/exceptions/internal_error.h
+++ b/libxml++/exceptions/internal_error.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
 /* internal_error.h
  *
  * Copyright (C) 2002 The libxml++ development team
@@ -29,14 +27,11 @@
 
 namespace xmlpp {
   
-class internal_error: public exception
+class internal_error : public exception
 {
 public:
   explicit internal_error(const Glib::ustring& message);
   ~internal_error() noexcept override;
-
-  void Raise() const override;
-  exception * Clone() const override;
 };
 
 } // namespace xmlpp
diff --git a/libxml++/exceptions/parse_error.cc b/libxml++/exceptions/parse_error.cc
index b9c1987..96bd53e 100644
--- a/libxml++/exceptions/parse_error.cc
+++ b/libxml++/exceptions/parse_error.cc
@@ -10,15 +10,4 @@ parse_error::parse_error(const Glib::ustring& message)
 parse_error::~parse_error() noexcept
 {}
 
-void parse_error::Raise() const
-{
-  throw *this;
-}
-
-exception* parse_error::Clone() const
-{
-  return new parse_error(*this);
-}
-
 } //namespace xmlpp
-
diff --git a/libxml++/exceptions/parse_error.h b/libxml++/exceptions/parse_error.h
index 12c8099..659b135 100644
--- a/libxml++/exceptions/parse_error.h
+++ b/libxml++/exceptions/parse_error.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
 /* parse_error.h
  *
  * Copyright (C) 2002 The libxml++ development team
@@ -32,14 +30,11 @@ namespace xmlpp
 
 /** This exception will be thrown when the parser encounters an error in the XML document.
  */  
-class parse_error: public exception
+class parse_error : public exception
 {
 public:
   explicit parse_error(const Glib::ustring& message);
   ~parse_error() noexcept override;
-
-  void Raise() const override;
-  exception* Clone() const override;
 };
 
 } // namespace xmlpp
diff --git a/libxml++/exceptions/validity_error.cc b/libxml++/exceptions/validity_error.cc
index d34332f..b0fdc24 100644
--- a/libxml++/exceptions/validity_error.cc
+++ b/libxml++/exceptions/validity_error.cc
@@ -10,15 +10,4 @@ validity_error::validity_error(const Glib::ustring& message)
 validity_error::~validity_error() noexcept
 {}
 
-void validity_error::Raise() const
-{
-  throw *this;
-}
-
-exception* validity_error::Clone() const
-{
-  return new validity_error(*this);
-}
-
 } //namespace xmlpp
-
diff --git a/libxml++/exceptions/validity_error.h b/libxml++/exceptions/validity_error.h
index 513d0e1..503eeb3 100644
--- a/libxml++/exceptions/validity_error.h
+++ b/libxml++/exceptions/validity_error.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
 /* validity_error.h
  *
  * Copyright (C) 2002 The libxml++ development team
@@ -29,14 +27,11 @@ namespace xmlpp
 
 /** This exception will be thrown when the parser encounters a validity error in the XML document.
  */
-class validity_error: public parse_error
+class validity_error : public parse_error
 {
 public:
   explicit validity_error(const Glib::ustring& message);
   ~validity_error() noexcept override;
-
-  void Raise() const override;
-  exception* Clone() const override;
 };
 
 } // namespace xmlpp


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