add .clang-format
Change-Id: I6627b5569c2e0f730be7331403218b823a2c622f
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/sysfs/sysfsread.cpp b/sysfs/sysfsread.cpp
index 284aa55..a070af2 100644
--- a/sysfs/sysfsread.cpp
+++ b/sysfs/sysfsread.cpp
@@ -14,13 +14,12 @@
* limitations under the License.
*/
+#include "sysfs/sysfsread.hpp"
+
#include <chrono>
#include <fstream>
#include <iostream>
-#include "sysfs/sysfsread.hpp"
-
-
ReadReturn SysFsRead::read(void)
{
int64_t value;
@@ -30,10 +29,8 @@
ifs >> value;
ifs.close();
- struct ReadReturn r = {
- static_cast<double>(value),
- std::chrono::high_resolution_clock::now()
- };
+ struct ReadReturn r = {static_cast<double>(value),
+ std::chrono::high_resolution_clock::now()};
return r;
}
diff --git a/sysfs/sysfsread.hpp b/sysfs/sysfsread.hpp
index 0dbc71b..4cd2a78 100644
--- a/sysfs/sysfsread.hpp
+++ b/sysfs/sysfsread.hpp
@@ -1,10 +1,9 @@
#pragma once
-#include <string>
-
#include "interfaces.hpp"
#include "sysfs/util.hpp"
+#include <string>
/*
* A ReadInterface that is expecting a path that's sysfs, but really could be
@@ -12,14 +11,13 @@
*/
class SysFsRead : public ReadInterface
{
- public:
- SysFsRead(const std::string& path)
- : ReadInterface(),
- _path(FixupPath(path))
- { }
+ public:
+ SysFsRead(const std::string& path) : ReadInterface(), _path(FixupPath(path))
+ {
+ }
- ReadReturn read(void) override;
+ ReadReturn read(void) override;
- private:
- const std::string _path;
+ private:
+ const std::string _path;
};
diff --git a/sysfs/sysfswrite.cpp b/sysfs/sysfswrite.cpp
index c3e1b03..1ea4c4d 100644
--- a/sysfs/sysfswrite.cpp
+++ b/sysfs/sysfswrite.cpp
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-#include <fstream>
-#include <iostream>
-
#include "sysfswrite.hpp"
+#include <fstream>
+#include <iostream>
void SysFsWritePercent::write(double value)
{
diff --git a/sysfs/sysfswrite.hpp b/sysfs/sysfswrite.hpp
index 989f800..9510dff 100644
--- a/sysfs/sysfswrite.hpp
+++ b/sysfs/sysfswrite.hpp
@@ -1,10 +1,9 @@
#pragma once
-#include <string>
-
#include "interfaces.hpp"
#include "sysfs/util.hpp"
+#include <string>
/*
* A WriteInterface that is expecting a path that's sysfs, but really could be
@@ -12,29 +11,28 @@
*/
class SysFsWritePercent : public WriteInterface
{
- public:
- SysFsWritePercent(const std::string& writepath, int64_t min,
- int64_t max)
- : WriteInterface(min, max),
- _writepath(FixupPath(writepath))
- { }
+ public:
+ SysFsWritePercent(const std::string& writepath, int64_t min, int64_t max) :
+ WriteInterface(min, max), _writepath(FixupPath(writepath))
+ {
+ }
- void write(double value) override;
+ void write(double value) override;
- private:
- std::string _writepath;
+ private:
+ std::string _writepath;
};
class SysFsWrite : public WriteInterface
{
- public:
- SysFsWrite(const std::string& writepath, int64_t min, int64_t max)
- : WriteInterface(min, max),
- _writepath(FixupPath(writepath))
- { }
+ public:
+ SysFsWrite(const std::string& writepath, int64_t min, int64_t max) :
+ WriteInterface(min, max), _writepath(FixupPath(writepath))
+ {
+ }
- void write(double value) override;
+ void write(double value) override;
- private:
- std::string _writepath;
+ private:
+ std::string _writepath;
};
diff --git a/sysfs/util.cpp b/sysfs/util.cpp
index c297412..aeceada 100644
--- a/sysfs/util.cpp
+++ b/sysfs/util.cpp
@@ -14,17 +14,17 @@
* limitations under the License.
*/
+#include "sysfs/util.hpp"
+
#include <experimental/filesystem>
#include <iostream>
#include <string>
-
-#include "sysfs/util.hpp"
-
/*
* There are two basic paths I want to support:
* 1. /sys/class/hwmon/hwmon0/pwm1
- * 2. /sys/devices/platform/ahb/1e786000.pwm-tacho-controller/hwmon/<asterisk asterisk>/pwm1
+ * 2. /sys/devices/platform/ahb/1e786000.pwm-tacho-controller/hwmon/<asterisk
+ * asterisk>/pwm1
*
* In this latter case, I want to fill in that gap. Assuming because it's this
* path that it'll only have one directory there.
@@ -33,7 +33,6 @@
static constexpr auto platform = "/sys/devices/platform/";
namespace fs = std::experimental::filesystem;
-
std::string FixupPath(std::string original)
{
std::string::size_type n, x;