31 for(
size_t i=0; i<value.size()-1; i++)
44 for(Index i=Index(self); i<value.
nelem()-Index(bath); i++)
45 v <<
' ' << Species::toShortName(value[i]);
66 istringstream strstr(
"");
69 if (attribute_value.
nelem() == 0)
return;
71 strstr.str(attribute_value);
74 while(not strstr.eof()) {
82 value.push_back(Species::Species::FINAL);
86 value.push_back(Species::Species::Bath);
90 Species::Species x = Species::fromShortName(val);
101 istringstream strstr(
"");
104 if (attribute_value.
nelem() == 0)
return;
106 strstr.str(attribute_value);
109 while(not strstr.eof()) {
115 value.push_back(Quantum::Number::toType(val));
124 String xml_file = filename;
126 out2 <<
" Reading " << xml_file <<
'\n';
129 if (xml_file.substr(xml_file.length() - 3, 3) ==
".gz")
132 ifs = std::shared_ptr<istream>(
new igzstream());
134 *(
static_cast<igzstream*
>(ifs.get())), xml_file, verbosity);
139 "This arts version was compiled without zlib support.\n"
140 "Thus zipped xml files cannot be read.");
144 ifs = shared_ptr<istream>(
new ifstream());
146 *(
static_cast<ifstream*
>(ifs.get())), xml_file, verbosity);
164 os <<
"XML data parse error: Error reading ";
166 os << str_error <<
"\n"
167 <<
"Check syntax of XML file. A possible cause is that the file "
168 <<
"contains NaN or Inf values.\n";
169 throw runtime_error(os.str());
184 if (
"" == filename) {
200 const Index& file_index,
202 const Index& digits) {
203 if (
"" == filename) {
206 os <<
out_basename <<
"." << varname <<
"." << std::setw((
int)digits)
207 << std::setfill(
'0') << file_index <<
".xml";
211 os << filename <<
"." << std::setw((
int)digits) << std::setfill(
'0')
212 << 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.
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.