Isis 3 Programmer Reference
Isis::Image::XmlHandler Class Reference

Process XML in a stack-oriented fashion. More...

Inheritance diagram for Isis::Image::XmlHandler:
Inheritance graph
Collaboration diagram for Isis::Image::XmlHandler:
Collaboration graph

Public Member Functions

 XmlHandler (Image *image, FileName imageFolder)
 Create an XML Handler (reader) that can populate the Image class data. More...
 
virtual bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
 Read mage class attributes. More...
 
virtual bool characters (const QString &ch)
 This implementation of a virtual function calls QXmlDefaultHandler::characters(QString &ch) which in turn calls QXmlContentHandler::characters(QString &ch) which is called when the XML processor has parsed a chunk of character data. More...
 
virtual bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)
 The XML reader invokes this method at the end of every element in the XML document. More...
 
virtual void setReader (XmlStackedHandlerReader *)
 
void switchToNewHandler (XmlStackedHandler *nextHandler)
 Switch to a new content handler and continue processing using the new handler. More...
 

Protected Member Functions

XmlStackedHandlerReaderreader ()
 
const XmlStackedHandlerReaderreader () const
 
bool fatalError (const QXmlParseException &exception)
 

Private Member Functions

 Q_DISABLE_COPY (XmlHandler)
 

Private Attributes

Imagem_image
 Pointer to the Image. More...
 
FileName m_imageFolder
 The Name/path of the image. More...
 
QString m_characters
 Character data storage found in the content of XML elements. More...
 

Detailed Description

Process XML in a stack-oriented fashion.

Child class for XmlStackedHandler which is used to process XML in a stack-oriented way. It's been modified to process an Image object object.

Author
2012-??-?? Steven Lambright
History:
2016-06-23 Tyler Wilson - Added documention to the member functions. Fixes #3950.

Definition at line 172 of file Image.h.

Constructor & Destructor Documentation

◆ XmlHandler()

Isis::Image::XmlHandler::XmlHandler ( Image image,
FileName  imageFolder 
)

Create an XML Handler (reader) that can populate the Image class data.

See also
Image::save() for the expected format.
Parameters
imageThe image we're going to be initializing
imageFolderThe folder that contains the Cube

Definition at line 830 of file Image.cpp.

References m_image, and m_imageFolder.

Member Function Documentation

◆ characters()

bool Isis::Image::XmlHandler::characters ( const QString &  ch)
virtual

This implementation of a virtual function calls QXmlDefaultHandler::characters(QString &ch) which in turn calls QXmlContentHandler::characters(QString &ch) which is called when the XML processor has parsed a chunk of character data.

See also
XmlStackedHandler, QXmlDefaultHandler,QXmlContentHandler
Parameters
chThe character data.
Returns
bool Returns True if there were no problems with the character processing. It returns False if there was a problem, and the XML reader stops.

Definition at line 946 of file Image.cpp.

◆ endElement()

bool Isis::Image::XmlHandler::endElement ( const QString &  namespaceURI,
const QString &  localName,
const QString &  qName 
)
virtual

The XML reader invokes this method at the end of every element in the XML document.

This expects <image> and <footprint> elements.

Parameters
namespaceURIThe Uniform Resource Identifier of the namespace (eg. "xmlns")
localNameThe local name string (eg. "xhtml")
qNameThe XML qualified string (eg. "xmlns:xhtml"). This can be empty if QNames are not available.
Returns
bool If this function returns True, then a signal is sent to the reader indicating the end of the element. If this function returns False, something bad happened and processing stops.

Reimplemented from Isis::XmlStackedHandler.

Definition at line 964 of file Image.cpp.

References Isis::PolygonTools::MakeMultiPolygon().

◆ startElement()

bool Isis::Image::XmlHandler::startElement ( const QString &  namespaceURI,
const QString &  localName,
const QString &  qName,
const QXmlAttributes &  atts 
)
virtual

Read mage class attributes.

The XML reader invokes this method at the start of every element in the XML document. This expects <image> and <displayProperties> elements. A quick example using this function: startElement("xsl","stylesheet","xsl:stylesheet",attributes)

Parameters
namespaceURIThe Uniform Resource Identifier of the element's namespace
localNameThe local name string
qNameThe XML qualified string (or empty, if QNames are not available).
attsThe XML attributes attached to each element
Returns
bool Returns True signalling to the reader the start of a valid XML element. If False is returned, something bad happened.

Reimplemented from Isis::XmlStackedHandler.

Definition at line 852 of file Image.cpp.

References Isis::Image::fileName(), Isis::Distance::Meters, and Isis::Angle::Radians.

◆ switchToNewHandler()

void Isis::XmlStackedHandler::switchToNewHandler ( XmlStackedHandler nextHandler)
inherited

Switch to a new content handler and continue processing using the new handler.

Definition at line 32 of file XmlStackedHandler.cpp.

Referenced by Isis::XmlStackedHandlerReader::pushContentHandler().

Member Data Documentation

◆ m_characters

QString Isis::Image::XmlHandler::m_characters
private

Character data storage found in the content of XML elements.

Definition at line 187 of file Image.h.

◆ m_image

Image* Isis::Image::XmlHandler::m_image
private

Pointer to the Image.

Definition at line 185 of file Image.h.

Referenced by XmlHandler().

◆ m_imageFolder

FileName Isis::Image::XmlHandler::m_imageFolder
private

The Name/path of the image.

Definition at line 186 of file Image.h.

Referenced by XmlHandler().


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