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

Public Member Functions

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

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
Table 
Object 

Definition at line 2722 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 10194 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 10244 of file CCopasiXMLParser.cpp.

References SCopasiXMLParserCommon::CharacterData, CCopasiMessage::EXCEPTION, CReportDefinition::getTableAddr(), CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pReport, START_ELEMENT, and UNKNOWN_ELEMENT.

10245 {
10246  switch (mCurrentElement)
10247  {
10248  case Table:
10249 
10250  if (strcmp(pszName, "Table"))
10252  pszName, "Table", mParser.getCurrentLineNumber());
10253 
10256 
10257  /* Tell the parent element we are done. */
10258  mParser.onEndElement(pszName);
10259  break;
10260 
10261  case Object:
10262 
10263  if (strcmp(pszName, "Object"))
10265  pszName, "Object", mParser.getCurrentLineNumber());
10266 
10268  mCommon.CharacterData = "";
10270  break;
10271 
10272  case UNKNOWN_ELEMENT:
10274  break;
10275 
10276  default:
10278  pszName, "???", mParser.getCurrentLineNumber());
10279  break;
10280  }
10281 
10282  return;
10283 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
std::vector< CRegisteredObjectName > * getTableAddr()
int getCurrentLineNumber() const
Definition: CExpat.h:470
CReportDefinition * pReport
void CCopasiXMLParser::TableElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 10199 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pReport, CReportDefinition::setTitle(), and UNKNOWN_ELEMENT.

10201 {
10202  mCurrentElement++; // We should always be on the next element
10203 
10204  const char * printTitle;
10205 
10206  switch (mCurrentElement)
10207  {
10208  case Table:
10209 
10210  if (strcmp(pszName, "Table"))
10212  pszName, "Table", mParser.getCurrentLineNumber());
10213 
10214  printTitle = mParser.getAttributeValue("printTitle", papszAttrs, "false");
10215  mCommon.pReport->setTitle(mParser.toBool(printTitle));
10216  break;
10217 
10218  case Object:
10219 
10220  if (strcmp(pszName, "Object"))
10222  pszName, "Object", mParser.getCurrentLineNumber());
10223 
10224  if (!mpCurrentHandler)
10225  {
10226  mpCurrentHandler = new ObjectElement(mParser, mCommon);
10227  }
10228 
10230  mParser.onStartElement(pszName, papszAttrs);
10231  break;
10232 
10233  default:
10237  mParser.onStartElement(pszName, papszAttrs);
10238  break;
10239  }
10240 
10241  return;
10242 }
UnknownElement mUnknownElement
static bool toBool(const char *attribute)
Definition: CExpat.h:728
void setTitle(bool title)
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)
int getCurrentLineNumber() const
Definition: CExpat.h:470
CReportDefinition * pReport

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