ARTS 2.5.11 (git: 6827797f)
|
#include "xml_io_base.h"
#include "arts.h"
#include "bifstream.h"
#include "bofstream.h"
#include "file.h"
#include <iterator>
#include <string_view>
Go to the source code of this file.
Functions | |
FileType | string2filetype (const String &file_format) |
void | xml_open_output_file (ofstream &file, const String &name) |
Open file for XML output. | |
void | xml_open_input_file (ifstream &ifs, const String &name, const Verbosity &verbosity) |
Open file for XML input. | |
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_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_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 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_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_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().