Comp_4_Assignment_7_DavidLordan
 All Files Functions
Functions
outputOptions.cpp File Reference
#include <string.h>
#include <stdlib.h>
#include "outputOptions.h"
#include <xercesc/framework/LocalFileFormatTarget.hpp>
#include <boost/regex.hpp>

Go to the source code of this file.

Functions

void exportTree (DOMDocument *doc, string fileName)
 
void showHelp ()
 
void printTree (DOMDocument *doc, string subRoot)
 
void displayAttributes (DOMNamedNodeMap *attributes, int level)
 
void treeWalker (DOMDocument *doc, string subRoot)
 

Function Documentation

void displayAttributes ( DOMNamedNodeMap *  attributes,
int  level 
)

Function to display a DOM element's attributes.

Parameters
attributes- a DOM map which contains a list of attribute names and values.
level- The level on which an attribute's parent is located. Used for output formatting.

Definition at line 177 of file outputOptions.cpp.

void exportTree ( DOMDocument *  doc,
string  fileName 
)

Function to export the DOM structure to an external XML file. This implementation is virtually identical to the 'print' function which user the serializer.

Parameters
doc- The DOMDocument that is to be exported.
fileName- The XML file name specified by the user

Definition at line 42 of file outputOptions.cpp.

void printTree ( DOMDocument *  doc,
string  subRoot 
)

Function to print the tree in an XML format. If an element is provided, the subtree from that element will be printed.

Parameters
doc- The document whos structure is to be printed
subRoot- The element whose subtree is to be printed, default is the root

Definition at line 121 of file outputOptions.cpp.

void showHelp ( )

Function to display all of the basic commands, thier uses and syntax

Definition at line 89 of file outputOptions.cpp.

void treeWalker ( DOMDocument *  doc,
string  subRoot 
)

Function that implements the DOMTreeWalkers which is used to traverse the DOM structure. Creates the tree then scans through each node, checks its type, and depending on the results outputs the content in a particular format. The user may provide an element name whose subtree will be printed. By default the entire tree is displayed

Parameters
doc- The DOM document containing the DOM structure.
subRoot- The element whose subtree is to be displayed

Definition at line 211 of file outputOptions.cpp.