copasi API  0.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
CCopasiXMLInterface Class Reference

#include <CCopasiXMLInterface.h>

Inheritance diagram for CCopasiXMLInterface:
CCopasiXML

List of all members.

Classes

class  DBL

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Member Enumeration Documentation

Enumeration of encoding type.

Enumerator:
none 
std 
attribute 
character 

Constructor & Destructor Documentation

CCopasiXMLInterface::CCopasiXMLInterface ( )

Constructor.

CCopasiXMLInterface::~CCopasiXMLInterface ( ) [virtual]

Destructor.


Member Function Documentation

std::string CCopasiXMLInterface::encode ( const std::string &  str,
const EncodingType type = std 
) [static]

Encode a given string to a valid XML string

Parameters:
conststd::string & str
Returns:
std::string encoded
bool CCopasiXMLInterface::endSaveElement ( const std::string &  name) [protected]

End saving an XML element to the ostream started by startSaveElement.

Parameters:
conststd::string & name
Returns:
bool success
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 CCopasiXML.

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
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.

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
bool CCopasiXMLInterface::saveData ( const std::string &  data) [protected]

Save CDATA to the ostream

Parameters:
conststd::string & data
Returns:
bool success
bool CCopasiXMLInterface::saveElement ( const std::string &  name,
CXMLAttributeList attributeList 
) [protected]

Save an XML element to the ostream

Parameters:
conststd::string & name
CXMLAttributeList& attributeList
Returns:
bool success
bool CCopasiXMLInterface::saveParameter ( const CCopasiParameter parameter) [protected]

Save a Parameter.

Parameters:
constCCopasiParameter & parameter
Returns:
bool success
bool CCopasiXMLInterface::saveParameterGroup ( const std::vector< CCopasiParameter * > &  group) [protected]

Save a Parameter Group.

Parameters:
constCCopasiParameterGroup::parameterGroup & group
Returns:
bool success
bool CCopasiXMLInterface::saveXhtml ( const std::string &  xhtml) [protected]

Save xhtml to the ostream

Parameters:
conststd::string & xhtml
Returns:
bool success
bool CCopasiXMLInterface::startSaveElement ( const std::string &  name) [protected]

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

Parameters:
conststd::string & name
Returns:
bool success
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
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

Member Data Documentation

std::string CCopasiXMLInterface::mFilename [protected]

The filename if available

std::string CCopasiXMLInterface::mIndent [protected]

Indent

std::istream* CCopasiXMLInterface::mpIstream [protected]

A pointer to the input stream

std::ostream* CCopasiXMLInterface::mpOstream [protected]

A pointer to the output stream


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines