COPASI API  4.40.278
CXMLAttributeList Class Reference

#include <CCopasiXMLInterface.h>

Public Member Functions

bool add (const std::string &name, const C_FLOAT64 &value)
 
template<class CType >
bool add (const std::string &name, const CType &value)
 
template<class CType >
bool add (const std::string &name, const CType &value, const CCopasiXMLInterface::EncodingType &encodingType)
 
 CXMLAttributeList ()
 
 CXMLAttributeList (const CXMLAttributeList &src)
 
bool erase ()
 
std::string getAttribute (const size_t &index) const
 
const std::string & getName (const size_t &index) const
 
const std::string & getValue (const size_t &index) const
 
template<class CType >
bool set (const size_t &index, const std::string &name, const CType &value)
 
template<class CType >
bool set (const size_t &index, const std::string &name, const CType &value, const CCopasiXMLInterface::EncodingType &encodingType)
 
bool setName (const size_t &index, const std::string &name)
 
template<class CType >
bool setValue (const size_t &index, const CType &value)
 
template<class CType >
bool setValue (const size_t &index, const CType &value, const CCopasiXMLInterface::EncodingType &encodingType)
 
size_t size ()
 
bool skip (const size_t &index)
 
 ~CXMLAttributeList ()
 

Private Attributes

std::vector< std::string > mAttributeList
 
std::vector< bool > mSaveList
 

Friends

std::ostream & operator<< (std::ostream &os, const CXMLAttributeList &attr)
 

Detailed Description

A list of XML attributes used by saveElement and startSaveElement.

Constructor & Destructor Documentation

◆ CXMLAttributeList() [1/2]

CXMLAttributeList::CXMLAttributeList ( )

Constructor.

◆ CXMLAttributeList() [2/2]

CXMLAttributeList::CXMLAttributeList ( const CXMLAttributeList src)

Copy constructor.

Parameters
constCXMLAttributeList & src

◆ ~CXMLAttributeList()

CXMLAttributeList::~CXMLAttributeList ( )

Destructor.

Member Function Documentation

◆ add() [1/3]

bool CXMLAttributeList::add ( const std::string &  name,
const C_FLOAT64 value 
)

Add an attribute to the end of the list. Note: the value will be XML encoded

Parameters
conststd::string & name
constC_FLOAT64 & value
Returns
bool success

References add(), and CCopasiXMLInterface::attribute.

◆ add() [2/3]

template<class CType >
bool CXMLAttributeList::add ( const std::string &  name,
const CType &  value 
)
inline

◆ add() [3/3]

template<class CType >
bool CXMLAttributeList::add ( const std::string &  name,
const CType &  value,
const CCopasiXMLInterface::EncodingType encodingType 
)
inline

Add an attribute to the end of the list. Note: the value will be XML encoded

Parameters
conststd::string & name
constCType & value
constCCopasiXMLInterface::EncodingType & encodingType
Returns
bool success

References CCopasiXMLInterface::encode(), mAttributeList, and mSaveList.

◆ erase()

◆ getAttribute()

std::string CXMLAttributeList::getAttribute ( const size_t &  index) const

Retrieve the indexed attribute (' name="value"' or '' if skipped).

Parameters
constsize_t & index
Returns
std::string attribute

References mAttributeList, and mSaveList.

◆ getName()

const std::string & CXMLAttributeList::getName ( const size_t &  index) const

Retrieve the name of the indexed attribute.

Parameters
constsize_t & index
Returns
const std::string & name

References mAttributeList.

◆ getValue()

const std::string & CXMLAttributeList::getValue ( const size_t &  index) const

Retrieve the value of the indexed attribute.

Parameters
constsize_t & index
Returns
const std::string & value

References mAttributeList.

◆ set() [1/2]

template<class CType >
bool CXMLAttributeList::set ( const size_t &  index,
const std::string &  name,
const CType &  value 
)
inline

Set the name and value of the indexed attribute Note: the value will be XML encoded

Parameters
constsize_t & index
conststd::string & name
constCType & value
Returns
bool success

References CCopasiXMLInterface::attribute.

Referenced by CCopasiXML::saveReportSection().

◆ set() [2/2]

template<class CType >
bool CXMLAttributeList::set ( const size_t &  index,
const std::string &  name,
const CType &  value,
const CCopasiXMLInterface::EncodingType encodingType 
)
inline

Set the name and value of the indexed attribute Note: the value will be XML encoded

Parameters
constsize_t & index
conststd::string & name
constCType & value
constCCopasiXMLInterface::EncodingType & encodingType
Returns
bool success

References CCopasiXMLInterface::encode(), mAttributeList, and mSaveList.

◆ setName()

bool CXMLAttributeList::setName ( const size_t &  index,
const std::string &  name 
)

Set the name of the indexed attribute

Parameters
constsize_t & index
conststd::string & name
Returns
bool success

References mAttributeList.

◆ setValue() [1/2]

template<class CType >
bool CXMLAttributeList::setValue ( const size_t &  index,
const CType &  value 
)
inline

Set the value of the indexed attribute Note: the value will be XML encoded

Parameters
constsize_t & index
constCType & value
Returns
bool success

References CCopasiXMLInterface::attribute.

Referenced by CCopasiXML::saveAnnotation(), CCopasiXML::saveFunctionList(), CCopasiXML::saveGUI(), CCopasiXML::saveModel(), CCopasiXML::saveModelParameterSets(), CCopasiXML::saveReportList(), and CCopasiXML::saveSBMLReference().

◆ setValue() [2/2]

template<class CType >
bool CXMLAttributeList::setValue ( const size_t &  index,
const CType &  value,
const CCopasiXMLInterface::EncodingType encodingType 
)
inline

Set the value of the indexed attribute Note: the value will be XML encoded

Parameters
constsize_t & index
constCType & value
constCCopasiXMLInterface::EncodingType & encodingType
Returns
bool success

References CCopasiXMLInterface::encode(), mAttributeList, and mSaveList.

◆ size()

size_t CXMLAttributeList::size ( )

Retrieve the size of the list.

Returns
size_t size

References mAttributeList.

◆ skip()

bool CXMLAttributeList::skip ( const size_t &  index)

Set whether the indexed attribute shall be skipped during save.

Parameters
constsize_t & index
Returns
bool success

References mSaveList.

Referenced by CCopasiXML::saveModel(), and CCopasiXMLInterface::saveParameter().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CXMLAttributeList attr 
)
friend

Member Data Documentation

◆ mAttributeList

std::vector< std::string > CXMLAttributeList::mAttributeList
private

The attribute list.

Referenced by add(), erase(), getAttribute(), getName(), getValue(), set(), setName(), setValue(), and size().

◆ mSaveList

std::vector< bool > CXMLAttributeList::mSaveList
private

The list whether an attribute is to be saved.

Referenced by add(), erase(), getAttribute(), set(), setValue(), and skip().


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