XmlDocument Class Reference

An abstract base class of XML document element wrapper. More...

#include <XmlDocument.h>

Inheritance diagram for XmlDocument:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Status { Success, OpenError, ParseError, WriteError }
 

Status codes for opening an XML document.

More...

Public Member Functions

virtual void appendChild (XmlElement &)=0
 Appends the root element to the document.
virtual XmlElementcreateElement (const std::string &tagName)=0
 Creates a new DOM element wrapper object and returns a pointer to it.
virtual XmlTextNodecreateTextNode (const std::string &tag)=0
 Creates a new DOM Text node.
virtual XmlElementdocumentElement () const =0
 Returns the root document element.
virtual Status saveToFile (const std::string &filename)=0
 Saves the document to the file.
virtual Status setContent (const std::string &filename)=0
 Sets the content of the XML document from the text in the file filename.
virtual ~XmlDocument ()
 The destructor.

Protected Member Functions

 XmlDocument ()
 The default constructor.

Private Member Functions

 XmlDocument (const XmlDocument &)
 A private copy constructor in order to avoid copying.

Detailed Description

An abstract base class of XML document element wrapper.

A derived class must implement the pure virtual functions probably using an extern XML package.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 32 of file XmlDocument.h.


Member Enumeration Documentation

enum Status

Status codes for opening an XML document.

Enumerator:
Success 
OpenError 
ParseError 
WriteError 

Definition at line 37 of file XmlDocument.h.


Constructor & Destructor Documentation

XmlDocument ( const XmlDocument  )  [private]

A private copy constructor in order to avoid copying.

XmlDocument (  )  [protected]

The default constructor.

@ file

XmlDocument implementation

Copyright (C) 2002, 2005 The Board of Trustees of The Leland Stanford Junior University. All Rights Reserved.

Id
XmlDocument.cxx,v 1.4 2005/11/05 17:30:55 pfkeb Exp

Definition at line 14 of file XmlDocument.cxx.

~XmlDocument (  )  [virtual]

The destructor.

Definition at line 18 of file XmlDocument.cxx.


Member Function Documentation

virtual void appendChild ( XmlElement  )  [pure virtual]

Appends the root element to the document.

Implemented in QtXmlDocument.

Referenced by XmlController::createDocument().

virtual XmlElement* createElement ( const std::string &  tagName  )  [pure virtual]

Creates a new DOM element wrapper object and returns a pointer to it.

The receiver takes procession of the object and is responsible for its deletion.

Implemented in QtXmlDocument.

Referenced by NTupleProjectorXML::createChildren(), PlotterBaseXML::createCutChildren(), XmlController::createDocument(), BaseXML::createElement(), DataRepXML::createFunctionTargetChild(), and PlotterBaseXML::createTextChildren().

virtual XmlTextNode* createTextNode ( const std::string &  tag  )  [pure virtual]

Creates a new DOM Text node.

Implemented in QtXmlDocument.

virtual XmlElement* documentElement (  )  const [pure virtual]
virtual Status saveToFile ( const std::string &  filename  )  [pure virtual]

Saves the document to the file.

Returns:
XmlDocument::Success if successful, otherwise XmlDocument::WriteError.

Implemented in QtXmlDocument.

Referenced by XmlController::saveToFile().

virtual Status setContent ( const std::string &  filename  )  [pure virtual]

Sets the content of the XML document from the text in the file filename.

Also sets the application's current working directory to the path to the file. This is done so that files referenced by the XML document can be found relative to the document itself.

Returns:
XmlDocument::Success if successful. XmlDocument::OpenError if the file could not be opened or XmlDocument::ParseError if the file was not successfully parsed.

Implemented in QtXmlDocument.

Referenced by XmlController::openDocument().


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

Generated for HippoDraw Class Library by doxygen