Implement file reader

This commit is contained in:
Marko Zivanovic
2015-09-06 00:35:19 +02:00
parent 865d65f400
commit c9eefc79f1
16 changed files with 235 additions and 41 deletions
+7 -7
View File
@@ -25,6 +25,8 @@ SOFTWARE.
#ifndef SEVERITY_H
#define SEVERITY_H
class Facility;
class Severity {
public:
@@ -52,18 +54,16 @@ public:
return _value == right._value;
}
friend std::ostream& operator<<(std::ostream& os, const Severity& obj) {
os << obj._value;
return os;
}
friend const uint8_t operator+(const Facility& f, const Severity& s);
uint8_t as_int() const {
return _value;
friend std::ostream& operator<<(std::ostream& os, const Severity& obj) {
os << std::to_string(obj._value);
return os;
}
private:
const std::map<std::string, uint8_t> _values{
const std::map<std::string, uint8_t> VALUES{
{"emergency", 0},
{"alert", 1},
{"critical", 2},