VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
VICI::EbnfXml Class Reference

A specialization of the Xml class for the parse tree. More...

#include <vici/parseTree.h>

Inheritance diagram for VICI::EbnfXml:
VICI::cfi::Xml

Public Member Functions

 EbnfXml ()
 constructor
 
void exportTree (EbnfTree *tree, const Path &path)
 export the tree to parse-tree.xml More...
 
void importTree (EbnfTree *tree, const Path &path)
 import a tree from parse-tree.xml More...
 
- Public Member Functions inherited from VICI::cfi::Xml
virtual ~Xml ()
 Destructor.
 
void setDtd (csr name, const Path &dtd)
 Set DTD identifier to dtd, which is just the dtd file name. More...
 
void setDtd (csr name, csr ident, csr url)
 Set DTD identifier. More...
 
void getDtdIdentifiers (csr dtdName, std::string &publicId, std::string &systemId)
 Get the public identifier for the DTD. More...
 
void setCompression (int rate)
 Set the compression rate for saving the document. More...
 
void save ()
 Save the document.
 
void save (const Path &fname)
 Save the document to a new file. More...
 
void pack (XmlBuffer &)
 Save the document into a buffer.
 
bool dirty ()
 Check if the document has been modified. More...
 
void setDirty (bool dt)
 Access to dirty flag if we change document outside of this interface. More...
 
bool safeToSave ()
 Check if can save without clobbering other input. More...
 
void reload ()
 Reload the XML file.
 

Additional Inherited Members

- Protected Member Functions inherited from VICI::cfi::Xml
void createXPathContext ()
 Call this whenever mDoc is explicitly updated.
 
void registerNamespace (const std::string &prefix, csr uri)
 
 Xml ()
 Constructor.
 
void open (const Path &fname)
 Open an existing XML file. More...
 
void create (const Path &fname, csr root_element)
 Create a new xml file and document. More...
 
void unpack (XmlBuffer &)
 Create a document from the content of a buffer.
 
void freeDoc ()
 release the document from memory
 
void setProp (xmlNodePtr node, csr prop, csr val)
 Set a string property. More...
 
void setProp (xmlNodePtr node, csr prop, int val)
 Set an integer property. More...
 
void setProp (xmlNodePtr node, csr prop, double val)
 Set a double property. More...
 
void setContent (xmlNodePtr node, csr text)
 Set the content for the node. More...
 
void setCDATAContent (xmlNodePtr node, csr text)
 Set the content for the node using CDATA. More...
 
void getPropString (xmlNodePtr node, csr prop, std::string &val)
 Get the property value as a string. More...
 
void getPropInt (xmlNodePtr node, csr prop, int &val)
 Get the property value as an integer. More...
 
void getPropShort (xmlNodePtr node, csr prop, short &val)
 Get the property value as a short integer. More...
 
void getPropDouble (xmlNodePtr node, csr prop, double &val)
 Get the property value as a double. More...
 
std::string getNodeContent (xmlNodePtr p, int expand=1) const
 Get the content of the node. More...
 
std::string getNodeName (xmlNodePtr p) const
 Get the name of the node. More...
 
xmlNodePtr getRoot ()
 Get the root node.
 
xmlNodePtr getChild (xmlNodePtr node, csr name) const
 Get a child node by name. More...
 
int getChildren (xmlNodePtr node, std::vector< xmlNodePtr > &nodes) const
 Get the children of the node. More...
 
xmlNodePtr newNode (xmlNodePtr node, csr name)
 Create a new node. More...
 
void deleteNode (xmlNodePtr node)
 Delete a node and all of its children. More...
 
int find (csr xpath_expression, std::vector< xmlNodePtr > &nodes)
 Find nodes matching an XPath. More...
 
- Static Protected Member Functions inherited from VICI::cfi::Xml
static xmlNodePtr newTextChild (xmlNodePtr node, csr name, csr text)
 Create a new node with text content. More...
 
- Protected Attributes inherited from VICI::cfi::Xml
Path mFilename
 the XML file that the object represents
 
struct stat xmlStat
 time the file was last accessed by us
 
xmlDocPtr mDoc
 pointer to the root document object
 
xmlXPathContextPtr mCtx
 XML XPath context.
 
bool mDirty
 true when an update has been made, and saving is required.
 
bool mIsOpen
 true if the file is open
 
int mCompression
 0 is uncompressed, thru 9 for max zlib compression
 
- Static Protected Attributes inherited from VICI::cfi::Xml
static const int UMASK_RW_RW_R = 0664 ^ 0777
 Default umask for xml files created.
 
static bool xpathinit = false
 flag to indicate if xpath has been initialized
 

Detailed Description

A specialization of the Xml class for the parse tree.

A specialization of the Xml class used to save and restore a parse tree. This is mostly used during testing of the syntax library so that a variety of test cases can be created without needing the EBNF library.

Member Function Documentation

void EbnfXml::exportTree ( EbnfTree tree,
const Path path 
)

export the tree to parse-tree.xml

Parameters
treeThe tree to export
pathThe path to write file to.
void EbnfXml::importTree ( EbnfTree tree,
const Path path 
)

import a tree from parse-tree.xml

Parameters
treeThe tree to import into
pathThe path to load the file from.

The documentation for this class was generated from the following files: