ARTS 2.5.11 (git: 6827797f)
|
This file contains basic functions to handle XML data files. More...
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. | |
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=0) |
Gives the default filename, with file index, for the XML formats. | |
template<typename T > | |
void | xml_read_from_file (const String &filename, T &type, const Verbosity &verbosity) |
Reads data from XML 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 file contains basic functions to handle XML data files.
Definition in file xml_io.h.
Gives the default filename for the XML formats.
The default name is only used if the filename is empty.
filename | filename |
varname | variable name |
Definition at line 183 of file xml_io.cc.
References out_basename.
Referenced by ReadXML(), and WriteXML().
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.
[out] | filename | filename |
[in] | file_index | Index appended to the filename |
[in] | varname | variable name |
[in] | digits | Width for padding with zeros |
Definition at line 199 of file xml_io.cc.
References out_basename.
Referenced by ReadXMLIndexed(), and WriteXMLIndexed().
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.
[out] | ifs | Pointer to input file stream |
[in] | filename | Input filename |
[in] | verbosity | Verbosity |
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().
void xml_parse_from_stream | ( | istream & | , |
ArrayOfString & | , | ||
bifstream * | , | ||
ArtsXMLTag & | , | ||
const Verbosity & | |||
) |
void xml_parse_from_stream | ( | istream & | , |
Vector & | , | ||
bifstream * | , | ||
ArtsXMLTag & | , | ||
const Verbosity & | verbosity | ||
) |
Referenced by xml_read_from_stream().
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.
filename | XML filename |
type | Generic return value |
Definition at line 134 of file xml_io.h.
References CREATE_OUT2, find_xml_file(), and xml_read_from_file_base().
Referenced by abs_cia_dataReadFromXML(), abs_cia_dataReadSpeciesSplitCatalog(), abs_lines_per_speciesReadSpeciesSplitCatalog(), abs_linesReadSpeciesSplitCatalog(), AtmRawRead(), AtmWithNLTERawRead(), collision_coefficientsFromSplitFiles(), DOAngularGridsSet(), MagRawRead(), ReadXML(), ReadXMLIndexed(), ScatElementsPndAndScatAdd(), ScatElementsToabs_speciesAdd(), ScatSpeciesPndAndScatAdd(), ScatSpeciesScatAndMetaRead(), WindRawRead(), ybatchMetProfiles(), ybatchMetProfilesClear(), and z_surfaceFromFileAndGrid().
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.
filename | XML filename |
type | Generic input value |
no_clobber | 0: Overwrite, 1: Use unique filename |
ftype | File type |
Definition at line 155 of file xml_io.h.
References add_basedir(), CREATE_OUT2, make_filename_unique(), and xml_write_to_file_base().
Referenced by DoitWriteIterationFields(), WriteBuiltinPartitionFunctionsXML(), WriteXML(), and ybatchMetProfilesClear().