Comp_4_Assignment_7_DavidLordan
 All Files Functions
outputOptions.h
Go to the documentation of this file.
1 /* File: outputOptions.cpp
2  * Author: David Lordan, UMass Lowell Computer Science
3  * david_lordan@student.uml.edu
4  *
5  * Created on December 6th, 2014, 1:25 PM, modified on Dec 7th at 1:33 PM to
6  * add additional documentation.
7  *
8  * This is the header file for various output functions for the DOM tree,
9  * such as printing with the serializer, printing with the tree-walker, exporting
10  * to an XML file and the 'help' command.
11  *
12  * This program is to demonstrate use of regular expressions to parse command line
13  * user input along with using the Xerces library to create a DOM structure.
14  * This is an expansion of the previous assignment which was to create a 'hard-coded'
15  * DOM structure in memory and to display it to the user. This assignment goes further
16  * by building the tree dynamically from the user's requests as well as giving the
17  * user various options for tree manipulation. All basic commands are parsed with
18  * regular expressions to extract keywords and variable reflecting the meaning of the user's input.
19  */
20 
21 
22 #ifndef OUTPUTOPTIONS_H
23 #define OUTPUTOPTIONS_H
24 
25 /* Includes the necessary Xerces libraries and standard libraries. */
26 #include <xercesc/dom/DOM.hpp>
27 #include <xercesc/framework/StdOutFormatTarget.hpp>
28 #include <iostream>
29 #include "xercesc/dom/DOMTreeWalker.hpp"
30 
31 #include <string.h>
32 #include <stdlib.h>
33 
34 
35 /* Uses the Xerces and std namespace.*/
36 XERCES_CPP_NAMESPACE_USE
37  using namespace std;
38 
45 void exportTree(DOMDocument* doc, string fileName);
46 
53 void printTree(DOMDocument* doc, string parentName);
54 
58 void showHelp();
59 
69 void treeWalker(DOMDocument* doc, string subRoot);
70 
71 #endif /* OUTPUTOPTIONS_H */
72 
void treeWalker(DOMDocument *doc, string subRoot)
void printTree(DOMDocument *doc, string parentName)
void showHelp()
void exportTree(DOMDocument *doc, string fileName)