Project 3 Posted: October 31, 2019

Project 3 continues work on srcReport. It is due Nov 19, and involves the following stages:

  1. Tag “v3a”: Perform all programming style changes to your class from the feedback for Project 2.

  2. Create a branch called callbacks to preserve the current design, but allow you to make changes.

  3. Tab “v3b”: In the master branch (make sure you are on the right branch), redesign XMLParser to use virtual methods as extension points. You then will create a srcReport class in the file srcReport.cpp that derives from XMLParser. Instead of lambda callbacks, use virtual methods. In srcReport, you then only have to implement only the derived methods that you need for srcReport.

    Note that your XML parser should provide access to all parts of XML, even if srcReport does not use it, via the following extension points:

    1. XML Declaration: version, encoding, standalone
    2. Start Tag: qname, local_name, prefix
    3. End Tag: qname, local_name, prefix
    4. Characters: content
    5. Attribute: qname, local_name, prefix, value
    6. XML Namespace: prefix, name, url
    7. XML Comments: content
    8. CDATA: content

    Pull requests will be available to add low-level processing that was not in the original code given to you. For any low-level processing that was not handled by the starting srcReport.cpp can be hard coded, e.g., XML declaration version (“1.0”), encoding (“UTF-8”), and standalone (“no”).

  4. Tab “v3c” Extract a “handler” from XMLParser called XMLParserHandler, a new class that only handles the user-defined processing (what we used to have as callbacks). A pull request to your project will add the necessary file and update the Makefile. Put the entire XMLParserHandler class in the file XMLParser.hpp
  5. Tag “v3d” Redesign the limited error handling to use exceptions

Keep in mind:

At every commit, make sure the project compiles, builds, and produces the correct answer.