ARTS  2.2.66
m_xml.h File Reference

Workspace methods and template functions for supergeneric XML IO. More...

#include "exceptions.h"
#include "xml_io.h"
#include "workspace_ng.h"
#include "agenda_class.h"
Include dependency graph for m_xml.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
void ReadXML (T &v, const String &v_name, const String &f, const String &f_name, const Verbosity &verbosity)
 WORKSPACE METHOD: ReadXML. More...
 
void ReadXML (Workspace &ws, Agenda &v, const String &v_name, const String &f, const String &f_name, const Verbosity &verbosity)
 
template<typename T >
void ReadXMLIndexed (T &v, const String &v_name, const Index &file_index, const String &f, const String &f_name, const Verbosity &verbosity)
 WORKSPACE METHOD: ReadXMLIndexed. More...
 
void ReadXMLIndexed (Workspace &ws, Agenda &v, const String &v_name, const String &f, const String &f_name, const Verbosity &verbosity)
 
template<typename T >
void WriteXML (const String &file_format, const T &v, const String &f, const Index &no_clobber, const String &v_name, const String &f_name, const String &no_clobber_name, const Verbosity &verbosity)
 WORKSPACE METHOD: WriteXML. More...
 
void WriteXML (Workspace &ws, const String &file_format, const Agenda &v, const String &f, const Index &no_clobber, const String &v_name, const String &f_name, const String &no_clobber_name, const Verbosity &verbosity)
 
template<typename T >
void WriteXMLIndexed (const String &file_format, const Index &file_index, const T &v, const String &f, const String &v_name, const String &f_name, const Verbosity &verbosity)
 WORKSPACE METHOD: WriteXMLIndexed. More...
 
void WriteXMLIndexed (Workspace &ws, const String &file_format, const Index &file_index, const Agenda &v, const String &f, const String &v_name, const String &f_name, const Verbosity &verbosity)
 

Detailed Description

Workspace methods and template functions for supergeneric XML IO.

Author
Stefan Buehler sbueh.nosp@m.ler@.nosp@m.ltu.s.nosp@m.e
Date
2002-06-18

Definition in file m_xml.h.

Function Documentation

◆ ReadXML() [1/2]

template<typename T >
void ReadXML ( T &  out,
const String out_wsvname,
const String filename,
const String filename_wsvname,
const Verbosity verbosity 
)

WORKSPACE METHOD: ReadXML.

Reads a workspace variable from an XML file.

This method can read variables of any group.

If the filename is omitted, the variable is read from <basename>.<variable_name>.xml. If the given filename does not exist, this method will also look for files with an added .xml, .xml.gz and .gz extension

Author
Oliver Lemke
Parameters
[out]outSupergeneric output
[in]out_wsvnameGeneric Output Name
[in]filenameGeneric Input (Default: "")
[in]filename_wsvnameGeneric Input Name

Definition at line 37 of file m_xml.h.

References _U_, filename_xml(), ReadXML(), and xml_read_from_file().

Referenced by ReadXML().

◆ ReadXML() [2/2]

void ReadXML ( Workspace ws,
Agenda v,
const String v_name,
const String f,
const String f_name,
const Verbosity verbosity 
)

Definition at line 31 of file m_xml.cc.

References ReadXML().

Referenced by main(), ReadXML(), ReadXML_sg_Agenda_g(), ReadXML_sg_ArrayOfArrayOfGriddedField1_g(), ReadXML_sg_ArrayOfArrayOfGriddedField2_g(), ReadXML_sg_ArrayOfArrayOfGriddedField3_g(), ReadXML_sg_ArrayOfArrayOfIndex_g(), ReadXML_sg_ArrayOfArrayOfLineMixingRecord_g(), ReadXML_sg_ArrayOfArrayOfLineRecord_g(), ReadXML_sg_ArrayOfArrayOfMatrix_g(), ReadXML_sg_ArrayOfArrayOfSpeciesTag_g(), ReadXML_sg_ArrayOfArrayOfTensor3_g(), ReadXML_sg_ArrayOfArrayOfTensor6_g(), ReadXML_sg_ArrayOfArrayOfVector_g(), ReadXML_sg_ArrayOfCIARecord_g(), ReadXML_sg_ArrayOfGriddedField1_g(), ReadXML_sg_ArrayOfGriddedField2_g(), ReadXML_sg_ArrayOfGriddedField3_g(), ReadXML_sg_ArrayOfGriddedField4_g(), ReadXML_sg_ArrayOfIndex_g(), ReadXML_sg_ArrayOfLineMixingRecord_g(), ReadXML_sg_ArrayOfLineRecord_g(), ReadXML_sg_ArrayOfLineshapeSpec_g(), ReadXML_sg_ArrayOfMatrix_g(), ReadXML_sg_ArrayOfRetrievalQuantity_g(), ReadXML_sg_ArrayOfScatteringMetaData_g(), ReadXML_sg_ArrayOfSingleScatteringData_g(), ReadXML_sg_ArrayOfSparse_g(), ReadXML_sg_ArrayOfString_g(), ReadXML_sg_ArrayOfTensor3_g(), ReadXML_sg_ArrayOfTensor4_g(), ReadXML_sg_ArrayOfTensor6_g(), ReadXML_sg_ArrayOfTensor7_g(), ReadXML_sg_ArrayOfVector_g(), ReadXML_sg_GasAbsLookup_g(), ReadXML_sg_GriddedField1_g(), ReadXML_sg_GriddedField2_g(), ReadXML_sg_GriddedField3_g(), ReadXML_sg_GriddedField4_g(), ReadXML_sg_GriddedField5_g(), ReadXML_sg_GriddedField6_g(), ReadXML_sg_GridPos_g(), ReadXML_sg_Index_g(), ReadXML_sg_Matrix_g(), ReadXML_sg_MCAntenna_g(), ReadXML_sg_Numeric_g(), ReadXML_sg_Ppath_g(), ReadXML_sg_ScatteringMetaData_g(), ReadXML_sg_SingleScatteringData_g(), ReadXML_sg_Sparse_g(), ReadXML_sg_SpeciesAuxData_g(), ReadXML_sg_String_g(), ReadXML_sg_Tensor3_g(), ReadXML_sg_Tensor4_g(), ReadXML_sg_Tensor5_g(), ReadXML_sg_Tensor6_g(), ReadXML_sg_Tensor7_g(), ReadXML_sg_Timer_g(), ReadXML_sg_Vector_g(), and ReadXML_sg_Verbosity_g().

◆ ReadXMLIndexed() [1/2]

template<typename T >
void ReadXMLIndexed ( T &  out,
const String out_wsvname,
const Index file_index,
const String filename,
const String filename_wsvname,
const Verbosity verbosity 
)

WORKSPACE METHOD: ReadXMLIndexed.

As ReadXML, but reads indexed file names.

The variable is read from a file with name: <br> <filename>.<file_index>.xml. where <file_index> is the value of file_index.

This means that filename shall here not include the .xml extension. Omitting filename works as for ReadXML.

Author
Oliver Lemke
Parameters
[out]outSupergeneric output
[in]out_wsvnameGeneric Output Name
[in]file_indexWS Input
[in]filenameGeneric Input (Default: "")
[in]filename_wsvnameGeneric Input Name

Definition at line 72 of file m_xml.h.

References _U_, filename_xml_with_index(), ReadXMLIndexed(), and xml_read_from_file().

Referenced by ReadXMLIndexed().

◆ ReadXMLIndexed() [2/2]

void ReadXMLIndexed ( Workspace ws,
Agenda v,
const String v_name,
const String f,
const String f_name,
const Verbosity verbosity 
)

◆ WriteXML() [1/2]

template<typename T >
void WriteXML ( const String output_file_format,
const T &  in,
const String filename,
const Index no_clobber,
const String in_wsvname,
const String filename_wsvname,
const String no_clobber_wsvname,
const Verbosity verbosity 
)

WORKSPACE METHOD: WriteXML.

Writes a workspace variable to an XML file.

This method can write variables of any group.

If the filename is omitted, the variable is written to <basename>.<variable_name>.xml. If no_clobber is set to 1, an increasing number will be appended to the filename if the file already exists.

Author
Oliver Lemke
Parameters
[in]output_file_formatWS Input
[in]inGeneric Input
[in]filenameGeneric Input (Default: "")
[in]no_clobberGeneric Input (Default: "0")
[in]in_wsvnameGeneric Input Name
[in]filename_wsvnameGeneric Input Name
[in]no_clobber_wsvnameGeneric Input Name

Definition at line 109 of file m_xml.h.

References _U_, FILE_TYPE_ASCII, FILE_TYPE_BINARY, FILE_TYPE_ZIPPED_ASCII, filename_xml(), WriteXML(), and xml_write_to_file().

Referenced by WriteXML(), and WriteXMLIndexed().

◆ WriteXML() [2/2]

void WriteXML ( Workspace ws,
const String file_format,
const Agenda v,
const String f,
const Index no_clobber,
const String v_name,
const String f_name,
const String no_clobber_name,
const Verbosity verbosity 
)

Definition at line 67 of file m_xml.cc.

References WriteXML().

Referenced by abs_lines_per_speciesWriteToSplitArtscat(), main(), ppathWriteXMLPartial(), WriteXML(), WriteXML_sg_Agenda_g(), WriteXML_sg_ArrayOfArrayOfGriddedField1_g(), WriteXML_sg_ArrayOfArrayOfGriddedField2_g(), WriteXML_sg_ArrayOfArrayOfGriddedField3_g(), WriteXML_sg_ArrayOfArrayOfIndex_g(), WriteXML_sg_ArrayOfArrayOfLineMixingRecord_g(), WriteXML_sg_ArrayOfArrayOfLineRecord_g(), WriteXML_sg_ArrayOfArrayOfMatrix_g(), WriteXML_sg_ArrayOfArrayOfSpeciesTag_g(), WriteXML_sg_ArrayOfArrayOfTensor3_g(), WriteXML_sg_ArrayOfArrayOfTensor6_g(), WriteXML_sg_ArrayOfArrayOfVector_g(), WriteXML_sg_ArrayOfCIARecord_g(), WriteXML_sg_ArrayOfGriddedField1_g(), WriteXML_sg_ArrayOfGriddedField2_g(), WriteXML_sg_ArrayOfGriddedField3_g(), WriteXML_sg_ArrayOfGriddedField4_g(), WriteXML_sg_ArrayOfIndex_g(), WriteXML_sg_ArrayOfLineMixingRecord_g(), WriteXML_sg_ArrayOfLineRecord_g(), WriteXML_sg_ArrayOfLineshapeSpec_g(), WriteXML_sg_ArrayOfMatrix_g(), WriteXML_sg_ArrayOfRetrievalQuantity_g(), WriteXML_sg_ArrayOfScatteringMetaData_g(), WriteXML_sg_ArrayOfSingleScatteringData_g(), WriteXML_sg_ArrayOfSparse_g(), WriteXML_sg_ArrayOfString_g(), WriteXML_sg_ArrayOfTensor3_g(), WriteXML_sg_ArrayOfTensor4_g(), WriteXML_sg_ArrayOfTensor6_g(), WriteXML_sg_ArrayOfTensor7_g(), WriteXML_sg_ArrayOfVector_g(), WriteXML_sg_GasAbsLookup_g(), WriteXML_sg_GriddedField1_g(), WriteXML_sg_GriddedField2_g(), WriteXML_sg_GriddedField3_g(), WriteXML_sg_GriddedField4_g(), WriteXML_sg_GriddedField5_g(), WriteXML_sg_GriddedField6_g(), WriteXML_sg_GridPos_g(), WriteXML_sg_Index_g(), WriteXML_sg_Matrix_g(), WriteXML_sg_MCAntenna_g(), WriteXML_sg_Numeric_g(), WriteXML_sg_Ppath_g(), WriteXML_sg_ScatteringMetaData_g(), WriteXML_sg_SingleScatteringData_g(), WriteXML_sg_Sparse_g(), WriteXML_sg_SpeciesAuxData_g(), WriteXML_sg_String_g(), WriteXML_sg_Tensor3_g(), WriteXML_sg_Tensor4_g(), WriteXML_sg_Tensor5_g(), WriteXML_sg_Tensor6_g(), WriteXML_sg_Tensor7_g(), WriteXML_sg_Timer_g(), WriteXML_sg_Vector_g(), and WriteXML_sg_Verbosity_g().

◆ WriteXMLIndexed() [1/2]

template<typename T >
void WriteXMLIndexed ( const String output_file_format,
const Index file_index,
const T &  in,
const String filename,
const String in_wsvname,
const String filename_wsvname,
const Verbosity verbosity 
)

WORKSPACE METHOD: WriteXMLIndexed.

As WriteXML, but creates indexed file names.

The variable is written to a file with name: <br> <filename>.<file_index>.xml. where <file_index> is the value of file_index.

This means that filename shall here not include the .xml extension. Omitting filename works as for WriteXML.

Author
Patrick Eriksson
Parameters
[in]output_file_formatWS Input
[in]file_indexWS Input
[in]inGeneric Input
[in]filenameGeneric Input (Default: "")
[in]in_wsvnameGeneric Input Name
[in]filename_wsvnameGeneric Input Name

Definition at line 177 of file m_xml.h.

References _U_, filename_xml_with_index(), WriteXML(), and WriteXMLIndexed().

Referenced by WriteXMLIndexed().

◆ WriteXMLIndexed() [2/2]

void WriteXMLIndexed ( Workspace ws,
const String file_format,
const Index file_index,
const Agenda v,
const String f,
const String v_name,
const String f_name,
const Verbosity verbosity 
)

Definition at line 87 of file m_xml.cc.

References WriteXMLIndexed().

Referenced by WriteXMLIndexed(), WriteXMLIndexed_sg_Agenda_g(), WriteXMLIndexed_sg_ArrayOfArrayOfGriddedField1_g(), WriteXMLIndexed_sg_ArrayOfArrayOfGriddedField2_g(), WriteXMLIndexed_sg_ArrayOfArrayOfGriddedField3_g(), WriteXMLIndexed_sg_ArrayOfArrayOfIndex_g(), WriteXMLIndexed_sg_ArrayOfArrayOfLineMixingRecord_g(), WriteXMLIndexed_sg_ArrayOfArrayOfLineRecord_g(), WriteXMLIndexed_sg_ArrayOfArrayOfMatrix_g(), WriteXMLIndexed_sg_ArrayOfArrayOfSpeciesTag_g(), WriteXMLIndexed_sg_ArrayOfArrayOfTensor3_g(), WriteXMLIndexed_sg_ArrayOfArrayOfTensor6_g(), WriteXMLIndexed_sg_ArrayOfArrayOfVector_g(), WriteXMLIndexed_sg_ArrayOfCIARecord_g(), WriteXMLIndexed_sg_ArrayOfGriddedField1_g(), WriteXMLIndexed_sg_ArrayOfGriddedField2_g(), WriteXMLIndexed_sg_ArrayOfGriddedField3_g(), WriteXMLIndexed_sg_ArrayOfGriddedField4_g(), WriteXMLIndexed_sg_ArrayOfIndex_g(), WriteXMLIndexed_sg_ArrayOfLineMixingRecord_g(), WriteXMLIndexed_sg_ArrayOfLineRecord_g(), WriteXMLIndexed_sg_ArrayOfLineshapeSpec_g(), WriteXMLIndexed_sg_ArrayOfMatrix_g(), WriteXMLIndexed_sg_ArrayOfRetrievalQuantity_g(), WriteXMLIndexed_sg_ArrayOfScatteringMetaData_g(), WriteXMLIndexed_sg_ArrayOfSingleScatteringData_g(), WriteXMLIndexed_sg_ArrayOfSparse_g(), WriteXMLIndexed_sg_ArrayOfString_g(), WriteXMLIndexed_sg_ArrayOfTensor3_g(), WriteXMLIndexed_sg_ArrayOfTensor4_g(), WriteXMLIndexed_sg_ArrayOfTensor6_g(), WriteXMLIndexed_sg_ArrayOfTensor7_g(), WriteXMLIndexed_sg_ArrayOfVector_g(), WriteXMLIndexed_sg_GasAbsLookup_g(), WriteXMLIndexed_sg_GriddedField1_g(), WriteXMLIndexed_sg_GriddedField2_g(), WriteXMLIndexed_sg_GriddedField3_g(), WriteXMLIndexed_sg_GriddedField4_g(), WriteXMLIndexed_sg_GriddedField5_g(), WriteXMLIndexed_sg_GriddedField6_g(), WriteXMLIndexed_sg_GridPos_g(), WriteXMLIndexed_sg_Index_g(), WriteXMLIndexed_sg_Matrix_g(), WriteXMLIndexed_sg_MCAntenna_g(), WriteXMLIndexed_sg_Numeric_g(), WriteXMLIndexed_sg_Ppath_g(), WriteXMLIndexed_sg_ScatteringMetaData_g(), WriteXMLIndexed_sg_SingleScatteringData_g(), WriteXMLIndexed_sg_Sparse_g(), WriteXMLIndexed_sg_SpeciesAuxData_g(), WriteXMLIndexed_sg_String_g(), WriteXMLIndexed_sg_Tensor3_g(), WriteXMLIndexed_sg_Tensor4_g(), WriteXMLIndexed_sg_Tensor5_g(), WriteXMLIndexed_sg_Tensor6_g(), WriteXMLIndexed_sg_Tensor7_g(), WriteXMLIndexed_sg_Timer_g(), WriteXMLIndexed_sg_Vector_g(), and WriteXMLIndexed_sg_Verbosity_g().