blob: aa769c4686f65f6059305c9da731f01e0cbd4ebc [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"
James Feist0c8223b2019-05-08 15:33:33 -07004#include "util.hpp"
Patrick Venture863b9242018-03-08 08:29:23 -08005
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};