blob: 349caac4d11cb662e5b1c1c880716d6c3950236e [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))
Patrick Venturea83a3ec2020-08-04 09:52:05 -070016 {}
Patrick Venture863b9242018-03-08 08:29:23 -080017
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070018 ReadReturn read(void) override;
Patrick Venture863b9242018-03-08 08:29:23 -080019
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070020 private:
21 const std::string _path;
Patrick Venture863b9242018-03-08 08:29:23 -080022};