libdballe  5.18
conversion.h
1 /*
2  * Copyright (C) 2005--2011 ARPA-SIM <urpsim@smr.arpa.emr.it>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Author: Enrico Zini <enrico@enricozini.com>
18  */
19 
20 #ifndef CONVERSION_H
21 #define CONVERSION_H
22 
23 #if 0
24 #include <dballe/core/file.h>
25 #include <dballe/core/rawmsg.h>
26 #include <dballe/msg/msgs.h>
27 #include <dballe/bufrex/msg.h>
28 #endif
29 #include <dballe/cmdline/processor.h>
30 
31 namespace wreport {
32 struct Bulletin;
33 }
34 
35 namespace dballe {
36 struct File;
37 
38 namespace msg {
39 struct Importer;
40 struct Exporter;
41 }
42 
43 namespace cmdline {
44 
45 struct Converter : public Action
46 {
47  File* file;
48  const char* dest_rep_memo;
49  const char* dest_template;
50  bool recompute_categories;
51 
52  msg::Exporter* exporter;
53  Converter() : file(0), dest_rep_memo(0), dest_template(0), recompute_categories(false), exporter(0) {}
54  ~Converter();
55 
56  virtual void operator()(const cmdline::Item& item);
57 
58  void process_bufrex_msg(const wreport::Bulletin& msg);
59  void process_dba_msg(const Msgs& msgs);
60  void process_dba_msg_from_bulletin(const wreport::Bulletin& bulletin, const Msgs& msgs);
61 };
62 
63 }
64 }
65 
66 #endif