ARTS 2.5.11 (git: 6827797f)
ArtsXMLTag Class Reference

The ARTS XML tag class. More...

#include <xml_io.h>

Inheritance diagram for ArtsXMLTag:
XMLTag

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.
 
- Public Member Functions inherited from XMLTag
 XMLTag (const Verbosity &rverbosity)
 
Stringget_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

- Protected Attributes inherited from XMLTag
String name
 
Array< XMLAttributeattribs
 
const Verbosityverbosity
 

Detailed Description

The ARTS XML tag class.

Handles reading, writing and constructing of XML tags.

Definition at line 28 of file xml_io.h.

Constructor & Destructor Documentation

◆ ArtsXMLTag()

ArtsXMLTag::ArtsXMLTag ( const Verbosity rverbosity)
inline

Definition at line 30 of file xml_io.h.

Member Function Documentation

◆ add_attribute() [1/5]

void ArtsXMLTag::add_attribute ( const String aname,
const ArrayOfSpecies value,
const bool  self,
const bool  bath 
)

Adds value of attribute.

Parameters
[in]anameAttribute name
[in]valueSpeciesTag(s) for all lines. Basic initialization at self and bath
[in]selfTrue if LineShape::self_broadening in list
[in]bathTrue 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.

◆ add_attribute() [2/5]

void XMLTag::add_attribute ( const String aname,
const Index &  value 
)

Adds an Index attribute to tag.

Parameters
anameAttribute name
valueAttribute value

Definition at line 65 of file xml_io_base.cc.

◆ add_attribute() [3/5]

void XMLTag::add_attribute ( const String aname,
const Numeric &  value 
)

Adds value of attribute as type Numeric to tag.

Parameters
[in]anameAttribute name
[in]valueSet value

Definition at line 72 of file xml_io_base.cc.

◆ add_attribute() [4/5]

void ArtsXMLTag::add_attribute ( const String aname,
const std::vector< QuantumNumberType > &  value 
)

Adds value of attribute as type std::vector<QuantumNumberType> to tag.

Parameters
[in]anameAttribute name
[in]valueSet value

Definition at line 25 of file xml_io.cc.

References add_attribute(), and v.

Referenced by add_attribute(), and xml_write_to_stream().

◆ add_attribute() [5/5]

void XMLTag::add_attribute ( const String aname,
String  value 
)

Adds a String attribute to tag

All " are replaced by ” to work in the XML tag

Parameters
anameAttribute name
valueAttribute value

Definition at line 63 of file xml_io_base.cc.

◆ get_attribute_value() [1/6]

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.

Parameters
[in]anameAttribute name
[out]valueSpeciesTag(s) for all lines. Basic initialization at self and bath
[out]selfTrue if LineShape::self_broadening in list
[out]bathTrue 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().

◆ get_attribute_value() [2/6]

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*.

Parameters
anameAttribute name
valueReturn value

Definition at line 78 of file xml_io_base.cc.

◆ get_attribute_value() [3/6]

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.

Parameters
[in]anameAttribute name
[out]valueReturn value

Definition at line 89 of file xml_io_base.cc.

◆ get_attribute_value() [4/6]

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.

Parameters
[in]anameAttribute name
[out]valueReturn 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().

◆ get_attribute_value() [5/6]

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

Parameters
[in]anameAttribute name
[out]valueReturn 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().

◆ get_attribute_value() [6/6]

void XMLTag::get_attribute_value ( const String aname,
String value 
)

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

Parameters
anameAttribute name
valueReturn value

Definition at line 76 of file xml_io_base.cc.


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