ctml.h File Reference

CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data. More...

#include "ct_defs.h"
#include "xml.h"
#include "Array.h"
Include dependency graph for ctml.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ctml
 

The ctml namespace adds functionality to the XML object, by providing standard functions that read, write, and interpret XML files and object trees.


Functions

void addBool (Cantera::XML_Node &node, const std::string &titleString, const bool value)
 This function adds a child node with the name, "bool", with a value consisting of a single bool.
void addInteger (Cantera::XML_Node &node, const std::string &titleString, const int value, const std::string unitsString="", const std::string typeString="")
 This function adds a child node with the name, "integer", with a value consisting of a single integer.
void addFloat (Cantera::XML_Node &node, const std::string &titleString, const doublereal value, const std::string unitsString="", const std::string typeString="", const doublereal minval=Cantera::Undef, const doublereal maxval=Cantera::Undef)
 This function adds a child node with the name, "float", with a value consisting of a single floating point number.
void addIntegerArray (Cantera::XML_Node &node, const std::string &titleString, const int n, const int *const values, const std::string unitsString="", const std::string typeString="", const doublereal minval=Cantera::Undef, const doublereal maxval=Cantera::Undef)
 This function adds a child node with the name, "intArray", with a value consisting of a comma separated list of integers.
void addFloatArray (Cantera::XML_Node &node, const std::string &titleString, const int n, const doublereal *const values, const std::string unitsString="", const std::string typeString="", const doublereal minval=Cantera::Undef, const doublereal maxval=Cantera::Undef)
 This function adds a child node with the name, "floatArray", with a value consisting of a comma separated list of floats.
void addString (Cantera::XML_Node &node, const std::string &titleString, const std::string &valueString, const std::string typeString="")
 This function adds a child node with the name string with a string value to the current node.
int getFloatArray (const Cantera::XML_Node &node, Cantera::vector_fp &v, const bool convert=true, const std::string unitsString="", const std::string nodeName="floatArray")
 This function reads the current node or a child node of the current node with the default name, "floatArray", with a value field consisting of a comma separated list of floats.
void getStringArray (const Cantera::XML_Node &node, std::vector< std::string > &v)
 This function interprets the value portion of an XML element as a string.
void getMap (const Cantera::XML_Node &node, std::map< std::string, std::string > &m)
 This routine is used to interpret the value portions of XML elements that contain colon separated pairs.
int getPairs (const Cantera::XML_Node &node, std::vector< std::string > &key, std::vector< std::string > &val)
 This function interprets the value portion of an XML element as a series of "Pairs" separated by white space.
void getMatrixValues (const Cantera::XML_Node &node, const std::vector< std::string > &keyStringRow, const std::vector< std::string > &keyStringCol, Cantera::Array2D &returnValues, const bool convert=true, const bool matrixSymmetric=false)
 This function interprets the value portion of an XML element as a series of "Matrix ids and entries" separated by white space.
void getIntegers (const Cantera::XML_Node &node, std::map< std::string, int > &v)
 Get a vector of integer values from a child element.
doublereal getFloat (const Cantera::XML_Node &parent, const std::string &name, const std::string type="")
 Get a floating-point value from a child element.
doublereal getFloatCurrent (const Cantera::XML_Node &currXML, const std::string type="")
 Get a floating-point value from the current XML element.
bool getOptionalFloat (const Cantera::XML_Node &parent, const std::string &name, doublereal &fltRtn, const std::string type="")
 Get an optional floating-point value from a child element.
void getFloats (const Cantera::XML_Node &node, std::map< std::string, double > &v, const bool convert=true)
 Get a vector of floating-point values from a child element.
int getInteger (const Cantera::XML_Node &parent, std::string name)
 Get an integer value from a child element.
doublereal getFloatDefaultUnits (const Cantera::XML_Node &parent, std::string name, std::string defaultUnits, std::string type="toSI")
 Get a floating-point value from a child element with a defined units field.
bool getOptionalModel (const Cantera::XML_Node &parent, const std::string nodeName, std::string &modelName)
 Get an optional model name from a named child node.
void getFunction (const Cantera::XML_Node &node, std::string &typeString, doublereal &xmin, doublereal &xmax, Cantera::vector_fp &v)
 This function reads a child node with the default name, "floatArray", with a value consisting of a comma separated list of floats.
XML_Node * getByTitle (const Cantera::XML_Node &node, const std::string &title)
 Search the child nodes of the current node for an XML Node with a Title attribute of a given name.
void getString (const Cantera::XML_Node &node, const std::string &titleString, std::string &valueString, std::string &typeString)
 This function reads a child node with the name string with a specific title attribute named titleString.
std::string getChildValue (const Cantera::XML_Node &parent, const std::string &nameString)
 This function reads a child node with the name, nameString, and returns its xml value as the return string.
void get_CTML_Tree (Cantera::XML_Node *node, const std::string file, const int debug=0)
 Read an ctml file from a file and fill up an XML tree.
void ct2ctml (const char *file, const int debug=0)
 Convert a cti file into a ctml file.

Variables

const std::string CTML_Version = "1.4.1"
 const Specifying the CTML version number

Detailed Description

CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.

These functions read and write it. (see Input File Handling and importCTML, ck2ctml)

Definition in file ctml.h.

Generated by  doxygen 1.6.3