preCICE v3.2.0
Loading...
Searching...
No Matches
precice::xml::ConfigParser Class Reference

#include <ConfigParser.hpp>

Collaboration diagram for precice::xml::ConfigParser:
[legend]

Classes

struct  CTag
 Struct holding the read tag from xml file. More...

Public Types

using CTagPtrVec = std::vector<std::shared_ptr<CTag>>

Public Member Functions

 ConfigParser (std::string_view filePath, const ConfigurationContext &context, std::shared_ptr< XMLTag > pXmlTag)
 Parser ctor for Callback init.
 ConfigParser (std::string_view filePath)
 Parser ctor without Callbacks.
int readXmlFile (std::string const &filePath)
 Reads the xml file.
std::string hash () const
 returns the hash of the processed XML file
void connectTags (const ConfigurationContext &context, std::vector< std::shared_ptr< precice::xml::XMLTag > > &DefTags, CTagPtrVec &SubTags)
 Connects the actual tags of an xml layer with the predefined tags.
void OnStartElement (std::string_view localname, std::string_view prefix, CTag::AttributePair attributes)
 Callback for Start-Tag.
void OnEndElement ()
 Callback for End-Tag.
void OnTextSection (const std::string &ch)
 Callback for text sections in xml file.

Static Public Member Functions

static void MessageProxy (int level, std::string_view mess)
 Proxy for error and warning messages from libxml2.

Private Attributes

std::string _hash
 the hash of the last processed config
CTagPtrVec m_AllTags
CTagPtrVec m_CurrentTags
std::shared_ptr< precice::xml::XMLTagm_pXmlTag

Static Private Attributes

static precice::logging::Logger _log

Detailed Description

Definition at line 22 of file ConfigParser.hpp.

Member Typedef Documentation

◆ CTagPtrVec

Constructor & Destructor Documentation

◆ ConfigParser() [1/2]

precice::xml::ConfigParser::ConfigParser ( std::string_view filePath,
const ConfigurationContext & context,
std::shared_ptr< XMLTag > pXmlTag )

Parser ctor for Callback init.

Definition at line 123 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ ConfigParser() [2/2]

precice::xml::ConfigParser::ConfigParser ( std::string_view filePath)

Parser ctor without Callbacks.

Definition at line 143 of file ConfigParser.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ connectTags()

void precice::xml::ConfigParser::connectTags ( const ConfigurationContext & context,
std::vector< std::shared_ptr< precice::xml::XMLTag > > & DefTags,
CTagPtrVec & SubTags )

Connects the actual tags of an xml layer with the predefined tags.

Parameters
DefTagspredefined tags
SubTagsactual tags from xml file

Definition at line 225 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ hash()

std::string precice::xml::ConfigParser::hash ( ) const

returns the hash of the processed XML file

Definition at line 163 of file ConfigParser.cpp.

◆ MessageProxy()

void precice::xml::ConfigParser::MessageProxy ( int level,
std::string_view mess )
static

Proxy for error and warning messages from libxml2.

Definition at line 148 of file ConfigParser.cpp.

◆ OnEndElement()

void precice::xml::ConfigParser::OnEndElement ( )

Callback for End-Tag.

Definition at line 297 of file ConfigParser.cpp.

◆ OnStartElement()

void precice::xml::ConfigParser::OnStartElement ( std::string_view localname,
std::string_view prefix,
CTag::AttributePair attributes )

Callback for Start-Tag.

Definition at line 277 of file ConfigParser.cpp.

Here is the call graph for this function:

◆ OnTextSection()

void precice::xml::ConfigParser::OnTextSection ( const std::string & ch)

Callback for text sections in xml file.

Definition at line 302 of file ConfigParser.cpp.

◆ readXmlFile()

int precice::xml::ConfigParser::readXmlFile ( std::string const & filePath)

Reads the xml file.

Definition at line 168 of file ConfigParser.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _hash

std::string precice::xml::ConfigParser::_hash
private

the hash of the last processed config

Definition at line 41 of file ConfigParser.hpp.

◆ _log

precice::logging::Logger precice::xml::ConfigParser::_log
staticprivate

Definition at line 38 of file ConfigParser.hpp.

◆ m_AllTags

CTagPtrVec precice::xml::ConfigParser::m_AllTags
private

Definition at line 43 of file ConfigParser.hpp.

◆ m_CurrentTags

CTagPtrVec precice::xml::ConfigParser::m_CurrentTags
private

Definition at line 44 of file ConfigParser.hpp.

◆ m_pXmlTag

std::shared_ptr<precice::xml::XMLTag> precice::xml::ConfigParser::m_pXmlTag
private

Definition at line 46 of file ConfigParser.hpp.


The documentation for this class was generated from the following files: