48 for(
size_t i=0; i<value.size()-1; i++)
62 v <<
' ' << Species::toShortName(value[i]);
83 istringstream strstr(
"");
86 if (attribute_value.
nelem() == 0)
return;
88 strstr.str(attribute_value);
91 while(not strstr.eof()) {
99 value.push_back(Species::Species::FINAL);
103 value.push_back(Species::Species::Bath);
107 Species::Species x = Species::fromShortName(val);
118 istringstream strstr(
"");
121 if (attribute_value.
nelem() == 0)
return;
123 strstr.str(attribute_value);
126 while(not strstr.eof()) {
132 value.push_back(Quantum::Number::toType(val));
141 String xml_file = filename;
143 out2 <<
" Reading " << xml_file <<
'\n';
146 if (xml_file.substr(xml_file.length() - 3, 3) ==
".gz")
149 ifs = std::shared_ptr<istream>(
new igzstream());
151 *(
static_cast<igzstream*
>(ifs.get())), xml_file, verbosity);
156 "This arts version was compiled without zlib support.\n"
157 "Thus zipped xml files cannot be read.");
161 ifs = shared_ptr<istream>(
new ifstream());
163 *(
static_cast<ifstream*
>(ifs.get())), xml_file, verbosity);
181 os <<
"XML data parse error: Error reading ";
183 os << str_error <<
"\n"
184 <<
"Check syntax of XML file. A possible cause is that the file "
185 <<
"contains NaN or Inf values.\n";
186 throw runtime_error(os.str());
201 if (
"" == filename) {
217 const Index& file_index,
219 const Index& digits) {
220 if (
"" == filename) {
223 os <<
out_basename <<
"." << varname <<
"." << std::setw((
int)digits)
224 << std::setfill(
'0') << file_index <<
".xml";
228 os << filename <<
"." << std::setw((
int)digits) << std::setfill(
'0')
229 << file_index <<
".xml";
The global header file for ARTS.
This file contains the class declaration of bifstream.
This file contains the class declaration of bofstream.
Index nelem() const ARTS_NOEXCEPT
void add_attribute(const String &aname, const std::vector< QuantumNumberType > &value)
Adds value of attribute as type std::vector<QuantumNumberType> to tag.
void get_attribute_value(const String &aname, SpeciesTag &value)
Returns value of attribute as type SpeciesTag.
void write_to_stream(ostream &os)
Write XML tag.
#define ARTS_USER_ERROR_IF(condition,...)
constexpr bool good_enum(EnumType x) noexcept
Checks if the enum number is good.
void find_xml_file(String &filename, const Verbosity &verbosity)
Find an xml file.
This file contains basic functions to handle ASCII files.
INDEX Index
The type to use for all integer numbers and indices.
String out_basename
The basename for the report file and for all other output files.
constexpr std::string_view bath_broadening
Name for bath broadening in printing and reading user input.
constexpr std::string_view self_broadening
Name for self broadening in printing and reading user input.
This file contains header information for the dealing with command line parameters.
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.
void xml_data_parse_error(ArtsXMLTag &tag, String str_error)
Throws XML parser runtime error.
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.
This file contains basic functions to handle XML data files.
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.