musrWiz 0.1.0
Loading...
Searching...
No Matches
PFuncXMLParser Class Reference

The PFuncXMLParser class parses the musrfit_funcs.xml file. More...

#include <PAdmin.h>

Public Member Functions

 PFuncXMLParser (const QString &fln, PAdmin *)
 Constructor. Parses the given XML file.
 
virtual ~PFuncXMLParser ()
 Destructor.
 
virtual bool isValid ()
 Checks if the XML parsing was successful.
 

Private Types

enum  EFuncKeyWords {
  eEmpty , eTemplateName , eTemplateTheo , eTemplateFunc ,
  eName , eAbbrv , eNoOfParam , eParam ,
  eParamName , eParamValue , eParamMap
}
 Enumeration of XML tag keywords for parsing state machine. More...
 

Private Member Functions

bool parse (QIODevice *device)
 
bool startDocument ()
 
bool startElement ()
 
bool endElement ()
 
bool characters ()
 
bool endDocument ()
 

Private Attributes

QXmlStreamReader fXml
 xml stream reader object
 
bool fValid
 flag showing if XML read has been successful
 
EFuncKeyWords fKeyWord
 key word tag to know how to handle the content
 
PAdminfAdmin
 a pointer to the main administration class object
 
PTheoTemplate fTheoTemplate
 current theory template being parsed
 
PMusrfitFunc fFunc
 current function being parsed
 
PFuncParam fParam
 current function parameter being parsed
 

Detailed Description

The PFuncXMLParser class parses the musrfit_funcs.xml file.

This class reads and parses the XML file containing musrfit function definitions and theory templates. The parsed data is stored in the PAdmin object which is passed to the constructor.

Member Enumeration Documentation

◆ EFuncKeyWords

Enumeration of XML tag keywords for parsing state machine.

Enumerator
eEmpty 
eTemplateName 
eTemplateTheo 
eTemplateFunc 
eName 
eAbbrv 
eNoOfParam 
eParam 
eParamName 
eParamValue 
eParamMap 

Constructor & Destructor Documentation

◆ PFuncXMLParser()

PFuncXMLParser::PFuncXMLParser ( const QString & fln,
PAdmin * admin )

Constructor. Parses the given XML file.

Parameters
flnPath to the musrfit_funcs.xml file.
adminPointer to the PAdmin object where parsed data will be stored.

XML Parser class for the musrWiz function file.

Parameters
adminpointer to an admin class instance.

◆ ~PFuncXMLParser()

virtual PFuncXMLParser::~PFuncXMLParser ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ characters()

bool PFuncXMLParser::characters ( )
private

This routine delivers the content of an XML tag. It fills the content into the load data structure.

◆ endDocument()

bool PFuncXMLParser::endDocument ( )
private

Called at the end of the XML parse process. It checks if default paths contain system variables, and if so expand them for the further use.

◆ endElement()

bool PFuncXMLParser::endElement ( )
private

Routine called when the end XML tag is found. It is used to put the filtering tag to 'empty'. It also resets the fFunc flag in case the entry was a theory function.

◆ isValid()

virtual bool PFuncXMLParser::isValid ( )
inlinevirtual

Checks if the XML parsing was successful.

Returns
true if parsing succeeded, false otherwise.

◆ parse()

bool PFuncXMLParser::parse ( QIODevice * device)
private

parse musrfit_funcs.xml

Parameters
deviceQFile object of musrfit_funcs.xml
Returns
true on success, false otherwise

◆ startDocument()

bool PFuncXMLParser::startDocument ( )
private

Routine called at the beginning of the XML parsing process.

◆ startElement()

bool PFuncXMLParser::startElement ( )
private

Routine called when a new XML tag is found. Here it is used to set a tag for filtering afterwards the content.

Member Data Documentation

◆ fAdmin

PAdmin* PFuncXMLParser::fAdmin
private

a pointer to the main administration class object

◆ fFunc

PMusrfitFunc PFuncXMLParser::fFunc
private

current function being parsed

◆ fKeyWord

EFuncKeyWords PFuncXMLParser::fKeyWord
private

key word tag to know how to handle the content

◆ fParam

PFuncParam PFuncXMLParser::fParam
private

current function parameter being parsed

◆ fTheoTemplate

PTheoTemplate PFuncXMLParser::fTheoTemplate
private

current theory template being parsed

◆ fValid

bool PFuncXMLParser::fValid
private

flag showing if XML read has been successful

◆ fXml

QXmlStreamReader PFuncXMLParser::fXml
private

xml stream reader object


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