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

Public Member Functions

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

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Destructor

Definition at line 14309 of file CCopasiXMLParser.cpp.

14310 {}

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 14407 of file CCopasiXMLParser.cpp.

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

14408 {
14409  if (!strcmp(pszName, "RenderInformation"))
14410  {
14412  mCommon.pRenderInformation = NULL;
14413 
14414  //reset handler
14416  //call parent handler
14417  mParser.onEndElement(pszName);
14418  }
14419  else
14420  {
14421  switch (mCurrentElement)
14422  {
14424 
14425  if (strcmp(pszName, "ListOfColorDefinitions"))
14427  pszName, "ListOfColorDefinitions", mParser.getCurrentLineNumber());
14428 
14430  break;
14431 
14433 
14434  if (strcmp(pszName, "ListOfGradientDefinitions"))
14436  pszName, "ListOfGradientDefinitions", mParser.getCurrentLineNumber());
14437 
14439  break;
14440 
14441  case ListOfLineEndings:
14442 
14443  if (strcmp(pszName, "ListOfLineEndings"))
14445  pszName, "ListOfLineEndings", mParser.getCurrentLineNumber());
14446 
14448  break;
14449 
14450  case ListOfStyles:
14451 
14452  if (strcmp(pszName, "ListOfStyles"))
14454  pszName, "ListOfStyles", mParser.getCurrentLineNumber());
14455 
14457  break;
14458 
14459  case UNKNOWN_ELEMENT:
14461  break;
14462 
14463  default:
14465  pszName, "???", mParser.getCurrentLineNumber());
14466  break;
14467  }
14468  }
14469 
14470  return;
14471 }
#define START_ELEMENT
#define MCXML
CLRenderInformationBase * pRenderInformation
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::LocalRenderInformationElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 14312 of file CCopasiXMLParser.cpp.

References CLayout::addLocalRenderInformation(), CCopasiMessage::EXCEPTION, CLayout::getListOfLocalRenderInformationObjects(), CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentLayout, SCopasiXMLParserCommon::pRenderInformation, CLRenderInformationBase::setBackgroundColor(), CCopasiVector< T >::size(), and UNKNOWN_ELEMENT.

14314 {
14315  mCurrentElement++; /* We should always be on the next element */
14316  mpCurrentHandler = NULL;
14317  const char* background;
14318 
14319  switch (mCurrentElement)
14320  {
14322 
14323  if (strcmp(pszName, "RenderInformation"))
14325  pszName, "RenderInformation", mParser.getCurrentLineNumber());
14326 
14328  // delete the global render information again since the addLocalRenderInformationObject method made a copy
14331  background = mParser.getAttributeValue("backgroundColor", papszAttrs);
14332  assert(background != NULL);
14333 
14334  if (background != NULL)
14335  {
14337  }
14338 
14339  // we have to return here because otherwise the call
14340  // at the end will lead to an endless loop
14341  return;
14342  break;
14343 
14345 
14346  if (!strcmp(pszName, "ListOfColorDefinitions"))
14347  {
14349  mpCurrentHandler = new ListOfColorDefinitionsElement(mParser, mCommon);
14350  }
14351 
14352  break;
14353 
14355 
14356  if (!strcmp(pszName, "ListOfGradientDefinitions"))
14357  {
14359  mpCurrentHandler = new ListOfGradientDefinitionsElement(mParser, mCommon);
14360  }
14361 
14362  break;
14363 
14364  case ListOfLineEndings:
14365 
14366  if (!strcmp(pszName, "ListOfLineEndings"))
14367  {
14369  mpCurrentHandler = new ListOfLineEndingsElement(mParser, mCommon);
14370  }
14371 
14372  break;
14373 
14374  case ListOfStyles:
14375 
14376  if (!strcmp(pszName, "ListOfStyles"))
14377  {
14379  mpCurrentHandler = new ListOfLocalStylesElement(mParser, mCommon);
14380  }
14381 
14382  break;
14383 
14384  default:
14388  mParser.onStartElement(pszName, papszAttrs);
14389  break;
14390  }
14391 
14392  // if we created a handler in this call, we add it to the stack
14393  if (mpCurrentHandler)
14394  {
14396  }
14397 
14398  // we call the current handler
14399  // if we created one, the new one will be called, otherwise
14400  // the one for ListOfLayouts should be the current one
14401  // and this method will be called again
14402  this->mParser.onStartElement(pszName, papszAttrs);
14403 
14404  return;
14405 }
UnknownElement mUnknownElement
void addLocalRenderInformation(CLLocalRenderInformation *pRenderInfo)
Definition: CLayout.cpp:646
const CCopasiVector< CLLocalRenderInformation > & getListOfLocalRenderInformationObjects() const
Definition: CLayout.h:149
virtual size_t size() const
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
void setBackgroundColor(const std::string &bg)
CLRenderInformationBase * pRenderInformation
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
int getCurrentLineNumber() const
Definition: CExpat.h:470

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