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

Public Member Functions

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

Member Enumeration Documentation

Body

Enumerator
Body 
Object 
Text 
Report 

Definition at line 2627 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 9915 of file CCopasiXMLParser.cpp.

References pdelete.

9916 {
9918 }
#define pdelete(p)
Definition: copasi.h:215

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 9984 of file CCopasiXMLParser.cpp.

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

9985 {
9986  switch (mCurrentElement)
9987  {
9988  case Body:
9989 
9990  if (strcmp(pszName, "Body"))
9992  pszName, "Body", mParser.getCurrentLineNumber());
9993 
9996 
9997  /* Tell the parent element we are done. */
9998  mParser.onEndElement(pszName);
9999  break;
10000 
10001  case Text:
10002 
10003  if (strcmp(pszName, "html"))
10005  pszName, "html", mParser.getCurrentLineNumber());
10006 
10009  break;
10010 
10011  case Object:
10012 
10013  if (strcmp(pszName, "Object"))
10015  pszName, "Object", mParser.getCurrentLineNumber());
10016 
10019  break;
10020 
10021  case Report:
10022 
10023  if (strcmp(pszName, "Report"))
10025  pszName, "Report", mParser.getCurrentLineNumber());
10026 
10027  // add the key that is stored in mCommon.CharacterData to the map
10029  {
10030  mCommon.reportReferenceMap[mCommon.CharacterData] = std::vector<std::pair <std::vector<CRegisteredObjectName>*, size_t> >();
10031  }
10032 
10033  mCommon.reportReferenceMap[mCommon.CharacterData].push_back(std::pair<std::vector<CRegisteredObjectName>*, size_t>(mCommon.pReport->getBodyAddr(), mCommon.pReport->getBodyAddr()->size()));
10034  mCommon.pReport->getBodyAddr()->push_back(CCopasiObjectName(""));
10036  break;
10037 
10038  case UNKNOWN_ELEMENT:
10040  break;
10041 
10042  default:
10044  pszName, "???", mParser.getCurrentLineNumber());
10045  break;
10046  }
10047 }
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 > * getBodyAddr()
int getCurrentLineNumber() const
Definition: CExpat.h:470
CReportDefinition * pReport
void CCopasiXMLParser::BodyElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 9920 of file CCopasiXMLParser.cpp.

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

9922 {
9923  mCurrentElement++; /* We should always be on the next element */
9924  mpCurrentHandler = NULL;
9925 
9926  switch (mCurrentElement)
9927  {
9928  case Body:
9929 
9930  if (strcmp(pszName, "Body"))
9932  pszName, "Body", mParser.getCurrentLineNumber());
9933 
9934  return;
9935  break;
9936 
9937  case Text:
9938 
9939  if (!strcmp(pszName, "html"))
9940  {
9942  }
9943 
9944  break;
9945 
9946  case Object:
9947 
9948  if (!strcmp(pszName, "Object"))
9949  {
9950  /* If we do not have an Object element handler we create one. */
9951  if (!mpObjectElement)
9952  mpObjectElement = new ObjectElement(mParser, mCommon);
9953 
9955  }
9956 
9957  break;
9958 
9959  case Report:
9960 
9961  if (!strcmp(pszName, "Report"))
9963 
9964  break;
9965 
9966  default:
9970  break;
9971  }
9972 
9973  /* Push the current element handler on the stack and call it. */
9974  if (mpCurrentHandler)
9975  {
9977  }
9978 
9979  mParser.onStartElement(pszName, papszAttrs);
9980 
9981  return;
9982 }
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::BodyElement::mpObjectElement
private

Definition at line 2664 of file CCopasiXMLParser.h.


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