ARTS 2.5.11 (git: 6827797f)
xml_io.cc File Reference

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

#include "xml_io.h"
#include "arts.h"
#include "bifstream.h"
#include "bofstream.h"
#include "file.h"
#include "parameters.h"

Go to the source code of this file.

Functions

void xml_find_and_open_input_file (std::shared_ptr< istream > &ifs, const String &filename, const Verbosity &verbosity)
 Open plain or zipped xml file.
 
void xml_data_parse_error (ArtsXMLTag &tag, String str_error)
 Throws XML parser runtime error.
 
void filename_xml (String &filename, const String &varname)
 Gives the default filename for the XML formats.
 
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.
 

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.cc.

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 183 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 199 of file xml_io.cc.

References out_basename.

Referenced by ReadXMLIndexed(), and WriteXMLIndexed().

◆ xml_data_parse_error()

void xml_data_parse_error ( ArtsXMLTag tag,
String  str_error 
)

Throws XML parser runtime error.

This is used quite often inside the data parsing routines so it's a function for itself.

Parameters
tagArtsXMLTag
str_errorError description

Definition at line 162 of file xml_io.cc.

References XMLTag::write_to_stream().

Referenced by xml_parse_from_stream(), and xml_read_from_stream().

◆ 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 119 of file xml_io.cc.

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

Referenced by ReadArrayOfARTSCAT(), and ReadARTSCAT().