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

Public Member Functions

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

Private Attributes

size_t mLineNumber
 

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 7783 of file CCopasiXMLParser.cpp.

7784 {}

Member Function Documentation

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

Definition at line 7872 of file CCopasiXMLParser.cpp.

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

7873 {
7874  if (!strcmp(pszName, "AdditionalGraphicalObject"))
7875  {
7878 
7879  /* Tell the parent element we are done. */
7880  mParser.onEndElement(pszName);
7881  }
7882  else
7883  {
7884  switch (mCurrentElement)
7885  {
7886  case BoundingBox:
7887  break;
7888 
7889  case Position:
7890  break;
7891 
7892  case Dimensions:
7893  //tell the handler where to continue
7895  break;
7896 
7897  case UNKNOWN_ELEMENT:
7899  break;
7900 
7901  default:
7903  pszName, "???", mParser.getCurrentLineNumber());
7904  break;
7905  }
7906  }
7907 
7908  return;
7909 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::AdditionalGOElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Definition at line 7786 of file CCopasiXMLParser.cpp.

References CLayout::addGeneralGlyph(), CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentLayout, SCopasiXMLParserCommon::pGeneralGlyph, CLGraphicalObject::setHeight(), CLGraphicalObject::setObjectRole(), CLGraphicalObject::setWidth(), CLGraphicalObject::setX(), CLGraphicalObject::setY(), and UNKNOWN_ELEMENT.

7787 {
7788  mCurrentElement++; /* We should always be on hte next element */
7789  mpCurrentHandler = NULL;
7790  mLineNumber = (size_t) - 1;
7791 
7792  switch (mCurrentElement)
7793  {
7794  case AdditionalGO:
7795 
7796  if (strcmp(pszName, "AdditionalGraphicalObject"))
7798  pszName, "AdditionalGraphicalObject", mParser.getCurrentLineNumber());
7799 
7800  {
7801  //workload //TODO
7802  const char * key;
7803  const char * name;
7804  key = mParser.getAttributeValue("key", papszAttrs);
7805  name = mParser.getAttributeValue("name", papszAttrs);
7806 
7807  mCommon.pGeneralGlyph = new CLGeneralGlyph(name);
7808  const char * objectRole = mParser.getAttributeValue("objectRole", papszAttrs, false);
7809 
7810  if (objectRole != NULL && objectRole[0] != 0)
7811  {
7812  mCommon.pGeneralGlyph->setObjectRole(objectRole);
7813  }
7814 
7817  }
7818  return;
7819  break;
7820 
7821  case BoundingBox:
7822 
7823  if (!strcmp(pszName, "BoundingBox"))
7824  return;
7825 
7826  break;
7827 
7828  case Position:
7829 
7830  if (!strcmp(pszName, "Position"))
7831  {
7832  //workload
7833  const char * attr;
7834  attr = mParser.getAttributeValue("x", papszAttrs);
7836  attr = mParser.getAttributeValue("y", papszAttrs);
7838  return;
7839  }
7840 
7841  break;
7842 
7843  case Dimensions:
7844 
7845  if (!strcmp(pszName, "Dimensions"))
7846  {
7847  //workload
7848  const char * attr;
7849  attr = mParser.getAttributeValue("width", papszAttrs);
7851  attr = mParser.getAttributeValue("height", papszAttrs);
7853  return;
7854  }
7855 
7856  break;
7857 
7858  default:
7861  break;
7862  }
7863 
7864  if (mpCurrentHandler)
7866 
7867  mParser.onStartElement(pszName, papszAttrs);
7868 
7869  return;
7870 }
UnknownElement mUnknownElement
void addGeneralGlyph(CLGeneralGlyph *glyph)
Definition: CLayout.cpp:263
void setY(const C_FLOAT64 &y)
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
void addFix(const std::string &key, CCopasiObject *pObject)
Definition: CXMLHandler.h:119
CLGeneralGlyph * pGeneralGlyph
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
void setHeight(const C_FLOAT64 &h)
void setObjectRole(const std::string &role)
int getCurrentLineNumber() const
Definition: CExpat.h:470
void setWidth(const C_FLOAT64 &w)
void setX(const C_FLOAT64 &x)

Member Data Documentation

size_t CCopasiXMLParser::AdditionalGOElement::mLineNumber
private

Definition at line 3560 of file CCopasiXMLParser.h.


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