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

Public Member Functions

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
Report 

Definition at line 2183 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 8752 of file CCopasiXMLParser.cpp.

8753 {}

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 8799 of file CCopasiXMLParser.cpp.

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

8800 {
8801  switch (mCurrentElement)
8802  {
8803  case Report:
8804 
8805  if (strcmp(pszName, "Report"))
8807  pszName, "Report", mParser.getCurrentLineNumber());
8808 
8811  mParser.onEndElement(pszName);
8812  break;
8813 
8814  case UNKNOWN_ELEMENT:
8815  mCurrentElement = mLastKnownElement;
8816  break;
8817 
8818  default:
8820  pszName, "???", mParser.getCurrentLineNumber());
8821  break;
8822  }
8823 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ReportInstanceElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 8755 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CCopasiTask::getReport(), CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentTask, CReport::setAppend(), CReport::setConfirmOverwrite(), CReport::setTarget(), SCopasiXMLParserCommon::taskReferenceMap, and UNKNOWN_ELEMENT.

8756 {
8757  mCurrentElement++; // We should always be on the next element
8758 
8759  std::string target;
8760  bool append;
8761  bool confirmOverwrite;
8762  std::string reference;
8763 
8764  switch (mCurrentElement)
8765  {
8766  case Report:
8767 
8768  if (strcmp(pszName, "Report"))
8770  pszName, "Report", mParser.getCurrentLineNumber());
8771 
8772  reference = mParser.getAttributeValue("reference", papszAttrs);
8773  target = mParser.getAttributeValue("target", papszAttrs);
8774 
8775  append = mParser.toBool(mParser.getAttributeValue("append", papszAttrs, "false"));
8777  confirmOverwrite = mParser.toBool(mParser.getAttributeValue("confirmOverwrite", papszAttrs, "false"));
8778 
8779  mCommon.pCurrentTask->getReport().setConfirmOverwrite(confirmOverwrite);
8781 
8782  if (mCommon.taskReferenceMap.find(reference) == mCommon.taskReferenceMap.end())
8783  {
8784  mCommon.taskReferenceMap[reference] = std::vector<CCopasiTask*>();
8785  }
8786 
8787  mCommon.taskReferenceMap[reference].push_back(mCommon.pCurrentTask);
8788  break;
8789 
8790  default:
8794  mParser.onStartElement(pszName, papszAttrs);
8795  break;
8796  }
8797 }
UnknownElement mUnknownElement
static bool toBool(const char *attribute)
Definition: CExpat.h:728
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
void setAppend(const bool &append)
Definition: CReport.cpp:98
void setConfirmOverwrite(const bool &confirmOverwrite)
Definition: CReport.cpp:104
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
void setTarget(const std::string &target)
Definition: CReport.cpp:92
CReport & getReport()
std::map< std::string, std::vector< CCopasiTask * > > taskReferenceMap
int getCurrentLineNumber() const
Definition: CExpat.h:470

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