blob: 08aceca4adb8851213d6362b3a494838b1d43c18 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef __COMMON_H__
#define __COMMON_H__
#include <fstream>
#include <functional>
#include <filesystem>
#define APP_NAME "system-stats"
#define APP_MAJOR 3
#define APP_MINOR 0
#define VERSION_STRING(MAJOR, MINOR) #MAJOR "." #MINOR
#define APP_VERSION VERSION_STRING(APP_MAJOR, APP_MINOR)
using refstream = std::reference_wrapper<std::ostream>;
class LogFile {
private:
std::filesystem::path base;
std::string date_ = "";
std::ofstream stream;
const std::string date();
bool stdout = false;
public:
LogFile();
void change(refstream& fstr);
};
std::string dumpReport();
#endif /* __COMMON_H__ */
|