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

Public Member Functions

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

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Destructor

Definition at line 14039 of file CCopasiXMLParser.cpp.

References pdelete.

14040 {
14042 }
#define pdelete(p)
Definition: copasi.h:215

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 14087 of file CCopasiXMLParser.cpp.

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

14088 {
14089  switch (mCurrentElement)
14090  {
14091  case ListOfCurveElements:
14092 
14093  if (strcmp(pszName, "ListOfElements"))
14095  pszName, "ListOfElements", mParser.getCurrentLineNumber());
14096 
14098 
14099  //reset handler
14101  //call parent handler
14102  mParser.onEndElement(pszName);
14103  break;
14104 
14105  case CurveElement:
14106 
14107  if (strcmp(pszName, "Element"))
14109  pszName, "Element", mParser.getCurrentLineNumber());
14110 
14111  //tell the handler where to continue
14113 
14114  //no need to delete Handler (since it is the only one the destructor
14115  //will handle it)
14116  break;
14117 
14118  case UNKNOWN_ELEMENT:
14119  mCurrentElement = mLastKnownElement;
14120  break;
14121 
14122  default:
14124  pszName, "???", mParser.getCurrentLineNumber());
14125  break;
14126  }
14127 
14128  return;
14129 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ListOfCurveElementsElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 14044 of file CCopasiXMLParser.cpp.

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

14046 {
14047  mCurrentElement++; /* We should always be on the next element */
14048 
14049  switch (mCurrentElement)
14050  {
14051  case ListOfCurveElements:
14052 
14053  if (strcmp(pszName, "ListOfElements"))
14055  pszName, "ListOfElements", mParser.getCurrentLineNumber());
14056 
14057  break;
14058 
14059  case CurveElement:
14060 
14061  //only one type of tags may occur here, so we can throw an exception.
14062  //No need to silently ignore unknown tags here.
14063  if (!strcmp(pszName, "Element"))
14064  {
14065  //only one type of tags may occur here, so if the handler exists
14066  //it must be the correct one
14067  if (!mpCurrentHandler)
14068  mpCurrentHandler = new CurveElementElement(mParser, mCommon);
14069 
14071  mpCurrentHandler->start(pszName, papszAttrs);
14072  }
14073 
14074  break;
14075 
14076  default:
14080  mParser.onStartElement(pszName, papszAttrs);
14081  break;
14082  }
14083 
14084  return;
14085 }
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: