ARTS  2.4.0(git:4fb77825)
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 }
FILE_TYPE_ASCII
@ FILE_TYPE_ASCII
Definition: xml_io.h:38
exceptions.h
The declarations of all the exception classes.
absorption.h
Declarations required for the calculation of absorption coefficients.
global_data::species_data
const Array< SpeciesRecord > species_data
Species Data.
Definition: partition_function_data.cc:42
Array
This can be used to make arrays out of anything.
Definition: array.h:108
xml_read_from_file
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
Definition: xml_io.cc:901
global_data.h
xml_write_to_file
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
matpackII.h
Header file for sparse matrices.
main
int main(int, char *[])
Definition: test_xml.cc:26
define_species_data
void define_species_data()
Definition: species_data.cc:158
ARTS::Group::Verbosity
Verbosity Verbosity
Definition: autoarts.h:114
arts.h
The global header file for ARTS.
xml_io.h
This file contains basic functions to handle XML data files.