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

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 SBMLReferenceElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~SBMLReferenceElement ()
 
- 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 { SBMLReference = 0, SBMLMap }
 

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 3666 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
SBMLReference 
SBMLMap 

Definition at line 3674 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 10792 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 10845 of file CCopasiXMLParser.cpp.

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

10846 {
10847  switch (mCurrentElement)
10848  {
10849  case SBMLReference:
10850 
10851  if (strcmp(pszName, "SBMLReference"))
10853  pszName, "SBMLReference", mParser.getCurrentLineNumber());
10854 
10857 
10858  /* Tell the parent element we are done. */
10859  mParser.onEndElement(pszName);
10860  break;
10861 
10862  case SBMLMap:
10863 
10864  if (strcmp(pszName, "SBMLMap"))
10866  pszName, "SBMLMap", mParser.getCurrentLineNumber());
10867 
10869  break;
10870 
10871  case UNKNOWN_ELEMENT:
10872  mCurrentElement = mLastKnownElement;
10873  break;
10874 
10875  default:
10877  pszName, "???", mParser.getCurrentLineNumber());
10878  break;
10879  }
10880 
10881  return;
10882 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::SBMLReferenceElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 10797 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pDataModel, CCopasiDataModel::setSBMLFileName(), and UNKNOWN_ELEMENT.

10799 {
10800  const char * File;
10801 
10802  mCurrentElement++; /* We should always be on the next element */
10803 
10804  switch (mCurrentElement)
10805  {
10806  case SBMLReference:
10807 
10808  if (strcmp(pszName, "SBMLReference"))
10810  pszName, "SBMLReference", mParser.getCurrentLineNumber());
10811 
10812  File = mParser.getAttributeValue("file", papszAttrs);
10813 
10814  if (mCommon.pDataModel)
10816 
10817  break;
10818 
10819  case SBMLMap:
10820 
10821  if (strcmp(pszName, "SBMLMap"))
10823  pszName, "SBMLMap", mParser.getCurrentLineNumber());
10824 
10825  /* If we do not have a etc element handler we create one. */
10826  if (!mpCurrentHandler)
10827  mpCurrentHandler = new SBMLMapElement(mParser, mCommon);
10828 
10829  /* Push the etc element handler on the stack and call it. */
10831  mpCurrentHandler->start(pszName, papszAttrs);
10832  break;
10833 
10834  default:
10838  mParser.onStartElement(pszName, papszAttrs);
10839  break;
10840  }
10841 
10842  return;
10843 }
bool setSBMLFileName(const std::string &fileName)
CCopasiDataModel * pDataModel
UnknownElement mUnknownElement
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
virtual void start(const XML_Char *C_UNUSED(pszName), const XML_Char **C_UNUSED(papszAttrs))
Definition: CXMLHandler.h:87
int getCurrentLineNumber() const
Definition: CExpat.h:470

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