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

Public Member Functions

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

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

Member Enumeration Documentation

Text

Enumerator
MathML 
Text 

Definition at line 2908 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 1180 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 1226 of file CCopasiXMLParser.cpp.

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

1227 {
1228  switch (mCurrentElement)
1229  {
1230  case MathML:
1231 
1232  if (strcmp(pszName, "MathML"))
1234  pszName, "MathML", mParser.getCurrentLineNumber());
1235 
1238 
1239  /* Tell the parent element we are done. */
1240  mParser.onEndElement(pszName);
1241  break;
1242 
1243  case Text:
1244 
1245  if (strcmp(pszName, "Text"))
1247  pszName, "Text", mParser.getCurrentLineNumber());
1248 
1250 
1251  break;
1252 
1253  case UNKNOWN_ELEMENT:
1254  mCurrentElement = mLastKnownElement;
1255  break;
1256 
1257  default:
1259  pszName, "???", mParser.getCurrentLineNumber());
1260  break;
1261  }
1262 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::MathMLElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 1185 of file CCopasiXMLParser.cpp.

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

1187 {
1188  mCurrentElement++; /* We should always be on the next element */
1189 
1190  switch (mCurrentElement)
1191  {
1192  case MathML:
1193 
1194  if (strcmp(pszName, "MathML"))
1196  pszName, "MathML", mParser.getCurrentLineNumber());
1197 
1198  break;
1199 
1200  case Text:
1201 
1202  if (strcmp(pszName, "Text"))
1204  pszName, "Text", mParser.getCurrentLineNumber());
1205 
1206  /* If we do not have a function element handler we create one. */
1207  if (!mpCurrentHandler)
1208  mpCurrentHandler = new CharacterDataElement(mParser, mCommon);
1209 
1210  /* Push the Function element handler on the stack and call it. */
1212  mpCurrentHandler->start(pszName, papszAttrs);
1213  break;
1214 
1215  default:
1219  mParser.onStartElement(pszName, papszAttrs);
1220  break;
1221  }
1222 
1223  return;
1224 }
UnknownElement mUnknownElement
#define MCXML
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
virtual void start(const XML_Char *C_UNUSED(pszName), const XML_Char **C_UNUSED(papszAttrs))
Definition: CXMLHandler.h:87
int getCurrentLineNumber() const
Definition: CExpat.h:470

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