Gromacs  2024.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Variables
gmx::test::anonymous_namespace{refdata_xml.cpp} Namespace Reference


typedef tinyxml2::XMLDocument * XMLDocumentPtr
 Convenience typedef.
typedef tinyxml2::XMLNode * XMLNodePtr
 Convenience typedef.
typedef tinyxml2::XMLElement * XMLElementPtr
 Convenience typedef.
typedef tinyxml2::XMLText * XMLTextPtr
 Convenience typedef.


Helper functions for XML reading
void readEntry (XMLNodePtr element, ReferenceDataEntry *entry)
 Read element and transfer the contents to entry.
XMLNodePtr getCDataChildNode (XMLNodePtr node)
bool hasCDataContent (XMLNodePtr node)
XMLNodePtr getNextTextChildNode (XMLNodePtr childNode)
 Return a node convertible to text, either childNode or its first such sibling.
std::string getValueFromLeafElement (XMLNodePtr node)
 Return the concatenation of all the text children of node, including multiple CDATA children.
ReferenceDataEntry::EntryPointer createEntry (XMLElementPtr element)
 Make a new entry from element.
void readChildEntries (XMLNodePtr parentElement, ReferenceDataEntry *entry)
 Read the child entries of parentElement and transfer the contents to entry.
bool isCompoundElement (XMLNodePtr node)
 Return whether node has child XML elements (rather than text content).
Helper functions for XML writing
void createElementAndContents (XMLElementPtr parentElement, const ReferenceDataEntry &entry)
void setIdAttribute (XMLElementPtr element, const std::string &id)
XMLElementPtr createElement (XMLElementPtr parentElement, const ReferenceDataEntry &entry)
void createChildElements (XMLElementPtr parentElement, const ReferenceDataEntry &entry)
std::vector< std::string > breakUpAnyCdataEndTags (const std::string &input)
 Handle input intended to be written as CDATA. More...
void createElementContents (XMLElementPtr element, const ReferenceDataEntry &entry)
XMLElementPtr createRootElement (XMLDocumentPtr document)


const char *const c_VersionDeclarationString = "xml version=\"1.0\""
 XML version declaration used when writing the reference data.
const char *const c_StyleSheetDeclarationString
 XML stylesheet declaration used for writing the reference data. More...
const char *const c_RootNodeName = "ReferenceData"
 Name of the root element in reference data XML files.
const char *const c_IdAttrName = "Name"
 Name of the XML attribute used to store identifying strings for reference data elements.

Function Documentation

std::vector<std::string> gmx::test::anonymous_namespace{refdata_xml.cpp}::breakUpAnyCdataEndTags ( const std::string &  input)

Handle input intended to be written as CDATA.

This method searches for any ']]>' sequences embedded in input, because this must always end a CDATA field. If any are found, it breaks the string so that instead multiple CDATA fields will be written with that token sequence split across the fields. Note that tinyxml2 does not handle such things itself.

This is an edge case that is unimportant for GROMACS refdata, but it is preferable to know that the infrastructure won't break.

Variable Documentation

const char* const gmx::test::anonymous_namespace{refdata_xml.cpp}::c_StyleSheetDeclarationString
Initial value:
"xml-stylesheet type=\"text/xsl\" href=\"referencedata.xsl\""

XML stylesheet declaration used for writing the reference data.