ARTS 2.5.11 (git: 6827797f)
|
Go to the source code of this file.
Classes | |
class | XMLAttribute |
XML attribute class. More... | |
class | XMLTag |
The ARTS XML tag class. More... | |
Enumerations | |
enum | FileType : Index { 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 | xml_parse_error (const String &str_error) |
Throws XML parser runtime error. | |
void | xml_data_parse_error (XMLTag &tag, const String &str_error) |
Throws XML parser runtime error. | |
void | xml_set_stream_precision (ostream &os) |
void | parse_xml_tag_content_as_string (std::istream &is_xml, String &content) |
Get the content of an xml tag as a string. | |
void | xml_parse_from_stream (istream &, Vector &, bifstream *, XMLTag &, const Verbosity &verbosity) |
Parses Vector from XML input stream. | |
void | xml_parse_from_stream (istream &, ArrayOfString &, bifstream *, XMLTag &, const Verbosity &) |
Parse ArrayOfString from XML input stream. | |
FileType | string2filetype (const String &file_format) |
void | xml_read_header_from_stream (istream &is, FileType &ftype, NumericType &ntype, EndianType &etype, const Verbosity &verbosity) |
Reads XML header and root tag. | |
void | xml_read_footer_from_stream (istream &is, const Verbosity &verbosity) |
Reads closing root tag. | |
void | xml_write_header_to_stream (ostream &os, FileType ftype, const Verbosity &verbosity) |
Writes XML header and root tag. | |
void | xml_write_footer_to_stream (ostream &os, const Verbosity &verbosity) |
Write closing root tag. | |
void | xml_open_input_file (ifstream &ifs, const String &name, const Verbosity &verbosity) |
Open file for XML input. | |
void | xml_open_output_file (ofstream &file, const String &name) |
Open file for XML output. | |
template<typename T > | |
void | xml_read_from_file_base (const String &filename, T &type, const Verbosity &verbosity) |
Reads data from XML file. | |
template<typename T > | |
void | xml_write_to_file_base (const String &filename, const T &type, const FileType ftype, const Verbosity &verbosity) |
Write data to XML file. | |
enum EndianType |
Enumerator | |
---|---|
ENDIAN_TYPE_LITTLE | |
ENDIAN_TYPE_BIG |
Definition at line 32 of file xml_io_base.h.
enum FileType : Index |
Enumerator | |
---|---|
FILE_TYPE_ASCII | |
FILE_TYPE_ZIPPED_ASCII | |
FILE_TYPE_BINARY |
Definition at line 25 of file xml_io_base.h.
enum NumericType |
Enumerator | |
---|---|
NUMERIC_TYPE_FLOAT | |
NUMERIC_TYPE_DOUBLE |
Definition at line 31 of file xml_io_base.h.
void parse_xml_tag_content_as_string | ( | std::istream & | is_xml, |
String & | content | ||
) |
Get the content of an xml tag as a string.
Definition at line 706 of file xml_io_base.cc.
Referenced by xml_read_from_stream().
Definition at line 318 of file xml_io_base.cc.
References FILE_TYPE_ASCII, FILE_TYPE_BINARY, and FILE_TYPE_ZIPPED_ASCII.
Referenced by WriteBuiltinPartitionFunctionsXML(), and WriteXML().
Throws XML parser runtime error.
This is used quite often inside the data parsing routines so it's a function for itself.
tag | XMLTag |
str_error | Error description |
Definition at line 537 of file xml_io_base.cc.
References XMLTag::write_to_stream().
Open file for XML input.
This function opens an XML file for reading.
ifs | Input filestream |
name | Filename |
Definition at line 432 of file xml_io_base.cc.
References CREATE_OUT3.
Referenced by xml_find_and_open_input_file(), and xml_read_from_file_base().
void xml_open_output_file | ( | ofstream & | file, |
const String & | name | ||
) |
Open file for XML output.
This function opens an XML file for writing.
file | Output filestream |
name | Filename |
Definition at line 342 of file xml_io_base.cc.
Referenced by xml_write_to_file_base().
void xml_parse_error | ( | const String & | str_error | ) |
Throws XML parser runtime error.
This is used quite often inside the parsing routines so it's a function for itself.
str_error | Error description |
Definition at line 522 of file xml_io_base.cc.
Referenced by XMLTag::check_attribute(), XMLTag::check_name(), ArtsXMLTag::get_attribute_value(), XMLTag::get_attribute_value(), XMLTag::read_from_stream(), xml_read_from_stream(), and xml_read_header_from_stream().
void xml_parse_from_stream | ( | istream & | is_xml, |
ArrayOfString & | astring, | ||
bifstream * | pbifs, | ||
XMLTag & | tag, | ||
const Verbosity & | verbosity | ||
) |
Parse ArrayOfString from XML input stream.
is_xml | XML Input stream |
astring | ArrayOfString return value |
pbifs | Pointer to binary input stream. NULL in case of ASCII file. |
tag | XML tag object |
Definition at line 2771 of file xml_io_array_types.cc.
References XMLTag::check_attribute(), XMLTag::get_attribute_value(), and xml_read_from_stream().
Referenced by xml_read_from_stream().
void xml_parse_from_stream | ( | istream & | is_xml, |
Vector & | vector, | ||
bifstream * | pbifs, | ||
XMLTag & | tag, | ||
const Verbosity & | verbosity | ||
) |
Parses Vector from XML input stream.
is_xml | XML Input stream |
vector | Vector return value |
pbifs | Pointer to binary input stream. NULL in case of ASCII file. |
tag | XML tag object |
Definition at line 1077 of file xml_io_general_types.cc.
References XMLTag::get_attribute_value(), binistream::readDoubleArray(), and xml_data_parse_error().
Referenced by xml_read_from_stream().
void xml_read_footer_from_stream | ( | istream & | is, |
const Verbosity & | verbosity | ||
) |
Reads closing root tag.
Checks whether XML file ends correctly with </arts>.
is | Input stream |
Definition at line 638 of file xml_io_base.cc.
References XMLTag::check_name(), and XMLTag::read_from_stream().
Referenced by xml_read_from_file_base().
void xml_read_from_file_base | ( | 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 228 of file xml_io_base.h.
References CREATE_OUT2, FILE_TYPE_ASCII, my_basic_string< charT >::nelem(), xml_open_input_file(), xml_read_footer_from_stream(), xml_read_from_stream(), and xml_read_header_from_stream().
Referenced by xml_read_from_file().
void xml_read_header_from_stream | ( | istream & | is, |
FileType & | ftype, | ||
NumericType & | ntype, | ||
EndianType & | etype, | ||
const Verbosity & | verbosity | ||
) |
Reads XML header and root tag.
Check whether XML file has correct version tag and reads arts root tag information.
is | Input stream |
ftype | File type |
ntype | Numeric type |
etype | Endian type |
Definition at line 557 of file xml_io_base.cc.
References XMLTag::check_name(), ENDIAN_TYPE_BIG, ENDIAN_TYPE_LITTLE, FILE_TYPE_ASCII, FILE_TYPE_BINARY, XMLTag::get_attribute_value(), NUMERIC_TYPE_DOUBLE, NUMERIC_TYPE_FLOAT, XMLTag::read_from_stream(), and xml_parse_error().
Referenced by ReadArrayOfARTSCAT(), ReadARTSCAT(), and xml_read_from_file_base().
void xml_set_stream_precision | ( | ostream & | os | ) |
Definition at line 688 of file xml_io_base.cc.
Referenced by xml_write_to_stream().
void xml_write_footer_to_stream | ( | ostream & | os, |
const Verbosity & | verbosity | ||
) |
Write closing root tag.
os | Output stream |
Definition at line 679 of file xml_io_base.cc.
References XMLTag::set_name(), and XMLTag::write_to_stream().
Referenced by xml_write_to_file_base().
Writes XML header and root tag.
os | Output stream |
ftype | File type |
Definition at line 650 of file xml_io_base.cc.
References XMLTag::add_attribute(), FILE_TYPE_ASCII, FILE_TYPE_BINARY, FILE_TYPE_ZIPPED_ASCII, XMLTag::set_name(), and XMLTag::write_to_stream().
Referenced by xml_write_to_file_base().
void xml_write_to_file_base | ( | const String & | filename, |
const T & | type, | ||
const FileType | ftype, | ||
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 296 of file xml_io_base.h.
References CREATE_OUT2, FILE_TYPE_ASCII, FILE_TYPE_ZIPPED_ASCII, xml_open_output_file(), xml_write_footer_to_stream(), xml_write_header_to_stream(), and xml_write_to_stream().
Referenced by xml_write_to_file().