COPASI API  4.40.278
CCopasiXMLInterface Class Referenceabstract

#include <CCopasiXMLInterface.h>

Inheritance diagram for CCopasiXMLInterface:
[legend]

Classes

class  DBL
 

Public Types

enum  EncodingType { none = 0 , standard , attribute , character }
 

Public Member Functions

 CCopasiXMLInterface ()
 
bool load (const std::string &fileName, const std::string &relativeTo)
 
virtual bool load (std::istream &is, const std::string &relativeTo)=0
 
bool save (const std::string &fileName, const std::string &relativeTo)
 
virtual bool save (std::ostream &os, const std::string &relativeTo)=0
 
virtual ~CCopasiXMLInterface ()
 

Static Public Member Functions

static std::string encode (const std::string &str, const EncodingType &type=standard)
 
static std::string utf8 (const std::string &str)
 

Protected Member Functions

bool endSaveElement (const std::string &name)
 
bool saveData (const std::string &data)
 
bool saveElement (const std::string &name, CXMLAttributeList &attributeList)
 
bool saveParameter (const CCopasiParameter &parameter)
 
bool saveParameterGroup (const std::vector< CCopasiParameter * > &group)
 
bool saveXhtml (const std::string &xhtml)
 
bool startSaveElement (const std::string &name)
 
bool startSaveElement (const std::string &name, CXMLAttributeList &attributeList)
 

Protected Attributes

std::string mIndent
 
std::istream * mpIstream
 
std::ostream * mpOstream
 
std::string mPWD
 

Member Enumeration Documentation

◆ EncodingType

Enumeration of encoding type.

Enumerator
none 
standard 
attribute 
character 

Constructor & Destructor Documentation

◆ CCopasiXMLInterface()

CCopasiXMLInterface::CCopasiXMLInterface ( )

Constructor.

◆ ~CCopasiXMLInterface()

CCopasiXMLInterface::~CCopasiXMLInterface ( )
virtual

Destructor.

Member Function Documentation

◆ encode()

◆ endSaveElement()

◆ load() [1/2]

bool CCopasiXMLInterface::load ( const std::string &  fileName,
const std::string &  relativeTo 
)

Load information from a file.

Parameters
conststd::string & fileName
conststd::string & relativeTo
Returns
bool success

References CLocaleString::fromUtf8(), load(), and mPWD.

◆ load() [2/2]

virtual bool CCopasiXMLInterface::load ( std::istream &  is,
const std::string &  relativeTo 
)
pure virtual

Load information from a given istream.

Parameters
std::istream& is
conststd::string & relativeTo
Returns
bool success

Implemented in CConfigurationFile::CXML, and CCopasiXML.

Referenced by load().

◆ save() [1/2]

bool CCopasiXMLInterface::save ( const std::string &  fileName,
const std::string &  relativeTo 
)

Save information to a file.

Parameters
conststd::string & fileName
conststd::string & relativeTo
Returns
bool success

References CLocaleString::fromUtf8(), mPWD, and save().

◆ save() [2/2]

virtual bool CCopasiXMLInterface::save ( std::ostream &  os,
const std::string &  relativeTo 
)
pure virtual

Save information to a given ostream.

Parameters
std::ostream& os
conststd::string & relativeTo
Returns
bool success

Implemented in CCopasiXML, and CConfigurationFile::CXML.

Referenced by save().

◆ saveData()

bool CCopasiXMLInterface::saveData ( const std::string &  data)
protected

◆ saveElement()

◆ saveParameter()

◆ saveParameterGroup()

bool CCopasiXMLInterface::saveParameterGroup ( const std::vector< CCopasiParameter * > &  group)
protected

Save a Parameter Group.

Parameters
constCCopasiParameterGroup::parameterGroup & group
Returns
bool success

References saveParameter().

Referenced by saveParameter(), CCopasiXML::savePlotList(), and CCopasiXML::saveTaskList().

◆ saveXhtml()

bool CCopasiXMLInterface::saveXhtml ( const std::string &  xhtml)
protected

Save xhtml to the ostream

Parameters
conststd::string & xhtml
Returns
bool success

References mIndent, mpOstream, and saveData().

Referenced by CCopasiXML::saveAnnotation(), CCopasiXML::saveReportList(), and CCopasiXML::saveReportSection().

◆ startSaveElement() [1/2]

◆ startSaveElement() [2/2]

bool CCopasiXMLInterface::startSaveElement ( const std::string &  name,
CXMLAttributeList attributeList 
)
protected

Start saving an XML element to the ostream. Call endSaveElement to conclude.

Parameters
conststd::string & name
CXMLAttributeList& attributeList
Returns
bool success

References mIndent, and mpOstream.

◆ utf8()

std::string CCopasiXMLInterface::utf8 ( const std::string &  str)
static

Encode a given string to a valid XML string

Parameters
constC_FLOAT64 & dbl
Returns
std::string encoded Encode a given string to a utf-8 string
Parameters
conststd::string & str
Returns
std::string encoded

Referenced by CMIRIAMResourceObject::unescapeId().

Member Data Documentation

◆ mIndent

std::string CCopasiXMLInterface::mIndent
protected

◆ mpIstream

std::istream* CCopasiXMLInterface::mpIstream
protected

A pointer to the input stream

Referenced by CCopasiXML::load().

◆ mpOstream

std::ostream* CCopasiXMLInterface::mpOstream
protected

◆ mPWD

std::string CCopasiXMLInterface::mPWD
protected

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