preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions
precice::xml Namespace Reference

contains the XML configuration parser. More...

Classes

class  ConfigParser
 
struct  ConfigurationContext
 Tightly coupled to the parameters of Participant() More...
 
struct  NoPListener
 No operation listener for tests. More...
 
class  XMLAttribute
 
class  XMLTag
 Represents an XML tag to be configured automatically. More...
 

Functions

std::string decodeXML (std::string_view xml)
 Decodes escape sequences of a given xml.
 
void OnStartElementNs (void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes)
 
void OnEndElementNs (void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI)
 
void OnCharacters (void *ctx, const xmlChar *ch, int len)
 
void OnStructuredErrorFunc (void *userData, const xmlError *error)
 
void OnStructuredErrorFunc (void *userData, xmlError *error)
 
void OnErrorFunc (void *userData, const char *error,...)
 
void OnFatalErrorFunc (void *userData, const char *error,...)
 
void toMarkdown (std::ostream &out, const XMLTag &tag)
 Prints the Markdown reference for the given tag.
 
void toDTD (std::ostream &out, const XMLTag &tag)
 Prints the DTD reference for the given tag.
 
void toDocumentation (std::ostream &out, const XMLTag &tag)
 Prints the XML reference for the given tag.
 
void readValueSpecific (const std::string &rawValue, double &value)
 
void readValueSpecific (const std::string &rawValue, int &value)
 
void readValueSpecific (const std::string &rawValue, Eigen::VectorXd &value)
 
void readValueSpecific (const std::string &rawValue, std::string &value)
 
void readValueSpecific (const std::string &rawValue, bool &value)
 
XMLAttribute< std::stringmakeXMLAttribute (std::string name, const char *defaultValue)
 
template<typename T >
XMLAttribute< T > makeXMLAttribute (std::string name, T defaultValue)
 
std::string getName (const XMLTag::Attribute &attribute)
 Returns the name of an Attribute.
 
XMLTag getRootTag ()
 Returns an empty root tag with name "configuration".
 
std::string configure (XMLTag &tag, const precice::xml::ConfigurationContext &context, std::string_view configurationFilename)
 Configures the given configuration from file configurationFilename.
 

Detailed Description

contains the XML configuration parser.

Function Documentation

◆ configure()

std::string precice::xml::configure ( XMLTag & tag,
const precice::xml::ConfigurationContext & context,
std::string_view configurationFilename )

Configures the given configuration from file configurationFilename.

Definition at line 284 of file XMLTag.cpp.

Here is the call graph for this function:

◆ decodeXML()

std::string precice::xml::decodeXML ( std::string_view xml)

Decodes escape sequences of a given xml.

Definition at line 22 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ getName()

std::string precice::xml::getName ( const XMLTag::Attribute & attribute)

Returns the name of an Attribute.

Definition at line 273 of file XMLTag.cpp.

Here is the call graph for this function:

◆ getRootTag()

XMLTag precice::xml::getRootTag ( )

Returns an empty root tag with name "configuration".

A static NoPListener is added, and the occurrence is set to OCCUR_ONCE.

Definition at line 278 of file XMLTag.cpp.

◆ makeXMLAttribute() [1/2]

XMLAttribute< std::string > precice::xml::makeXMLAttribute ( std::string name,
const char * defaultValue )
inline

creates an XMLAttribute given a name and a default value.

Parameters
[in]namethe name of the attribute
[in]defaultValuethe default value of the attribute
Returns
an XMLAttribute with the above settings

Definition at line 225 of file XMLAttribute.hpp.

◆ makeXMLAttribute() [2/2]

template<typename T >
XMLAttribute< T > precice::xml::makeXMLAttribute ( std::string name,
T defaultValue )

creates an XMLAttribute given a name and a default value.

Parameters
[in]namethe name of the attribute
[in]defaultValuethe default value of the attribute
Returns
an XMLAttribute with the above settings

Definition at line 237 of file XMLAttribute.hpp.

◆ OnCharacters()

void precice::xml::OnCharacters ( void * ctx,
const xmlChar * ch,
int len )

Definition at line 85 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ OnEndElementNs()

void precice::xml::OnEndElementNs ( void * ctx,
const xmlChar * localname,
const xmlChar * prefix,
const xmlChar * URI )

Definition at line 75 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ OnErrorFunc()

void precice::xml::OnErrorFunc ( void * userData,
const char * error,
... )

Definition at line 109 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ OnFatalErrorFunc()

void precice::xml::OnFatalErrorFunc ( void * userData,
const char * error,
... )

Definition at line 114 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ OnStartElementNs()

void precice::xml::OnStartElementNs ( void * ctx,
const xmlChar * localname,
const xmlChar * prefix,
const xmlChar * URI,
int nb_namespaces,
const xmlChar ** namespaces,
int nb_attributes,
int nb_defaulted,
const xmlChar ** attributes )

Definition at line 44 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ OnStructuredErrorFunc() [1/2]

void precice::xml::OnStructuredErrorFunc ( void * userData,
const xmlError * error )

Definition at line 91 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ OnStructuredErrorFunc() [2/2]

void precice::xml::OnStructuredErrorFunc ( void * userData,
xmlError * error )

Definition at line 104 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ readValueSpecific() [1/5]

void precice::xml::readValueSpecific ( const std::string & rawValue,
bool & value )
inline

Definition at line 18 of file ValueParser.hpp.

Here is the call graph for this function:

◆ readValueSpecific() [2/5]

void precice::xml::readValueSpecific ( const std::string & rawValue,
double & value )

Definition at line 30 of file ValueParser.cpp.

Here is the call graph for this function:

◆ readValueSpecific() [3/5]

void precice::xml::readValueSpecific ( const std::string & rawValue,
Eigen::VectorXd & value )

Definition at line 55 of file ValueParser.cpp.

Here is the call graph for this function:

◆ readValueSpecific() [4/5]

void precice::xml::readValueSpecific ( const std::string & rawValue,
int & value )

Definition at line 42 of file ValueParser.cpp.

◆ readValueSpecific() [5/5]

void precice::xml::readValueSpecific ( const std::string & rawValue,
std::string & value )
inline

Definition at line 13 of file ValueParser.hpp.

◆ toDocumentation()

void precice::xml::toDocumentation ( std::ostream & out,
const XMLTag & tag )

Prints the XML reference for the given tag.

Definition at line 370 of file Printer.cpp.

◆ toDTD()

void precice::xml::toDTD ( std::ostream & out,
const XMLTag & tag )

Prints the DTD reference for the given tag.

Definition at line 365 of file Printer.cpp.

◆ toMarkdown()

void precice::xml::toMarkdown ( std::ostream & out,
const XMLTag & tag )

Prints the Markdown reference for the given tag.

Definition at line 360 of file Printer.cpp.