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

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 GlobalRenderInformationElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~GlobalRenderInformationElement ()
 
- 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 {
  GlobalRenderInformation = 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 4689 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Destructor

Definition at line 14138 of file CCopasiXMLParser.cpp.

14139 {}

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 14235 of file CCopasiXMLParser.cpp.

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

14236 {
14237  if (!strcmp(pszName, "RenderInformation"))
14238  {
14240  mCommon.pRenderInformation = NULL;
14241 
14242  //reset handler
14244  //call parent handler
14245  mParser.onEndElement(pszName);
14246  }
14247  else
14248  {
14249  switch (mCurrentElement)
14250  {
14251 
14253 
14254  if (strcmp(pszName, "ListOfColorDefinitions"))
14256  pszName, "ListOfColorDefinitions", mParser.getCurrentLineNumber());
14257 
14259  break;
14260 
14262 
14263  if (strcmp(pszName, "ListOfGradientDefinitions"))
14265  pszName, "ListOfGradientDefinitions", mParser.getCurrentLineNumber());
14266 
14268  break;
14269 
14270  case ListOfLineEndings:
14271 
14272  if (strcmp(pszName, "ListOfLineEndings"))
14274  pszName, "ListOfLineEndings", mParser.getCurrentLineNumber());
14275 
14277  break;
14278 
14279  case ListOfStyles:
14280 
14281  if (strcmp(pszName, "ListOfStyles"))
14283  pszName, "ListOfStyles", mParser.getCurrentLineNumber());
14284 
14286  break;
14287 
14288  case UNKNOWN_ELEMENT:
14290  break;
14291 
14292  default:
14294  pszName, "???", mParser.getCurrentLineNumber());
14295  break;
14296  }
14297  }
14298 
14299  return;
14300 }
#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::GlobalRenderInformationElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 14141 of file CCopasiXMLParser.cpp.

References CListOfLayouts::addGlobalRenderInformation(), CCopasiMessage::EXCEPTION, CListOfLayouts::getListOfGlobalRenderInformationObjects(), CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pLayoutList, SCopasiXMLParserCommon::pRenderInformation, CLRenderInformationBase::setBackgroundColor(), CCopasiVector< T >::size(), and UNKNOWN_ELEMENT.

14143 {
14144  mCurrentElement++; /* We should always be on the next element */
14145  mpCurrentHandler = NULL;
14146  const char* background;
14147 
14148  switch (mCurrentElement)
14149  {
14151 
14152  if (strcmp(pszName, "RenderInformation"))
14154  pszName, "RenderInformation", mParser.getCurrentLineNumber());
14155 
14157  // delete the global render information again since the addGlobalRenderInformationObject method made a copy
14160  background = mParser.getAttributeValue("backgroundColor", papszAttrs);
14161  assert(background != NULL);
14162 
14163  if (background != NULL)
14164  {
14166  }
14167 
14168  // we have to return here because otherwise the call
14169  // at the end will lead to an endless loop
14170  return;
14171  break;
14172 
14174 
14175  if (!strcmp(pszName, "ListOfColorDefinitions"))
14176  {
14178  mpCurrentHandler = new ListOfColorDefinitionsElement(mParser, mCommon);
14179  }
14180 
14181  break;
14182 
14184 
14185  if (!strcmp(pszName, "ListOfGradientDefinitions"))
14186  {
14188  mpCurrentHandler = new ListOfGradientDefinitionsElement(mParser, mCommon);
14189  }
14190 
14191  break;
14192 
14193  case ListOfLineEndings:
14194 
14195  if (!strcmp(pszName, "ListOfLineEndings"))
14196  {
14198  mpCurrentHandler = new ListOfLineEndingsElement(mParser, mCommon);
14199  }
14200 
14201  break;
14202 
14203  case ListOfStyles:
14204 
14205  if (!strcmp(pszName, "ListOfStyles"))
14206  {
14208  mpCurrentHandler = new ListOfGlobalStylesElement(mParser, mCommon);
14209  }
14210 
14211  break;
14212 
14213  default:
14217  mParser.onStartElement(pszName, papszAttrs);
14218  break;
14219  }
14220 
14221  // if we created a handler in this call, we add it to the stack
14222  if (this->mpCurrentHandler != NULL)
14223  {
14225  }
14226 
14227  // we call the current handler
14228  // if we created one, the new one will be called, otherwise
14229  // the one for ListOfLayouts should be the current one
14230  // and this method will be called again
14231  this->mParser.onStartElement(pszName, papszAttrs);
14232  return;
14233 }
CListOfLayouts * pLayoutList
UnknownElement mUnknownElement
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 addGlobalRenderInformation(CLGlobalRenderInformation *pRenderInfo)
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
const CCopasiVector< CLGlobalRenderInformation > & getListOfGlobalRenderInformationObjects() const

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