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

Public Member Functions

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

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Destructor

Definition at line 14480 of file CCopasiXMLParser.cpp.

References pdelete.

14481 {
14483 }
#define pdelete(p)
Definition: copasi.h:215

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 14538 of file CCopasiXMLParser.cpp.

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

14539 {
14540  switch (mCurrentElement)
14541  {
14542  case BoundingBox:
14543 
14544  if (strcmp(pszName, "BoundingBox"))
14546  pszName, "BoundingBox", mParser.getCurrentLineNumber());
14547 
14549 
14550  //reset handler
14552  //call parent handler
14553  mParser.onEndElement(pszName);
14554  break;
14555 
14556  case Position:
14557 
14558  if (strcmp(pszName, "Position"))
14560  pszName, "Position", mParser.getCurrentLineNumber());
14561 
14562  break;
14563 
14564  case Dimensions:
14565 
14566  if (strcmp(pszName, "Dimensions"))
14568  pszName, "Dimensions", mParser.getCurrentLineNumber());
14569 
14571  break;
14572 
14573  case UNKNOWN_ELEMENT:
14575  break;
14576 
14577  default:
14579  pszName, "???", mParser.getCurrentLineNumber());
14580  break;
14581  }
14582 
14583  return;
14584 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::BoundingBoxElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 14485 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CLLineEnding::getBoundingBox(), CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pLineEnding, CLBoundingBox::setDimensions(), CLBoundingBox::setPosition(), and UNKNOWN_ELEMENT.

14487 {
14488  mCurrentElement++; /* We should always be on the next element */
14489  mpCurrentHandler = NULL;
14490  const char * X;
14491  const char * Y;
14492  const char * WIDTH;
14493  const char * HEIGHT;
14494 
14495  switch (mCurrentElement)
14496  {
14497  case BoundingBox:
14498 
14499  if (strcmp(pszName, "BoundingBox"))
14501  pszName, "BoundingBox", mParser.getCurrentLineNumber());
14502 
14503  break;
14504 
14505  case Position:
14506 
14507  if (!strcmp(pszName, "Position"))
14508  {
14509  X = mParser.getAttributeValue("x", papszAttrs);
14510  Y = mParser.getAttributeValue("y", papszAttrs);
14512  }
14513 
14514  break;
14515 
14516  case Dimensions:
14517 
14518  if (!strcmp(pszName, "Dimensions"))
14519  {
14520  WIDTH = mParser.getAttributeValue("width", papszAttrs);
14521  HEIGHT = mParser.getAttributeValue("height", papszAttrs);
14523  }
14524 
14525  break;
14526 
14527  default:
14531  mParser.onStartElement(pszName, papszAttrs);
14532  break;
14533  }
14534 
14535  return;
14536 }
CLLineEnding * pLineEnding
UnknownElement mUnknownElement
void setPosition(const CLPoint &p)
Definition: CLBase.h:272
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 setDimensions(const CLDimensions &d)
Definition: CLBase.h:273
Definition: CLBase.h:54
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
CLBoundingBox * getBoundingBox()
int getCurrentLineNumber() const
Definition: CExpat.h:470

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