ARTS  2.3.1285(git:92a29ea9-dirty)
test_xml.cc
Go to the documentation of this file.
1 /* Copyright (C) 2003-2012 Oliver Lemke <olemke@core-dump.info>
2 
3  This program is free software; you can redistribute it and/or
4  modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation; either version 2 of the
6  License, or (at your option) any later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
16  USA. */
17 
18 #include <iostream>
19 #include "absorption.h"
20 #include "arts.h"
21 #include "exceptions.h"
22 #include "global_data.h"
23 #include "matpackII.h"
24 #include "xml_io.h"
25 
26 int main(int /*argc*/, char * /*argv*/[]) {
28 
30  try {
32  "sdata1.xml", species_data, FILE_TYPE_ASCII, 0, Verbosity());
33  cout << "Wrote species_data: " << endl;
34 
35  Array<SpeciesRecord> my_species_data;
36 
37  xml_read_from_file("sdata1.xml", my_species_data, Verbosity());
38  cout << "Read species_data: " << endl;
39 
41  "sdata2.xml", my_species_data, FILE_TYPE_ASCII, 0, Verbosity());
42  cout << "Wrote species_data: " << endl;
43  } catch (const std::runtime_error &e) {
44  cerr << e.what();
45  }
46 
47  return (0);
48 }
This file contains basic functions to handle XML data files.
const Array< SpeciesRecord > species_data
Species Data.
int main(int, char *[])
Definition: test_xml.cc:26
The global header file for ARTS.
Header file for sparse matrices.
The declarations of all the exception classes.
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
Definition: xml_io.cc:901
Declarations required for the calculation of absorption coefficients.
void define_species_data()
This can be used to make arrays out of anything.
Definition: array.h:40
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.
Definition: xml_io.cc:972