wmbusmeters/src/printer.h

54 wiersze
1.6 KiB
C
Czysty Zwykły widok Historia

2018-04-01 06:53:37 +00:00
/*
2020-09-08 12:55:01 +00:00
Copyright (C) 2017-2020 Fredrik Öhrström
2018-04-01 06:53:37 +00:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2017-09-02 21:26:57 +00:00
#include"cmdline.h"
#include"meters.h"
2019-06-20 12:28:52 +00:00
#include"wmbus.h"
2017-09-02 21:26:57 +00:00
using namespace std;
struct Printer {
Printer(bool json,
bool fields,
char separator,
bool meterfiles, string &meterfiles_dir,
bool use_logfile, string &logfile,
vector<string> shell_cmdlines,
2019-06-20 12:28:52 +00:00
bool overwrite,
2019-12-11 17:56:34 +00:00
MeterFileNaming naming,
MeterFileTimestamp timestamp);
2017-09-02 21:26:57 +00:00
void print(Telegram *t, Meter *meter, vector<string> *more_json, vector<string> *selected_fields, vector<string> *added_fields);
2017-09-02 21:26:57 +00:00
private:
bool json_, fields_;
bool use_meterfiles_;
string meterfiles_dir_;
bool use_logfile_;
string logfile_;
char separator_;
vector<string> shell_cmdlines_;
2019-02-24 16:31:32 +00:00
bool overwrite_;
2019-06-20 12:28:52 +00:00
MeterFileNaming naming_;
2019-12-11 17:56:34 +00:00
MeterFileTimestamp timestamp_;
void printShells(Meter *meter, vector<string> &envs);
2019-06-20 12:28:52 +00:00
void printFiles(Meter *meter, Telegram *t, string &human_readable, string &fields, string &json);
2017-09-02 21:26:57 +00:00
};