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