blob: 4c1baecef92a5b7cf45334557aeffd85dbfa00f3 [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:
Patrick Venture3c2564c2020-08-10 12:46:46 -070015 explicit SysFsRead(const std::string& path) :
16 ReadInterface(), _path(FixupPath(path))
Patrick Venturea83a3ec2020-08-04 09:52:05 -070017 {}
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};