libdballe 5.10
conversion.h
00001 /*
00002  * Copyright (C) 2005--2011  ARPA-SIM <urpsim@smr.arpa.emr.it>
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00016  *
00017  * Author: Enrico Zini <enrico@enricozini.com>
00018  */
00019 
00020 #ifndef CONVERSION_H
00021 #define CONVERSION_H
00022 
00023 #if 0
00024 #include <dballe/core/file.h>
00025 #include <dballe/core/rawmsg.h>
00026 #include <dballe/msg/msgs.h>
00027 #include <dballe/bufrex/msg.h>
00028 #endif
00029 #include <dballe/cmdline/processor.h>
00030 
00031 namespace wreport {
00032 struct Bulletin;
00033 }
00034 
00035 namespace dballe {
00036 struct File;
00037 
00038 namespace msg {
00039 struct Importer;
00040 struct Exporter;
00041 }
00042 
00043 namespace cmdline {
00044 
00045 struct Converter : public Action
00046 {
00047     File* file;
00048     const char* dest_rep_memo;
00049     const char* dest_template;
00050 
00051     msg::Exporter* exporter;
00052     Converter() : file(0), dest_rep_memo(0), dest_template(0), exporter(0) {}
00053     ~Converter();
00054 
00055     virtual void operator()(const cmdline::Item& item);
00056 
00057     void process_bufrex_msg(const wreport::Bulletin& msg);
00058     void process_dba_msg(const Msgs& msgs);
00059     void process_dba_msg_from_bulletin(const wreport::Bulletin& bulletin, const Msgs& msgs);
00060 };
00061 
00062 }
00063 }
00064 
00065 #endif