ViennaGrid - The Vienna Grid Library  2.1.0
Public Member Functions
xml_tag< dummy > Class Template Reference

Helper class that parses a XML tag. More...

#include <xml_tag.hpp>

Public Member Functions

void check_attribute (std::string const &attrib_name, std::string const &filename) const
 Makes sure that the XML tag has a certain attribute. If not, a bad_file_format_exception is thrown.
void check_name (std::string const &expected_name, std::string const &filename=std::string())
 Makes sure that the parsed XML tag has a certain name. Throws an bad_file_format_exception if not the case.
void clear ()
 Clears all internal data.
std::string get_value (std::string const &attrib_name) const
 Returns the value of a certain attribute.
bool has_attribute (std::string const &attrib_name) const
 Returns true if the XML tag has a certain attribute.
std::string name () const
 Returns the XML tag name.
template<typename InputStream >
void parse (InputStream &reader)
 Triggers the parsing of a XML tag.
template<typename InputStream >
void parse_and_check_name (InputStream &reader, std::string const &expected_name, std::string const &filename=std::string())
 Convenience overload for parsing a XML tag and checking the tag name.

Detailed Description

template<typename dummy = bool>
class viennagrid::io::xml_tag< dummy >

Helper class that parses a XML tag.

Template Parameters:
dummyA dummy parameter to control the linkage of the class

Member Function Documentation

void check_attribute ( std::string const &  attrib_name,
std::string const &  filename 
) const [inline]

Makes sure that the XML tag has a certain attribute. If not, a bad_file_format_exception is thrown.

void check_name ( std::string const &  expected_name,
std::string const &  filename = std::string() 
) [inline]

Makes sure that the parsed XML tag has a certain name. Throws an bad_file_format_exception if not the case.

void clear ( ) [inline]

Clears all internal data.

std::string get_value ( std::string const &  attrib_name) const [inline]

Returns the value of a certain attribute.

bool has_attribute ( std::string const &  attrib_name) const [inline]

Returns true if the XML tag has a certain attribute.

std::string name ( ) const [inline]

Returns the XML tag name.

void parse ( InputStream &  reader) [inline]

Triggers the parsing of a XML tag.

void parse_and_check_name ( InputStream &  reader,
std::string const &  expected_name,
std::string const &  filename = std::string() 
) [inline]

Convenience overload for parsing a XML tag and checking the tag name.


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