COPASI API  4.16.103
Public Member Functions | Private Types | Private Attributes | List of all members
CCopasiXMLParser::HeaderElement Class Reference
Inheritance diagram for CCopasiXMLParser::HeaderElement:
Inheritance graph
[legend]
Collaboration diagram for CCopasiXMLParser::HeaderElement:
Collaboration graph
[legend]

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 HeaderElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~HeaderElement ()
 
- Public Member Functions inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
 CXMLElementHandler (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void end (const XML_Char *C_UNUSED(pszName))
 
virtual void reset ()
 
virtual void start (const XML_Char *C_UNUSED(pszName), const XML_Char **C_UNUSED(papszAttrs))
 
virtual ~CXMLElementHandler ()
 

Private Types

enum  Element { Header = 0, Object, Text, Report }
 

Private Attributes

ObjectElementmpObjectElement
 

Additional Inherited Members

- Protected Member Functions inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
void addFix (const std::string &key, CCopasiObject *pObject)
 
void deleteCurrentHandler ()
 
- Protected Attributes inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
SCopasiXMLParserCommonmCommon
 
C_INT32 mCurrentElement
 
C_INT32 mLastKnownElement
 
CCopasiXMLParsermParser
 
CXMLElementHandlermpCurrentHandler
 

Detailed Description

Definition at line 2573 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CCopasiXMLParser::HeaderElement::HeaderElement ( CCopasiXMLParser parser,
SCopasiXMLParserCommon common 
)
CCopasiXMLParser::HeaderElement::~HeaderElement ( )
virtual

Destructor

Definition at line 9775 of file CCopasiXMLParser.cpp.

References pdelete.

9776 {
9778 }
#define pdelete(p)
Definition: copasi.h:215

Member Function Documentation

void CCopasiXMLParser::HeaderElement::end ( const XML_Char *  pszName)
virtual

End element handler

Parameters
constXML_Char *pszName

Definition at line 9844 of file CCopasiXMLParser.cpp.

References SCopasiXMLParserCommon::CharacterData, CCopasiMessage::EXCEPTION, CCopasiObject::getCN(), CReportDefinition::getHeaderAddr(), CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pReport, SCopasiXMLParserCommon::reportReferenceMap, START_ELEMENT, and UNKNOWN_ELEMENT.

9845 {
9846  switch (mCurrentElement)
9847  {
9848  case Header:
9849 
9850  if (strcmp(pszName, "Header"))
9852  pszName, "Header", mParser.getCurrentLineNumber());
9853 
9856 
9857  /* Tell the parent element we are done. */
9858  mParser.onEndElement(pszName);
9859  break;
9860 
9861  case Text:
9862 
9863  if (strcmp(pszName, "html"))
9865  pszName, "html", mParser.getCurrentLineNumber());
9866 
9869  break;
9870 
9871  case Object:
9872 
9873  if (strcmp(pszName, "Object"))
9875  pszName, "Object", mParser.getCurrentLineNumber());
9876 
9879  break;
9880 
9881  case Report:
9882 
9883  if (strcmp(pszName, "Report"))
9885  pszName, "Report", mParser.getCurrentLineNumber());
9886 
9887  // add the key that is stored in mCommon.CharacterData to the map
9889  {
9890  mCommon.reportReferenceMap[mCommon.CharacterData] = std::vector<std::pair <std::vector<CRegisteredObjectName>*, size_t> >();
9891  }
9892 
9893  mCommon.reportReferenceMap[mCommon.CharacterData].push_back(std::pair<std::vector<CRegisteredObjectName>*, size_t>(mCommon.pReport->getHeaderAddr(), mCommon.pReport->getHeaderAddr()->size()));
9894  mCommon.pReport->getHeaderAddr()->push_back(CCopasiObjectName(""));
9896  break;
9897 
9898  case UNKNOWN_ELEMENT:
9900  break;
9901 
9902  default:
9904  pszName, "???", mParser.getCurrentLineNumber());
9905  break;
9906  }
9907 }
std::map< std::string, std::vector< std::pair< std::vector< CRegisteredObjectName > *, size_t > > > reportReferenceMap
#define START_ELEMENT
virtual CCopasiObjectName getCN() const
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
CReportDefinition * pReport
std::vector< CRegisteredObjectName > * getHeaderAddr()
void CCopasiXMLParser::HeaderElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 9780 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, and UNKNOWN_ELEMENT.

9782 {
9783  mCurrentElement++; /* We should always be on the next element */
9784  mpCurrentHandler = NULL;
9785 
9786  switch (mCurrentElement)
9787  {
9788  case Header:
9789 
9790  if (strcmp(pszName, "Header"))
9792  pszName, "Header", mParser.getCurrentLineNumber());
9793 
9794  return;
9795  break;
9796 
9797  case Text:
9798 
9799  if (!strcmp(pszName, "html"))
9800  {
9802  }
9803 
9804  break;
9805 
9806  case Object:
9807 
9808  if (!strcmp(pszName, "Object"))
9809  {
9810  /* If we do not have an Object element handler we create one. */
9811  if (!mpObjectElement)
9812  mpObjectElement = new ObjectElement(mParser, mCommon);
9813 
9815  }
9816 
9817  break;
9818 
9819  case Report:
9820 
9821  if (!strcmp(pszName, "Report"))
9823 
9824  break;
9825 
9826  default:
9830  break;
9831  }
9832 
9833  /* Push the current element handler on the stack and call it. */
9834  if (mpCurrentHandler)
9835  {
9837  }
9838 
9839  mParser.onStartElement(pszName, papszAttrs);
9840 
9841  return;
9842 }
UnknownElement mUnknownElement
#define MCXML
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
CharacterDataElement mCharacterDataElement
int getCurrentLineNumber() const
Definition: CExpat.h:470
CommentElement mCommentElement

Member Data Documentation

ObjectElement* CCopasiXMLParser::HeaderElement::mpObjectElement
private

Definition at line 2617 of file CCopasiXMLParser.h.


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