summaryrefslogtreecommitdiff
path: root/src/formatter/formatter.cc
blob: 6fedf8ce4ec7c3c628a39a269a6c0efe7b1d06ca (plain)
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
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: BSD-3-Clause

#include "formatter.h"

namespace formatter {

std::ostream& operator<<(std::ostream& os, Unit val) {
    switch (val) {
        case Unit::V:
            return os << "V";

        case Unit::A:
            return os << "A";

        case Unit::Wh:
            return os << "Wh";

        case Unit::VA:
            return os << "VA";

        case Unit::Hz:
            return os << "Hz";

        case Unit::Percentage:
            return os << "%";

        case Unit::Celsius:
            return os << "°C";

        default:
            break;
    };

    return os;
}


}