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

Public Member Functions

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

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Destructor

Definition at line 13548 of file CCopasiXMLParser.cpp.

References pdelete.

13549 {
13551 }
#define pdelete(p)
Definition: copasi.h:215

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 13596 of file CCopasiXMLParser.cpp.

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

13597 {
13598  switch (mCurrentElement)
13599  {
13601 
13602  if (strcmp(pszName, "ListOfColorDefinitions"))
13604  pszName, "ListOfColorDefinitions", mParser.getCurrentLineNumber());
13605 
13607 
13608  //reset handler
13610  //call parent handler
13611  mParser.onEndElement(pszName);
13612  break;
13613 
13614  case ColorDefinition:
13615 
13616  if (strcmp(pszName, "ColorDefinition"))
13618  pszName, "ColorDefinition", mParser.getCurrentLineNumber());
13619 
13620  //tell the handler where to continue
13622 
13623  //no need to delete Handler (since it is the only one the destructor
13624  //will handle it)
13625  break;
13626 
13627  case UNKNOWN_ELEMENT:
13628  mCurrentElement = mLastKnownElement;
13629  break;
13630 
13631  default:
13633  pszName, "???", mParser.getCurrentLineNumber());
13634  break;
13635  }
13636 
13637  return;
13638 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ListOfColorDefinitionsElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 13553 of file CCopasiXMLParser.cpp.

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

13555 {
13556  mCurrentElement++; /* We should always be on the next element */
13557 
13558  switch (mCurrentElement)
13559  {
13561 
13562  if (strcmp(pszName, "ListOfColorDefinitions"))
13564  pszName, "ListOfColorDefinitions", mParser.getCurrentLineNumber());
13565 
13566  break;
13567 
13568  case ColorDefinition:
13569 
13570  //only one type of tags may occur here, so we can throw an exception.
13571  //No need to silently ignore unknown tags here.
13572  if (strcmp(pszName, "ColorDefinition"))
13574  pszName, "ColorDefinition", mParser.getCurrentLineNumber());
13575 
13576  //only one type of tags may occur here, so if the handler exists
13577  //it must be the correct one
13578  if (!mpCurrentHandler)
13579  mpCurrentHandler = new ColorDefinitionElement(mParser, mCommon);
13580 
13582  mpCurrentHandler->start(pszName, papszAttrs);
13583  break;
13584 
13585  default:
13589  mParser.onStartElement(pszName, papszAttrs);
13590  break;
13591  }
13592 
13593  return;
13594 }
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: