summaryrefslogtreecommitdiffstats
path: root/file.hpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-11-01 16:52:10 -0700
committerPatrick Venture <venture@google.com>2018-11-01 16:59:54 -0700
commitdace680fa404d7c02a68db105fd7b958b4681442 (patch)
tree6d447ced41a2d1ef9bbd8206d52099609cd973d1 /file.hpp
parent3c4a23e7764c7785d18cb30340a6d185022a797a (diff)
downloadphosphor-gpio-monitor-dace680fa404d7c02a68db105fd7b958b4681442.tar.gz
phosphor-gpio-monitor-dace680fa404d7c02a68db105fd7b958b4681442.zip
Add clang-format to repo
Add clang-format to repo. Change-Id: I3f8704d80dd0bdde0706ab189c68cffe6d347995 Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'file.hpp')
-rw-r--r--file.hpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/file.hpp b/file.hpp
index ee8fd4b..500d8be 100644
--- a/file.hpp
+++ b/file.hpp
@@ -10,48 +10,48 @@ namespace gpio
*/
class FileDescriptor
{
- private:
- /** @brief File descriptor for the gpio input device */
- int fd = -1;
-
- public:
- FileDescriptor() = default;
- FileDescriptor(const FileDescriptor&) = delete;
- FileDescriptor& operator=(const FileDescriptor&) = delete;
- FileDescriptor(FileDescriptor&&) = delete;
- FileDescriptor& operator=(FileDescriptor&&) = delete;
-
- /** @brief Saves File descriptor and uses it to do file operation
- *
- * @param[in] fd - File descriptor
- */
- FileDescriptor(int fd) : fd(fd)
+ private:
+ /** @brief File descriptor for the gpio input device */
+ int fd = -1;
+
+ public:
+ FileDescriptor() = default;
+ FileDescriptor(const FileDescriptor&) = delete;
+ FileDescriptor& operator=(const FileDescriptor&) = delete;
+ FileDescriptor(FileDescriptor&&) = delete;
+ FileDescriptor& operator=(FileDescriptor&&) = delete;
+
+ /** @brief Saves File descriptor and uses it to do file operation
+ *
+ * @param[in] fd - File descriptor
+ */
+ FileDescriptor(int fd) : fd(fd)
+ {
+ // Nothing
+ }
+
+ ~FileDescriptor()
+ {
+ if (fd >= 0)
{
- // Nothing
- }
-
- ~FileDescriptor()
- {
- if (fd >=0)
- {
- close(fd);
- }
- }
-
- int operator()()
- {
- return fd;
- }
-
- operator bool() const
- {
- return fd != -1;
- }
-
- void set(int descriptor)
- {
- fd = descriptor;
+ close(fd);
}
+ }
+
+ int operator()()
+ {
+ return fd;
+ }
+
+ operator bool() const
+ {
+ return fd != -1;
+ }
+
+ void set(int descriptor)
+ {
+ fd = descriptor;
+ }
};
} // namespace gpio
OpenPOWER on IntegriCloud