ARTS 2.5.4 (git: 31ce4f0e)
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. More...
 
void add_attribute (const String &aname, const ArrayOfSpecies &value, const bool self, const bool bath)
 Adds value of attribute. More...
 
void get_attribute_value (const String &aname, SpeciesTag &value)
 Returns value of attribute as type SpeciesTag. More...
 
void get_attribute_value (const String &aname, ArrayOfSpecies &value, bool &self, bool &bath)
 Returns value of attribute as type ArrayOfSpeciesTag. More...
 
void get_attribute_value (const String &aname, std::vector< QuantumNumberType > &value)
 Returns value of attribute as type ArrayOfSpeciesTag. More...
 
void add_attribute (const String &aname, String value)
 
void add_attribute (const String &aname, const Index &value)
 Adds an Index attribute to tag. More...
 
void add_attribute (const String &aname, const Numeric &value)
 Adds value of attribute as type Numeric to tag. More...
 
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. More...
 
void get_attribute_value (const String &aname, Numeric &value)
 Returns value of attribute as type Numeric. More...
 
- Public Member Functions inherited from XMLTag
 XMLTag (const Verbosity &rverbosity)
 
Stringget_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, String value)
 
void add_attribute (const String &aname, const Index &value)
 Adds an Index attribute to tag. More...
 
void add_attribute (const String &aname, const Numeric &value)
 Adds value of attribute as type Numeric 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)
 
void get_attribute_value (const String &aname, Index &value)
 Returns value of attribute as type Index. More...
 
void get_attribute_value (const String &aname, Numeric &value)
 Returns value of attribute as type Numeric. More...
 
void read_from_stream (istream &is)
 Reads next XML tag. More...
 
void write_to_stream (ostream &os)
 Write XML tag. More...
 
bool has_attribute (const String &aname) const
 Returns if the attribute exists or not. More...
 

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 45 of file xml_io.h.

Constructor & Destructor Documentation

◆ ArtsXMLTag()

ArtsXMLTag::ArtsXMLTag ( const Verbosity rverbosity)
inline

Definition at line 47 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 56 of file xml_io.cc.

References add_attribute(), Array< base >::nelem(), 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 82 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 89 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 42 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 80 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 77 of file xml_io.cc.

References ARTS_USER_ERROR_IF, get_attribute_value(), good_enum(), XMLTag::name, my_basic_string< charT >::nelem(), 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 95 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 106 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 70 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 114 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 93 of file xml_io_base.cc.


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