ARTS  2.0.49
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"

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 WriteXML (const String &file_format, const T &v, const String &f, const String &v_name, const String &f_name, const Verbosity &verbosity)
 WORKSPACE METHOD: WriteXML. More...
 
void WriteXML (Workspace &ws, const String &file_format, const Agenda &v, const String &f, const String &v_name, const String &f_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)
 
void output_file_formatSetAscii (String &file_format, const Verbosity &)
 WORKSPACE METHOD: output_file_formatSetAscii. More...
 
void output_file_formatSetZippedAscii (String &file_format, const Verbosity &)
 WORKSPACE METHOD: output_file_formatSetZippedAscii. More...
 
void output_file_formatSetBinary (String &file_format, const Verbosity &)
 WORKSPACE METHOD: output_file_formatSetBinary. More...
 

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

◆ output_file_formatSetAscii()

void output_file_formatSetAscii ( String output_file_format,
const Verbosity verbosity 
)

WORKSPACE METHOD: output_file_formatSetAscii.

Sets the output file format to ASCII.

Author
Oliver Lemke
Parameters
[out]output_file_formatWS Output

Definition at line 168 of file m_xml.h.

Referenced by output_file_formatSetAscii_g().

◆ output_file_formatSetBinary()

void output_file_formatSetBinary ( String output_file_format,
const Verbosity verbosity 
)

WORKSPACE METHOD: output_file_formatSetBinary.

Sets the output file format to binary.

Author
Oliver Lemke
Parameters
[out]output_file_formatWS Output

Definition at line 188 of file m_xml.h.

Referenced by output_file_formatSetBinary_g().

◆ output_file_formatSetZippedAscii()

void output_file_formatSetZippedAscii ( String output_file_format,
const Verbosity verbosity 
)

WORKSPACE METHOD: output_file_formatSetZippedAscii.

Sets the output file format to zipped ASCII.

Author
Oliver Lemke
Parameters
[out]output_file_formatWS Output

Definition at line 178 of file m_xml.h.

Referenced by output_file_formatSetZippedAscii_g().

◆ ReadXML() [1/2]

template<typename T >
void ReadXML ( T &  v,
const String v_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.

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

Definition at line 37 of file m_xml.h.

References filename_xml(), and xml_read_from_file().

Referenced by ReadXML(), ReadXML_sg_Agenda_g(), ReadXML_sg_ArrayOfArrayOfGriddedField1_g(), ReadXML_sg_ArrayOfArrayOfGriddedField3_g(), ReadXML_sg_ArrayOfArrayOfIndex_g(), ReadXML_sg_ArrayOfArrayOfLineRecord_g(), ReadXML_sg_ArrayOfArrayOfMatrix_g(), ReadXML_sg_ArrayOfArrayOfSpeciesTag_g(), ReadXML_sg_ArrayOfArrayOfTensor3_g(), ReadXML_sg_ArrayOfArrayOfTensor6_g(), ReadXML_sg_ArrayOfGriddedField1_g(), ReadXML_sg_ArrayOfGriddedField2_g(), ReadXML_sg_ArrayOfGriddedField3_g(), ReadXML_sg_ArrayOfGriddedField4_g(), ReadXML_sg_ArrayOfIndex_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_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_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().

◆ 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 58 of file m_xml.h.

References ReadXML().

◆ WriteXML() [1/2]

template<typename T >
void WriteXML ( const String output_file_format,
const T &  v,
const String filename,
const String v_wsvname,
const String filename_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.

Author
Oliver Lemke
Parameters
[in]output_file_formatWS Input
[in]vGeneric Input
[in]filenameGeneric Input (Default: "")
[in]v_wsvnameGeneric Input Name
[in]filename_wsvnameGeneric Input Name

Definition at line 75 of file m_xml.h.

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

Referenced by WriteXML(), WriteXML_sg_Agenda_g(), WriteXML_sg_ArrayOfArrayOfGriddedField1_g(), WriteXML_sg_ArrayOfArrayOfGriddedField3_g(), WriteXML_sg_ArrayOfArrayOfIndex_g(), WriteXML_sg_ArrayOfArrayOfLineRecord_g(), WriteXML_sg_ArrayOfArrayOfMatrix_g(), WriteXML_sg_ArrayOfArrayOfSpeciesTag_g(), WriteXML_sg_ArrayOfArrayOfTensor3_g(), WriteXML_sg_ArrayOfArrayOfTensor6_g(), WriteXML_sg_ArrayOfGriddedField1_g(), WriteXML_sg_ArrayOfGriddedField2_g(), WriteXML_sg_ArrayOfGriddedField3_g(), WriteXML_sg_ArrayOfGriddedField4_g(), WriteXML_sg_ArrayOfIndex_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_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_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(), WriteXML_sg_Verbosity_g(), and WriteXMLIndexed().

◆ WriteXML() [2/2]

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

Definition at line 111 of file m_xml.h.

References WriteXML().

◆ WriteXMLIndexed() [1/2]

template<typename T >
void WriteXMLIndexed ( const String output_file_format,
const Index file_index,
const T &  wsv,
const String filename,
const String wsv_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]wsvGeneric Input
[in]filenameGeneric Input (Default: "")
[in]wsv_wsvnameGeneric Input Name
[in]filename_wsvnameGeneric Input Name

Definition at line 128 of file m_xml.h.

References filename_xml_with_index(), and WriteXML().

Referenced by WriteXMLIndexed(), WriteXMLIndexed_sg_Agenda_g(), WriteXMLIndexed_sg_ArrayOfArrayOfGriddedField1_g(), WriteXMLIndexed_sg_ArrayOfArrayOfGriddedField3_g(), WriteXMLIndexed_sg_ArrayOfArrayOfIndex_g(), WriteXMLIndexed_sg_ArrayOfArrayOfLineRecord_g(), WriteXMLIndexed_sg_ArrayOfArrayOfMatrix_g(), WriteXMLIndexed_sg_ArrayOfArrayOfSpeciesTag_g(), WriteXMLIndexed_sg_ArrayOfArrayOfTensor3_g(), WriteXMLIndexed_sg_ArrayOfArrayOfTensor6_g(), WriteXMLIndexed_sg_ArrayOfGriddedField1_g(), WriteXMLIndexed_sg_ArrayOfGriddedField2_g(), WriteXMLIndexed_sg_ArrayOfGriddedField3_g(), WriteXMLIndexed_sg_ArrayOfGriddedField4_g(), WriteXMLIndexed_sg_ArrayOfIndex_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_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_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().

◆ 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 150 of file m_xml.h.

References WriteXMLIndexed().