ARTS
2.2.66
|
The ARTS XML tag class. More...
#include <xml_io_private.h>
Public Member Functions | |
ArtsXMLTag (const Verbosity &rverbosity) | |
String & | get_name () |
void | check_name (const String &expected_name) |
Check tag name. More... | |
void | set_name (const String &new_name) |
void | add_attribute (const String &aname, const String &value) |
Adds a String attribute to tag. More... | |
void | add_attribute (const String &aname, const Index &value) |
Adds an Index attribute to tag. More... | |
void | check_attribute (const String &aname, const String &value) |
Checks whether attribute has the expected value. More... | |
void | get_attribute_value (const String &aname, String &value) |
Returns value of attribute as String. More... | |
void | get_attribute_value (const String &aname, Index &value) |
Returns value of attribute as type Index. More... | |
void | read_from_stream (istream &is) |
Reads next XML tag. More... | |
void | write_to_stream (ostream &os) |
Write XML tag. More... | |
Private Attributes | |
String | name |
Array< XMLAttribute > | attribs |
const Verbosity & | verbosity |
The ARTS XML tag class.
Handles reading, writing and constructing of XML tags.
Definition at line 79 of file xml_io_private.h.
|
inline |
Definition at line 81 of file xml_io_private.h.
Adds a String attribute to tag.
aname | Attribute name |
value | Attribute value |
Definition at line 69 of file xml_io.cc.
References attribs, XMLAttribute::name, and XMLAttribute::value.
Referenced by add_attribute(), xml_write_header_to_stream(), and xml_write_to_stream().
Adds an Index attribute to tag.
aname | Attribute name |
value | Attribute value |
Definition at line 85 of file xml_io.cc.
References add_attribute().
Checks whether attribute has the expected value.
If the attribute has another value or is unknown an exception is thrown.
aname | Attribute name |
value | Expected value |
Definition at line 103 of file xml_io.cc.
References get_attribute_value(), and xml_parse_error().
Referenced by xml_parse_from_stream(), and xml_read_from_stream().
void ArtsXMLTag::check_name | ( | const String & | expected_name | ) |
Check tag name.
Checks whether the name of the tag is correct. Throws runtime error otherwise.
expected_name | Expected tag name |
Definition at line 56 of file xml_io.cc.
References name, and xml_parse_error().
Referenced by read_from_stream(), xml_read_footer_from_stream(), xml_read_from_stream(), and xml_read_header_from_stream().
Returns value of attribute as String.
Searches for the matching attribute and returns it value. If no attribute with the given name exists, return value is set to not found*.
aname | Attribute name |
value | Return value |
Definition at line 131 of file xml_io.cc.
References attribs.
Referenced by check_attribute(), get_attribute_value(), xml_parse_from_stream(), xml_read_from_stream(), and xml_read_header_from_stream().
Returns value of attribute as type Index.
Searches for the matching attribute and returns it value. If no attribute with the given name exists, return value is set to not found*.
aname | Attribute name |
value | Return value |
Definition at line 160 of file xml_io.cc.
References get_attribute_value(), name, and xml_parse_error().
|
inline |
Definition at line 83 of file xml_io_private.h.
References XMLAttribute::name.
Referenced by xml_read_from_stream().
void ArtsXMLTag::read_from_stream | ( | istream & | is | ) |
Reads next XML tag.
Reads the name and attributes of the next XML tag from stream.
is | Input stream |
Definition at line 183 of file xml_io.cc.
References attribs, check_name(), CREATE_OUT3, XMLAttribute::name, name, my_basic_string< charT >::npos, XMLAttribute::value, and xml_parse_error().
Referenced by xml_read_footer_from_stream(), xml_read_from_stream(), and xml_read_header_from_stream().
|
inline |
Definition at line 87 of file xml_io_private.h.
References XMLAttribute::name, and XMLAttribute::value.
Referenced by xml_write_footer_to_stream(), xml_write_header_to_stream(), and xml_write_to_stream().
void ArtsXMLTag::write_to_stream | ( | ostream & | os | ) |
Write XML tag.
Puts the tag together and writes it to stream.
os | Output stream |
Definition at line 321 of file xml_io.cc.
Referenced by xml_data_parse_error(), xml_write_footer_to_stream(), xml_write_header_to_stream(), and xml_write_to_stream().
|
private |
List of attributes
Definition at line 105 of file xml_io_private.h.
Referenced by add_attribute(), get_attribute_value(), read_from_stream(), and write_to_stream().
|
private |
Tag name
Definition at line 104 of file xml_io_private.h.
Referenced by check_name(), get_attribute_value(), read_from_stream(), write_to_stream(), and xml_open_output_file().
|
private |
Definition at line 106 of file xml_io_private.h.
Referenced by xml_open_input_file().