ARTS 2.5.0 (git: 9ee3ac6c)
xml_io.h File Reference

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

#include "arts.h"
#include "xml_io_base.h"
#include "xml_io_arts_types.h"

Go to the source code of this file.

Classes

class  ArtsXMLTag
 The ARTS XML tag class. More...
 

Functions

void xml_parse_from_stream (istream &, Vector &, bifstream *, ArtsXMLTag &, const Verbosity &verbosity)
 
void xml_parse_from_stream (istream &, ArrayOfString &, bifstream *, ArtsXMLTag &, const Verbosity &)
 
void xml_find_and_open_input_file (std::shared_ptr< istream > &ifs, const String &filename, const Verbosity &verbosity)
 Open plain or zipped xml file. More...
 
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, const Index &digits=0)
 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...
 
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...
 

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.

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 218 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,
const Index digits 
)

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
[in]digitsWidth for padding with zeros

Definition at line 234 of file xml_io.cc.

References out_basename.

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

◆ xml_find_and_open_input_file()

void xml_find_and_open_input_file ( std::shared_ptr< istream > &  ifs,
const String filename,
const Verbosity verbosity 
)

Open plain or zipped xml file.

Searches the include and data paths for the given filename.

Parameters
[out]ifsPointer to input file stream
[in]filenameInput filename
[in]verbosityVerbosity

Definition at line 154 of file xml_io.cc.

References CREATE_OUT2, find_xml_file(), and xml_open_input_file().

Referenced by ReadArrayOfARTSCAT(), and ReadARTSCAT().

◆ xml_parse_from_stream() [1/2]

void xml_parse_from_stream ( istream &  ,
ArrayOfString ,
bifstream ,
ArtsXMLTag ,
const Verbosity  
)

◆ xml_parse_from_stream() [2/2]

void xml_parse_from_stream ( istream &  ,
Vector ,
bifstream ,
ArtsXMLTag ,
const Verbosity verbosity 
)

Referenced by xml_read_from_stream().

◆ xml_read_from_file()

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

◆ xml_write_to_file()

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

References add_basedir(), CREATE_OUT2, make_filename_unique(), Hitran::type, and xml_write_to_file_base().

Referenced by DoitWriteIterationFields(), test_xml_io(), WriteBuiltinPartitionFunctionsXML(), WriteXML(), and ybatchMetProfilesClear().