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

Public Member Functions

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

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Destructor

Definition at line 13647 of file CCopasiXMLParser.cpp.

References pdelete.

13648 {
13650 }
#define pdelete(p)
Definition: copasi.h:215

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 13701 of file CCopasiXMLParser.cpp.

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

13702 {
13703  switch (mCurrentElement)
13704  {
13706 
13707  if (strcmp(pszName, "ListOfGradientDefinitions"))
13709  pszName, "ListOfGradientDefinitions", mParser.getCurrentLineNumber());
13710 
13712 
13713  //reset handler
13715  //call parent handler
13716  mParser.onEndElement(pszName);
13717  break;
13718 
13719  case GradientDefinition:
13720 
13721  if (strcmp(pszName, "LinearGradient") && strcmp(pszName, "RadialGradient"))
13723  pszName, "???", mParser.getCurrentLineNumber());
13724 
13725  //tell the handler where to continue
13727 
13728  //no need to delete Handler (since it is the only one the destructor
13729  //will handle it)
13730  break;
13731 
13732  case UNKNOWN_ELEMENT:
13733  mCurrentElement = mLastKnownElement;
13734  break;
13735 
13736  default:
13738  pszName, "???", mParser.getCurrentLineNumber());
13739  break;
13740  }
13741 
13742  return;
13743 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ListOfGradientDefinitionsElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 13652 of file CCopasiXMLParser.cpp.

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

13654 {
13655  mCurrentElement++; /* We should always be on the next element */
13656 
13657  switch (mCurrentElement)
13658  {
13660 
13661  if (strcmp(pszName, "ListOfGradientDefinitions"))
13663  pszName, "ListOfGradientDefinitions", mParser.getCurrentLineNumber());
13664 
13665  break;
13666 
13667  case GradientDefinition:
13668 
13669  //only one type of tags may occur here, so we can throw an exception.
13670  //No need to silently ignore unknown tags here.
13671  if (!strcmp(pszName, "RadialGradient"))
13672  {
13673  if (!mpCurrentHandler)
13674  mpCurrentHandler = new RadialGradientElement(mParser, mCommon);
13675 
13677  mpCurrentHandler->start(pszName, papszAttrs);
13678  }
13679  else if (!strcmp(pszName, "LinearGradient"))
13680  {
13681  if (!mpCurrentHandler)
13682  mpCurrentHandler = new LinearGradientElement(mParser, mCommon);
13683 
13685  mpCurrentHandler->start(pszName, papszAttrs);
13686  }
13687 
13688  break;
13689 
13690  default:
13694  mParser.onStartElement(pszName, papszAttrs);
13695  break;
13696  }
13697 
13698  return;
13699 }
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: