Start using .clang-format
Used the one from docs/style/cpp.
Change-Id: I3bdc2b353bf18a437266b362d8205b8463a9ce2b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/file.hpp b/file.hpp
index 5be4c4b..d762012 100644
--- a/file.hpp
+++ b/file.hpp
@@ -15,59 +15,57 @@
*/
class FileDescriptor
{
- public:
+ public:
+ FileDescriptor() = default;
+ FileDescriptor(const FileDescriptor&) = delete;
+ FileDescriptor& operator=(const FileDescriptor&) = delete;
+ FileDescriptor(FileDescriptor&&) = delete;
+ FileDescriptor& operator=(FileDescriptor&&) = delete;
- FileDescriptor() = default;
- FileDescriptor(const FileDescriptor&) = delete;
- FileDescriptor& operator=(const FileDescriptor&) = delete;
- FileDescriptor(FileDescriptor&&) = delete;
- FileDescriptor& operator=(FileDescriptor&&) = delete;
+ /**
+ * Constructor
+ *
+ * @param[in] fd - File descriptor
+ */
+ FileDescriptor(int fd) : fd(fd)
+ {
+ }
- /**
- * Constructor
- *
- * @param[in] fd - File descriptor
- */
- FileDescriptor(int fd) : fd(fd)
+ ~FileDescriptor()
+ {
+ if (fd >= 0)
{
+ close(fd);
+ }
+ }
+
+ int operator()()
+ {
+ return fd;
+ }
+
+ operator bool() const
+ {
+ return fd != -1;
+ }
+
+ void set(int descriptor)
+ {
+ if (fd >= 0)
+ {
+ close(fd);
}
- ~FileDescriptor()
- {
- if (fd >= 0)
- {
- close(fd);
- }
- }
+ fd = descriptor;
+ }
- int operator()()
- {
- return fd;
- }
-
- operator bool() const
- {
- return fd != -1;
- }
-
- void set(int descriptor)
- {
- if (fd >= 0)
- {
- close(fd);
- }
-
- fd = descriptor;
- }
-
- private:
-
- /**
- * File descriptor
- */
- int fd = -1;
+ private:
+ /**
+ * File descriptor
+ */
+ int fd = -1;
};
-}
-}
-}
+} // namespace util
+} // namespace power
+} // namespace witherspoon