[libxml++] Examples: More use of override keyword



commit 30730dffc71248deb04f944b21cafb65aa678d9b
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Mon Nov 16 16:36:47 2015 +0100

    Examples: More use of override keyword
    
    * examples/sax_parser_build_dom/svgparser.h:
    * examples/sax_parser_entities/myparser.h: Use the override keyword on all
    overridden virtual methods.

 examples/sax_parser_build_dom/svgparser.h |   20 ++++++++++----------
 examples/sax_parser_entities/myparser.h   |   10 ++++------
 2 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/examples/sax_parser_build_dom/svgparser.h b/examples/sax_parser_build_dom/svgparser.h
index 201de74..27ce4ea 100644
--- a/examples/sax_parser_build_dom/svgparser.h
+++ b/examples/sax_parser_build_dom/svgparser.h
@@ -36,17 +36,17 @@ public:
 
 protected:
   // SAX parser callbacks
-  void on_start_document() {};
-  void on_end_document() {};
+  void on_start_document() override {};
+  void on_end_document() override {};
   void on_start_element(const Glib::ustring& name,
-                                const AttributeList& properties);
-  void on_end_element(const Glib::ustring& name);
-  void on_characters(const Glib::ustring& characters);
-  void on_comment(const Glib::ustring& text);
-  void on_warning(const Glib::ustring& text);
-  void on_error(const Glib::ustring& text);
-  void on_fatal_error(const Glib::ustring& text);
-  void on_cdata_block(const Glib::ustring& text);
+                        const AttributeList& properties) override;
+  void on_end_element(const Glib::ustring& name) override;
+  void on_characters(const Glib::ustring& characters) override;
+  void on_comment(const Glib::ustring& text) override;
+  void on_warning(const Glib::ustring& text) override;
+  void on_error(const Glib::ustring& text) override;
+  void on_fatal_error(const Glib::ustring& text) override;
+  void on_cdata_block(const Glib::ustring& text) override;
 
 private:
   // context is a stack to keep track of parent node while the SAX parser
diff --git a/examples/sax_parser_entities/myparser.h b/examples/sax_parser_entities/myparser.h
index 91476ff..3000109 100644
--- a/examples/sax_parser_entities/myparser.h
+++ b/examples/sax_parser_entities/myparser.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
 /* myparser.h
  *
  * Copyright (C) 2002 The libxml++ development team
@@ -34,8 +32,8 @@ protected:
   //overrides:
   void on_start_document() override;
   void on_end_document() override;
-  virtual void on_start_element(const Glib::ustring& name,
-                                const AttributeList& properties);
+  void on_start_element(const Glib::ustring& name,
+                        const AttributeList& properties) override;
   void on_end_element(const Glib::ustring& name) override;
   void on_characters(const Glib::ustring& characters) override;
   void on_comment(const Glib::ustring& text) override;
@@ -44,8 +42,8 @@ protected:
   void on_fatal_error(const Glib::ustring& text) override;
 
   _xmlEntity* on_get_entity(const Glib::ustring& name) override;
-  void on_entity_declaration(const Glib::ustring& name, xmlpp::XmlEntityType type, const Glib::ustring& 
publicId, const Glib::ustring& systemId, const Glib::ustring& content) override;
+  void on_entity_declaration(const Glib::ustring& name, xmlpp::XmlEntityType type,
+    const Glib::ustring& publicId, const Glib::ustring& systemId, const Glib::ustring& content) override;
 };
 
-
 #endif //__LIBXMLPP_EXAMPLES_MYPARSER_H


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