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

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 FooterElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~FooterElement ()
 
- 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 { Footer = 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 2667 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Destructor

Definition at line 10055 of file CCopasiXMLParser.cpp.

References pdelete.

10056 {
10058 }
#define pdelete(p)
Definition: copasi.h:215

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 10124 of file CCopasiXMLParser.cpp.

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

10125 {
10126  switch (mCurrentElement)
10127  {
10128  case Footer:
10129 
10130  if (strcmp(pszName, "Footer"))
10132  pszName, "Footer", mParser.getCurrentLineNumber());
10133 
10136 
10137  /* Tell the parent element we are done. */
10138  mParser.onEndElement(pszName);
10139  break;
10140 
10141  case Text:
10142 
10143  if (strcmp(pszName, "html"))
10145  pszName, "html", mParser.getCurrentLineNumber());
10146 
10149  break;
10150 
10151  case Object:
10152 
10153  if (strcmp(pszName, "Object"))
10155  pszName, "Object", mParser.getCurrentLineNumber());
10156 
10159  break;
10160 
10161  case Report:
10162 
10163  if (strcmp(pszName, "Report"))
10165  pszName, "Object", mParser.getCurrentLineNumber());
10166 
10167  // add the key that is stored in mCommon.CharacterData to the map
10169  {
10170  mCommon.reportReferenceMap[mCommon.CharacterData] = std::vector<std::pair <std::vector<CRegisteredObjectName>*, size_t> >();
10171  }
10172 
10173  mCommon.reportReferenceMap[mCommon.CharacterData].push_back(std::pair<std::vector<CRegisteredObjectName>*, size_t>(mCommon.pReport->getFooterAddr(), mCommon.pReport->getFooterAddr()->size()));
10174  mCommon.pReport->getFooterAddr()->push_back(CCopasiObjectName(""));
10176  break;
10177 
10178  case UNKNOWN_ELEMENT:
10180  break;
10181 
10182  default:
10184  pszName, "???", mParser.getCurrentLineNumber());
10185  break;
10186  }
10187 }
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
std::vector< CRegisteredObjectName > * getFooterAddr()
int getCurrentLineNumber() const
Definition: CExpat.h:470
CReportDefinition * pReport
void CCopasiXMLParser::FooterElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 10060 of file CCopasiXMLParser.cpp.

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

10062 {
10063  mCurrentElement++; /* We should always be on the next element */
10064  mpCurrentHandler = NULL;
10065 
10066  switch (mCurrentElement)
10067  {
10068  case Footer:
10069 
10070  if (strcmp(pszName, "Footer"))
10072  pszName, "Footer", mParser.getCurrentLineNumber());
10073 
10074  return;
10075  break;
10076 
10077  case Text:
10078 
10079  if (!strcmp(pszName, "html"))
10080  {
10082  }
10083 
10084  break;
10085 
10086  case Object:
10087 
10088  if (!strcmp(pszName, "Object"))
10089  {
10090  /* If we do not have an Object element handler we create one. */
10091  if (!mpObjectElement)
10092  mpObjectElement = new ObjectElement(mParser, mCommon);
10093 
10095  }
10096 
10097  break;
10098 
10099  case Report:
10100 
10101  if (!strcmp(pszName, "Report"))
10103 
10104  break;
10105 
10106  default:
10110  break;
10111  }
10112 
10113  /* Push the current element handler on the stack and call it. */
10114  if (mpCurrentHandler)
10115  {
10117  }
10118 
10119  mParser.onStartElement(pszName, papszAttrs);
10120 
10121  return;
10122 }
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::FooterElement::mpObjectElement
private

Definition at line 2711 of file CCopasiXMLParser.h.


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