COPASI API
4.16.103
|
#include <CCopasiXMLInterface.h>
Classes | |
class | DBL |
Public Types | |
enum | EncodingType { none = 0, standard, attribute, character } |
Public Member Functions | |
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) |
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 ¶meter) |
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 |
Definition at line 85 of file CCopasiXMLInterface.h.
Enumeration of encoding type.
Enumerator | |
---|---|
none | |
standard | |
attribute | |
character |
Definition at line 91 of file CCopasiXMLInterface.h.
CCopasiXMLInterface::CCopasiXMLInterface | ( | ) |
|
virtual |
|
static |
Encode a given string to a valid XML string
const | std::string & str |
Definition at line 158 of file CCopasiXMLInterface.cpp.
References attribute, character, encodeATTRIBUTE(), encodeCHARACTER(), encodeNONE(), encodeSTD(), none, standard, and void().
Referenced by CXMLAttributeList::add(), CCopasiXMLParser::UnsupportedAnnotationElement::end(), CCopasiXMLParser::MiriamAnnotationElement::end(), CMathMl::fixName(), CCopasiXMLParser::onCharacterData(), saveData(), CXMLAttributeList::set(), CXMLAttributeList::setValue(), CCopasiXMLParser::UnsupportedAnnotationElement::start(), CCopasiXMLParser::CommentElement::start(), and CCopasiXMLParser::MiriamAnnotationElement::start().
|
protected |
End saving an XML element to the ostream started by startSaveElement.
const | std::string & name |
Definition at line 368 of file CCopasiXMLInterface.cpp.
References mIndent, and mpOstream.
Referenced by CCopasiXML::save(), CCopasiXML::saveAnnotation(), CCopasiXML::saveBoundingBox(), CCopasiXML::saveCurve(), CCopasiXML::saveCurveElements(), CCopasiXML::saveFunctionList(), CCopasiXML::saveGlobalRenderInformation(), CCopasiXML::saveGlobalStyle(), CCopasiXML::saveGroupElement(), CCopasiXML::saveGUI(), CCopasiXML::saveLayoutList(), CCopasiXML::saveLinearGradient(), CCopasiXML::saveLineEnding(), CCopasiXML::saveListOfGlobalRenderInformation(), CCopasiXML::saveListOfLocalRenderInformation(), CCopasiXML::saveLocalRenderInformation(), CCopasiXML::saveLocalStyle(), CCopasiXML::saveModel(), CCopasiXML::saveModelParameter(), saveParameter(), CCopasiXML::savePlotList(), CCopasiXML::savePolygonElement(), CCopasiXML::saveRadialGradient(), CCopasiXML::saveRenderCurveElement(), CCopasiXML::saveRenderInformationDefinitionElements(), CCopasiXML::saveRenderTextElement(), CCopasiXML::saveReportList(), CCopasiXML::saveReportSection(), CCopasiXML::saveSBMLReference(), and CCopasiXML::saveTaskList().
|
pure virtual |
Load information from a given istream.
std::istream | & is |
const | std::string & relativeTo |
Implemented in CConfigurationFile::CXML, and CCopasiXML.
Referenced by load().
bool CCopasiXMLInterface::load | ( | const std::string & | fileName, |
const std::string & | relativeTo | ||
) |
Load information from a file.
const | std::string & fileName |
const | std::string & relativeTo |
Definition at line 279 of file CCopasiXMLInterface.cpp.
References CLocaleString::fromUtf8(), load(), and mPWD.
|
pure virtual |
Save information to a given ostream.
std::ostream | & os |
const | std::string & relativeTo |
Implemented in CConfigurationFile::CXML, and CCopasiXML.
Referenced by save().
bool CCopasiXMLInterface::save | ( | const std::string & | fileName, |
const std::string & | relativeTo | ||
) |
Save information to a file.
const | std::string & fileName |
const | std::string & relativeTo |
Definition at line 291 of file CCopasiXMLInterface.cpp.
References CLocaleString::fromUtf8(), mPWD, and save().
|
protected |
Save CDATA to the ostream
const | std::string & data |
Definition at line 305 of file CCopasiXMLInterface.cpp.
References encode(), mIndent, and mpOstream.
Referenced by CCopasiXML::saveFunctionList(), CCopasiXML::saveModel(), CCopasiXML::saveModelParameter(), saveParameter(), CCopasiXML::saveRenderTextElement(), CCopasiXML::saveReportSection(), and saveXhtml().
|
protected |
Save an XML element to the ostream
const | std::string & name |
CXMLAttributeList | & attributeList |
Definition at line 339 of file CCopasiXMLInterface.cpp.
References mIndent, and mpOstream.
Referenced by CCopasiXML::saveColorDefinition(), CCopasiXML::saveDimensions(), CCopasiXML::saveEllipseElement(), CCopasiXML::saveFunctionList(), CCopasiXML::saveGradientStop(), CCopasiXML::saveGUI(), CCopasiXML::saveImageElement(), CCopasiXML::saveLayoutList(), CCopasiXML::saveModel(), CCopasiXML::saveModelParameter(), saveParameter(), CCopasiXML::savePlotList(), CCopasiXML::savePosition(), CCopasiXML::saveRectangleElement(), CCopasiXML::saveRenderPoint(), CCopasiXML::saveReportList(), CCopasiXML::saveReportSection(), CCopasiXML::saveSBMLReference(), and CCopasiXML::saveTaskList().
|
protected |
Save a Parameter.
const | CCopasiParameter & parameter |
Definition at line 376 of file CCopasiXMLInterface.cpp.
References CXMLAttributeList::add(), CCopasiParameter::BOOL, CCopasiParameter::CN, CCopasiParameter::DOUBLE, endSaveElement(), CCopasiParameter::EXPRESSION, CCopasiParameter::FILE, CDirEntry::fileName(), CCopasiObject::getObjectName(), CCopasiParameter::getType(), CCopasiParameter::getValue(), CCopasiParameter::GROUP, CCopasiParameter::INT, CCopasiParameter::INVALID, CDirEntry::isRelativePath(), CCopasiParameter::KEY, CDirEntry::makePathRelative(), mPWD, CCopasiParameter::Value::pBOOL, CCopasiParameter::Value::pCN, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pEXPRESSION, CCopasiParameter::Value::pFILE, CCopasiParameter::Value::pGROUP, CCopasiParameter::Value::pINT, CCopasiParameter::Value::pKEY, CCopasiParameter::Value::pSTRING, CCopasiParameter::Value::pUDOUBLE, CCopasiParameter::Value::pUINT, saveData(), saveElement(), saveParameterGroup(), CXMLAttributeList::skip(), startSaveElement(), CCopasiParameter::STRING, CCopasiParameter::UDOUBLE, CCopasiParameter::UINT, and CCopasiParameter::XMLType.
Referenced by saveParameterGroup().
|
protected |
Save a Parameter Group.
const | CCopasiParameterGroup::parameterGroup & group |
Definition at line 489 of file CCopasiXMLInterface.cpp.
References saveParameter().
Referenced by saveParameter(), CCopasiXML::savePlotList(), and CCopasiXML::saveTaskList().
|
protected |
Save xhtml to the ostream
const | std::string & xhtml |
Definition at line 312 of file CCopasiXMLInterface.cpp.
References mIndent, mpOstream, and saveData().
Referenced by CCopasiXML::saveAnnotation(), and CCopasiXML::saveReportList().
|
protected |
Start saving an XML element to the ostream. Call endSaveElement to conclude.
const | std::string & name |
Definition at line 349 of file CCopasiXMLInterface.cpp.
References mIndent, and mpOstream.
Referenced by CCopasiXML::save(), CCopasiXML::saveAnnotation(), CCopasiXML::saveBoundingBox(), CCopasiXML::saveCurve(), CCopasiXML::saveCurveElements(), CCopasiXML::saveFunctionList(), CCopasiXML::saveGlobalRenderInformation(), CCopasiXML::saveGlobalStyle(), CCopasiXML::saveGroupElement(), CCopasiXML::saveGUI(), CCopasiXML::saveLayoutList(), CCopasiXML::saveLinearGradient(), CCopasiXML::saveLineEnding(), CCopasiXML::saveListOfGlobalRenderInformation(), CCopasiXML::saveListOfLocalRenderInformation(), CCopasiXML::saveLocalRenderInformation(), CCopasiXML::saveLocalStyle(), CCopasiXML::saveModel(), CCopasiXML::saveModelParameter(), saveParameter(), CCopasiXML::savePlotList(), CCopasiXML::savePolygonElement(), CCopasiXML::saveRadialGradient(), CCopasiXML::saveRenderCurveElement(), CCopasiXML::saveRenderInformationDefinitionElements(), CCopasiXML::saveRenderTextElement(), CCopasiXML::saveReportList(), CCopasiXML::saveReportSection(), CCopasiXML::saveSBMLReference(), and CCopasiXML::saveTaskList().
|
protected |
Start saving an XML element to the ostream. Call endSaveElement to conclude.
const | std::string & name |
CXMLAttributeList | & attributeList |
Definition at line 357 of file CCopasiXMLInterface.cpp.
References mIndent, and mpOstream.
|
static |
Encode a given string to a valid XML string
const | C_FLOAT64 & dbl |
const | std::string & str |
Definition at line 245 of file CCopasiXMLInterface.cpp.
Referenced by CMIRIAMResourceObject::unescapeId().
|
protected |
Indent
Definition at line 133 of file CCopasiXMLInterface.h.
Referenced by endSaveElement(), saveData(), saveElement(), CCopasiXML::saveModel(), saveXhtml(), and startSaveElement().
|
protected |
A pointer to the input stream
Definition at line 123 of file CCopasiXMLInterface.h.
Referenced by CCopasiXML::load().
|
protected |
A pointer to the output stream
Definition at line 128 of file CCopasiXMLInterface.h.
Referenced by endSaveElement(), CCopasiXML::save(), CCopasiXML::saveAnnotation(), saveData(), saveElement(), CCopasiXML::saveModel(), saveXhtml(), and startSaveElement().
|
protected |
The filename if available
Definition at line 138 of file CCopasiXMLInterface.h.
Referenced by CCopasiXML::load(), load(), CCopasiXML::save(), save(), saveParameter(), CCopasiXML::saveSBMLReference(), and CCopasiXML::saveTaskList().