ARTS 2.5.11 (git: 6827797f)
|
The ARTS XML tag class. More...
#include <xml_io.h>
Public Member Functions | |
ArtsXMLTag (const Verbosity &rverbosity) | |
void | add_attribute (const String &aname, const std::vector< QuantumNumberType > &value) |
Adds value of attribute as type std::vector<QuantumNumberType> to tag. | |
void | add_attribute (const String &aname, const ArrayOfSpecies &value, const bool self, const bool bath) |
Adds value of attribute. | |
void | get_attribute_value (const String &aname, SpeciesTag &value) |
Returns value of attribute as type SpeciesTag. | |
void | get_attribute_value (const String &aname, ArrayOfSpecies &value, bool &self, bool &bath) |
Returns value of attribute as type ArrayOfSpeciesTag. | |
void | get_attribute_value (const String &aname, std::vector< QuantumNumberType > &value) |
Returns value of attribute as type ArrayOfSpeciesTag. | |
void | add_attribute (const String &aname, String value) |
void | add_attribute (const String &aname, const Index &value) |
Adds an Index attribute to tag. | |
void | add_attribute (const String &aname, const Numeric &value) |
Adds value of attribute as type Numeric to tag. | |
void | get_attribute_value (const String &aname, String &value) |
void | get_attribute_value (const String &aname, Index &value) |
Returns value of attribute as type Index. | |
void | get_attribute_value (const String &aname, Numeric &value) |
Returns value of attribute as type Numeric. | |
![]() | |
XMLTag (const Verbosity &rverbosity) | |
String & | get_name () |
void | check_name (const String &expected_name) |
Check tag name. | |
void | set_name (const String &new_name) |
void | add_attribute (const String &aname, String value) |
void | add_attribute (const String &aname, const Index &value) |
Adds an Index attribute to tag. | |
void | add_attribute (const String &aname, const Numeric &value) |
Adds value of attribute as type Numeric to tag. | |
void | check_attribute (const String &aname, const String &value) |
Checks whether attribute has the expected value. | |
void | get_attribute_value (const String &aname, String &value) |
void | get_attribute_value (const String &aname, Index &value) |
Returns value of attribute as type Index. | |
void | get_attribute_value (const String &aname, Numeric &value) |
Returns value of attribute as type Numeric. | |
void | read_from_stream (istream &is) |
Reads next XML tag. | |
void | write_to_stream (ostream &os) |
Write XML tag. | |
bool | has_attribute (const String &aname) const |
Returns if the attribute exists or not. | |
Additional Inherited Members | |
![]() | |
String | name |
Array< XMLAttribute > | attribs |
const Verbosity & | verbosity |
The ARTS XML tag class.
Handles reading, writing and constructing of XML tags.
|
inline |
void ArtsXMLTag::add_attribute | ( | const String & | aname, |
const ArrayOfSpecies & | value, | ||
const bool | self, | ||
const bool | bath | ||
) |
Adds value of attribute.
[in] | aname | Attribute name |
[in] | value | SpeciesTag(s) for all lines. Basic initialization at self and bath |
[in] | self | True if LineShape::self_broadening in list |
[in] | bath | True if LineShape::bath_broadening in list |
Definition at line 39 of file xml_io.cc.
References add_attribute(), LineShape::bath_broadening, Array< base >::nelem(), LineShape::self_broadening, and v.
void XMLTag::add_attribute | ( | const String & | aname, |
const Index & | value | ||
) |
Adds an Index attribute to tag.
aname | Attribute name |
value | Attribute value |
Definition at line 65 of file xml_io_base.cc.
void XMLTag::add_attribute | ( | const String & | aname, |
const Numeric & | value | ||
) |
Adds value of attribute as type Numeric to tag.
[in] | aname | Attribute name |
[in] | value | Set value |
Definition at line 72 of file xml_io_base.cc.
void ArtsXMLTag::add_attribute | ( | const String & | aname, |
const std::vector< QuantumNumberType > & | value | ||
) |
Adds value of attribute as type std::vector<QuantumNumberType> to tag.
[in] | aname | Attribute name |
[in] | value | Set value |
Definition at line 25 of file xml_io.cc.
References add_attribute(), and v.
Referenced by add_attribute(), and xml_write_to_stream().
Adds a String attribute to tag
All " are replaced by ” to work in the XML tag
aname | Attribute name |
value | Attribute value |
Definition at line 63 of file xml_io_base.cc.
void ArtsXMLTag::get_attribute_value | ( | const String & | aname, |
ArrayOfSpecies & | value, | ||
bool & | self, | ||
bool & | bath | ||
) |
Returns value of attribute as type ArrayOfSpeciesTag.
Searches for the matching attribute and returns it value. If no attribute with the given name exists, it fails exceptionally.
[in] | aname | Attribute name |
[out] | value | SpeciesTag(s) for all lines. Basic initialization at self and bath |
[out] | self | True if LineShape::self_broadening in list |
[out] | bath | True if LineShape::bath_broadening in list |
Definition at line 60 of file xml_io.cc.
References ARTS_USER_ERROR_IF, LineShape::bath_broadening, get_attribute_value(), good_enum(), XMLTag::name, my_basic_string< charT >::nelem(), LineShape::self_broadening, and xml_parse_error().
void XMLTag::get_attribute_value | ( | const String & | aname, |
Index & | value | ||
) |
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 78 of file xml_io_base.cc.
void XMLTag::get_attribute_value | ( | const String & | aname, |
Numeric & | value | ||
) |
Returns value of attribute as type Numeric.
Searches for the matching attribute and returns it value. If no attribute with the given name exists, return value is set to -1e99.
[in] | aname | Attribute name |
[out] | value | Return value |
Definition at line 89 of file xml_io_base.cc.
void ArtsXMLTag::get_attribute_value | ( | const String & | aname, |
SpeciesTag & | value | ||
) |
Returns value of attribute as type SpeciesTag.
Searches for the matching attribute and returns it value. If no attribute with the given name exists, it fails exceptionally.
[in] | aname | Attribute name |
[out] | value | Return value |
Definition at line 53 of file xml_io.cc.
References get_attribute_value().
Referenced by get_attribute_value(), ReadArrayOfARTSCAT(), ReadARTSCAT(), and xml_read_from_stream().
void ArtsXMLTag::get_attribute_value | ( | const String & | aname, |
std::vector< QuantumNumberType > & | value | ||
) |
Returns value of attribute as type ArrayOfSpeciesTag.
Searches for the matching attribute and returns it value
[in] | aname | Attribute name |
[out] | value | Return value |
Definition at line 97 of file xml_io.cc.
References get_attribute_value(), XMLTag::name, my_basic_string< charT >::nelem(), and xml_parse_error().
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*.
Replaces all ” with " to counter XML-tag problems
aname | Attribute name |
value | Return value |
Definition at line 76 of file xml_io_base.cc.