blob: 4cd2a782a62e0d013d0cfe9440bfe3a70be206dc [file] [log] [blame]
Patrick Venture863b9242018-03-08 08:29:23 -08001#pragma once
2
Patrick Venture863b9242018-03-08 08:29:23 -08003#include "interfaces.hpp"
4#include "sysfs/util.hpp"
5
Patrick Ventureda4a5dd2018-08-31 09:42:48 -07006#include <string>
Patrick Venture863b9242018-03-08 08:29:23 -08007
8/*
9 * A ReadInterface that is expecting a path that's sysfs, but really could be
10 * any filesystem path.
11 */
12class SysFsRead : public ReadInterface
13{
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070014 public:
15 SysFsRead(const std::string& path) : ReadInterface(), _path(FixupPath(path))
16 {
17 }
Patrick Venture863b9242018-03-08 08:29:23 -080018
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070019 ReadReturn read(void) override;
Patrick Venture863b9242018-03-08 08:29:23 -080020
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070021 private:
22 const std::string _path;
Patrick Venture863b9242018-03-08 08:29:23 -080023};