ARTS  2.2.66
xml_io.h File Reference

This file contains basic functions to handle XML data files. More...

#include "mystring.h"
#include "absorption.h"

Go to the source code of this file.

Enumerations

enum  FileType { FILE_TYPE_ASCII = 0, FILE_TYPE_ZIPPED_ASCII = 1, FILE_TYPE_BINARY = 2 }
 
enum  NumericType { NUMERIC_TYPE_FLOAT, NUMERIC_TYPE_DOUBLE }
 
enum  EndianType { ENDIAN_TYPE_LITTLE, ENDIAN_TYPE_BIG }
 

Functions

void filename_xml (String &filename, const String &varname)
 Gives the default filename for the XML formats. More...
 
void filename_xml_with_index (String &filename, const Index &file_index, const String &varname)
 Gives the default filename, with file index, for the XML formats. More...
 
template<typename T >
void xml_read_from_file (const String &filename, T &type, const Verbosity &verbosity)
 Reads data from XML file. More...
 
void xml_read_arts_catalogue_from_file (const String &filename, ArrayOfLineRecord &type, const Numeric &fmin, const Numeric &fmax, const Verbosity &verbosity)
 
template<typename T >
void xml_write_to_file (const String &filename, const T &type, const FileType ftype, const Index no_clobber, const Verbosity &verbosity)
 Write data to XML file. More...
 
template<typename T >
void xml_write_to_file (const String &, const T &, FileType, const Verbosity &)
 

Detailed Description

This file contains basic functions to handle XML data files.

Author
Oliver Lemke olemk.nosp@m.e@co.nosp@m.re-du.nosp@m.mp.i.nosp@m.nfo
Date
2002-05-10

Definition in file xml_io.h.

Enumeration Type Documentation

◆ EndianType

enum EndianType
Enumerator
ENDIAN_TYPE_LITTLE 
ENDIAN_TYPE_BIG 

Definition at line 45 of file xml_io.h.

◆ FileType

enum FileType
Enumerator
FILE_TYPE_ASCII 
FILE_TYPE_ZIPPED_ASCII 
FILE_TYPE_BINARY 

Definition at line 38 of file xml_io.h.

◆ NumericType

Enumerator
NUMERIC_TYPE_FLOAT 
NUMERIC_TYPE_DOUBLE 

Definition at line 44 of file xml_io.h.

Function Documentation

◆ filename_xml()

void filename_xml ( String filename,
const String varname 
)

Gives the default filename for the XML formats.

The default name is only used if the filename is empty.

Parameters
filenamefilename
varnamevariable name

Definition at line 350 of file xml_io.cc.

References out_basename.

Referenced by ReadXML(), and WriteXML().

◆ filename_xml_with_index()

void filename_xml_with_index ( String filename,
const Index file_index,
const String varname 
)

Gives the default filename, with file index, for the XML formats.

The default name is only used if the filename is empty.

Parameters
[out]filenamefilename
[in]file_indexIndex appended to the filename
[in]varnamevariable name

Definition at line 370 of file xml_io.cc.

References out_basename.

Referenced by ppathWriteXMLPartial(), ReadXMLIndexed(), and WriteXMLIndexed().

◆ xml_read_arts_catalogue_from_file()

void xml_read_arts_catalogue_from_file ( const String filename,
ArrayOfLineRecord type,
const Numeric fmin,
const Numeric fmax,
const Verbosity verbosity 
)

◆ xml_read_from_file()

template<typename T >
void xml_read_from_file ( const String filename,
T &  type,
const Verbosity verbosity 
)

Reads data from XML file.

This is a generic functions that is used to read the XML header and footer info and calls the overloaded functions to read the data.

Parameters
filenameXML filename
typeGeneric return value

Definition at line 831 of file xml_io.cc.

References CREATE_OUT2, FILE_TYPE_ASCII, find_xml_file(), xml_open_input_file(), xml_read_footer_from_stream(), xml_read_from_stream(), and xml_read_header_from_stream().

Referenced by abs_cia_dataReadFromXML(), AtmRawRead(), DoitAngularGridsSet(), magfield_nk(), main(), ParticleType2abs_speciesAdd(), ParticleTypeAdd(), ParticleTypeAddAll(), ReadXML(), ReadXMLIndexed(), ScatteringParticleTypeAndMetaRead(), test45(), test46(), ybatchMetProfiles(), and ybatchMetProfilesClear().

◆ xml_write_to_file() [1/2]

template<typename T >
void xml_write_to_file ( const String ,
const T &  ,
FileType  ,
const Verbosity  
)

◆ xml_write_to_file() [2/2]

template<typename T >
void xml_write_to_file ( const String filename,
const T &  type,
const FileType  ftype,
const Index  no_clobber,
const Verbosity verbosity 
)

Write data to XML file.

This is a generic functions that is used to write the XML header and footer info and calls the overloaded functions to write the data.

Parameters
filenameXML filename
typeGeneric input value
no_clobber0: Overwrite, 1: Use unique filename
ftypeFile type

Definition at line 982 of file xml_io.cc.

References add_basedir(), CREATE_OUT2, FILE_TYPE_ASCII, FILE_TYPE_ZIPPED_ASCII, make_filename_unique(), xml_open_output_file(), xml_write_footer_to_stream(), xml_write_header_to_stream(), and xml_write_to_stream().

Referenced by DoitWriteIterationFields(), main(), test45(), test46(), WriteXML(), and ybatchMetProfilesClear().