blob: 9f7083c4cc879a02e337698040c35f8d8b13e3fb [file] [log] [blame]
Patrick Venture863b9242018-03-08 08:29:23 -08001#pragma once
2
3#include <string>
4
5#include "interfaces.hpp"
6#include "sysfs/util.hpp"
7
8
9/*
10 * A WriteInterface that is expecting a path that's sysfs, but really could be
11 * any filesystem path.
12 */
13class SysFsWritePercent : public WriteInterface
14{
15 public:
16 SysFsWritePercent(std::string& writepath, int64_t min, int64_t max)
17 : WriteInterface(min, max),
18 _writepath(FixupPath(writepath))
19 { }
20
21 void write(double value) override;
22
23 private:
24 std::string _writepath;
25};
26
27class SysFsWrite : public WriteInterface
28{
29 public:
30 SysFsWrite(std::string& writepath, int64_t min, int64_t max)
31 : WriteInterface(min, max),
32 _writepath(FixupPath(writepath))
33 { }
34
35 void write(double value) override;
36
37 private:
38 std::string _writepath;
39};