preCICE v3.1.2
Loading...
Searching...
No Matches
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 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)
 
XMLTag getRootTag ()
 Returns an XMLTag::Listener that does nothing on callbacks.
 
void 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()

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

Configures the given configuration from file configurationFilename.

Definition at line 395 of file XMLTag.cpp.

Here is the call graph for this function:

◆ decodeXML()

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

Decodes escape sequences of a given xml.

Definition at line 21 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ getRootTag()

XMLTag precice::xml::getRootTag ( )

Returns an XMLTag::Listener that does nothing on callbacks.

This is useful for tests, when the root tag to be specified in

Returns an empty root tag with name "configuration".

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

Definition at line 389 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 219 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 231 of file XMLAttribute.hpp.

◆ OnCharacters()

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

Definition at line 82 of file ConfigParser.cpp.

◆ OnEndElementNs()

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

Definition at line 72 of file ConfigParser.cpp.

◆ OnErrorFunc()

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

Definition at line 106 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 111 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 42 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 88 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 101 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 19 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.

◆ readValueSpecific() [3/5]

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

Definition at line 55 of file ValueParser.cpp.

◆ 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 14 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 468 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 463 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 458 of file Printer.cpp.