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

Public Member Functions

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
ParameterText 

Definition at line 2265 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 9177 of file CCopasiXMLParser.cpp.

9178 {}

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 9229 of file CCopasiXMLParser.cpp.

References SCopasiXMLParserCommon::CharacterData, CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentParameter, CCopasiParameter::setValue(), START_ELEMENT, and UNKNOWN_ELEMENT.

9230 {
9231  switch (mCurrentElement)
9232  {
9233  case ParameterText:
9234 
9235  if (strcmp(pszName, "ParameterText"))
9237  pszName, "Parameter", mParser.getCurrentLineNumber());
9238 
9239  if (mCommon.pCurrentParameter != NULL)
9240  {
9242  }
9243 
9246  mParser.onEndElement(pszName);
9247  break;
9248 
9249  case UNKNOWN_ELEMENT:
9251  break;
9252 
9253  default:
9255  pszName, "???", mParser.getCurrentLineNumber());
9256  break;
9257  }
9258 
9259  return;
9260 }
bool setValue(const CType &value)
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
CCopasiParameter * pCurrentParameter
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ParameterTextElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 9180 of file CCopasiXMLParser.cpp.

References CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, CCopasiParameter::EXPRESSION, CCopasiParameter::INVALID, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentParameter, toEnum(), UNKNOWN_ELEMENT, and CCopasiParameter::XMLType.

9182 {
9183  mCurrentElement++; // We should always be on the next element
9184 
9185  std::string name;
9186  const char * cType;
9188 
9189  switch (mCurrentElement)
9190  {
9191  case ParameterText:
9192 
9193  if (strcmp(pszName, "ParameterText"))
9195  pszName, "Parameter", mParser.getCurrentLineNumber());
9196 
9197  // Parameter has attributes name, type and value
9198  name = mParser.getAttributeValue("name", papszAttrs);
9199  cType = mParser.getAttributeValue("type", papszAttrs);
9201 
9202  switch (type)
9203  {
9206  mParser.onStartElement(pszName, papszAttrs);
9207  break;
9208 
9209  default:
9211  break;
9212  }
9213 
9214  mCommon.pCurrentParameter = new CCopasiParameter(name, type, NULL);
9215 
9216  break;
9217 
9218  default:
9222  mParser.onStartElement(pszName, papszAttrs);
9223  break;
9224  }
9225 
9226  return;
9227 }
UnknownElement mUnknownElement
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 pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
CharacterDataElement mCharacterDataElement
CType toEnum(const char *attribute, const char **enumNames, const CType &enumDefault)
Definition: utility.h:107
CCopasiParameter * pCurrentParameter
static const char * XMLType[]
int getCurrentLineNumber() const
Definition: CExpat.h:470

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