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

Public Member Functions

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

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

Member Enumeration Documentation

Enumerator
ColorDefinition 

Definition at line 3878 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 11185 of file CCopasiXMLParser.cpp.

References pdelete.

11186 {
11188 }
#define pdelete(p)
Definition: copasi.h:215

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 11228 of file CCopasiXMLParser.cpp.

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

11229 {
11230  switch (mCurrentElement)
11231  {
11232  case ColorDefinition:
11233 
11234  if (strcmp(pszName, "ColorDefinition"))
11236  pszName, "ColorDefinition", mParser.getCurrentLineNumber());
11237 
11239 
11240  //reset handler
11242  //call parent handler
11243  mParser.onEndElement(pszName);
11244  break;
11245 
11246  case UNKNOWN_ELEMENT:
11248  break;
11249 
11250  default:
11252  pszName, "???", mParser.getCurrentLineNumber());
11253  break;
11254  }
11255 
11256  return;
11257 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ColorDefinitionElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 11190 of file CCopasiXMLParser.cpp.

References CLRenderInformationBase::addColorDefinition(), CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pRenderInformation, CLColorDefinition::setColorValue(), CLColorDefinition::setId(), and UNKNOWN_ELEMENT.

11192 {
11193  mCurrentElement++; /* We should always be on the next element */
11194 
11195  const char * Id;
11196  const char * Value;
11197  CLColorDefinition* pColorDef = NULL;
11198 
11199  switch (mCurrentElement)
11200  {
11201  case ColorDefinition:
11202 
11203  if (strcmp(pszName, "ColorDefinition"))
11205  pszName, "ColorDefinition", mParser.getCurrentLineNumber());
11206 
11207  Id = mParser.getAttributeValue("id", papszAttrs);
11208  Value = mParser.getAttributeValue("value", papszAttrs);
11209  pColorDef = new CLColorDefinition();
11210  pColorDef->setColorValue(Value);
11211  pColorDef->setId(Id);
11213  // delete the color definition again since the add method made a copy
11214  delete pColorDef;
11215  break;
11216 
11217  default:
11221  mParser.onStartElement(pszName, papszAttrs);
11222  break;
11223  }
11224 
11225  return;
11226 }
UnknownElement mUnknownElement
bool setColorValue(const std::string &valueString)
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
CLRenderInformationBase * pRenderInformation
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
void setId(const std::string &id)
void addColorDefinition(const CLColorDefinition *cd)
int getCurrentLineNumber() const
Definition: CExpat.h:470

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