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

Public Member Functions

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

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
ListOfProducts 
Product 

Definition at line 1006 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 4194 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 4240 of file CCopasiXMLParser.cpp.

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

4241 {
4242  switch (mCurrentElement)
4243  {
4244  case ListOfProducts:
4245 
4246  if (strcmp(pszName, "ListOfProducts"))
4248  pszName, "ListOfProducts", mParser.getCurrentLineNumber());
4249 
4252 
4253  /* Tell the parent element we are done. */
4254  mParser.onEndElement(pszName);
4255  break;
4256 
4257  case Product:
4258 
4259  if (strcmp(pszName, "Product"))
4261  pszName, "Product", mParser.getCurrentLineNumber());
4262 
4264  break;
4265 
4266  case UNKNOWN_ELEMENT:
4267  mCurrentElement = mLastKnownElement;
4268  break;
4269 
4270  default:
4272  pszName, "???", mParser.getCurrentLineNumber());
4273  break;
4274  }
4275 
4276  return;
4277 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ListOfProductsElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 4199 of file CCopasiXMLParser.cpp.

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

4201 {
4202  mCurrentElement++; /* We should always be on the next element */
4203 
4204  switch (mCurrentElement)
4205  {
4206  case ListOfProducts:
4207 
4208  if (strcmp(pszName, "ListOfProducts"))
4210  pszName, "ListOfProducts", mParser.getCurrentLineNumber());
4211 
4212  break;
4213 
4214  case Product:
4215 
4216  if (strcmp(pszName, "Product"))
4218  pszName, "Product", mParser.getCurrentLineNumber());
4219 
4220  /* If we do not have a Product element handler we create one. */
4221  if (!mpCurrentHandler)
4222  mpCurrentHandler = new ProductElement(mParser, mCommon);
4223 
4224  /* Push the Product element handler on the stack and call it. */
4226  mpCurrentHandler->start(pszName, papszAttrs);
4227  break;
4228 
4229  default:
4233  mParser.onStartElement(pszName, papszAttrs);
4234  break;
4235  }
4236 
4237  return;
4238 }
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: