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

Public Member Functions

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

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
ListOfMetabolites 
Metabolite 

Definition at line 1309 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 2441 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 2487 of file CCopasiXMLParser.cpp.

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

2488 {
2489  switch (mCurrentElement)
2490  {
2491  case ListOfMetabolites:
2492 
2493  if (strcmp(pszName, "ListOfMetabolites"))
2495  pszName, "ListOfMetabolites", mParser.getCurrentLineNumber());
2496 
2499 
2500  /* Tell the parent element we are done. */
2501  mParser.onEndElement(pszName);
2502  break;
2503 
2504  case Metabolite:
2505 
2506  if (strcmp(pszName, "Metabolite"))
2508  pszName, "Metabolite", mParser.getCurrentLineNumber());
2509 
2511  break;
2512 
2513  case UNKNOWN_ELEMENT:
2514  mCurrentElement = mLastKnownElement;
2515  break;
2516 
2517  default:
2519  pszName, "???", mParser.getCurrentLineNumber());
2520  break;
2521  }
2522 
2523  return;
2524 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ListOfMetabolitesElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 2446 of file CCopasiXMLParser.cpp.

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

2448 {
2449  mCurrentElement++; /* We should always be on the next element */
2450 
2451  switch (mCurrentElement)
2452  {
2453  case ListOfMetabolites:
2454 
2455  if (strcmp(pszName, "ListOfMetabolites"))
2457  pszName, "ListOfMetabolites", mParser.getCurrentLineNumber());
2458 
2459  break;
2460 
2461  case Metabolite:
2462 
2463  if (strcmp(pszName, "Metabolite"))
2465  pszName, "Metabolite", mParser.getCurrentLineNumber());
2466 
2467  /* If we do not have a function element handler we create one. */
2468  if (!mpCurrentHandler)
2469  mpCurrentHandler = new MetaboliteElement(mParser, mCommon);
2470 
2471  /* Push the Metabolite element handler on the stack and call it. */
2473  mpCurrentHandler->start(pszName, papszAttrs);
2474  break;
2475 
2476  default:
2480  mParser.onStartElement(pszName, papszAttrs);
2481  break;
2482  }
2483 
2484  return;
2485 }
UnknownElement mUnknownElement
#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: