aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.clang-format22
-rw-r--r--include/winapi/handle.hpp12
-rw-r--r--test/handle.cpp8
3 files changed, 28 insertions, 14 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..6a036ac
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,22 @@
+---
+Language: Cpp
+BasedOnStyle: Chromium
+
+AccessModifierOffset: -4
+ColumnLimit: 100
+IncludeBlocks: Regroup
+IndentWidth: 4
+SpacesBeforeTrailingComments: 1
+
+IncludeCategories:
+ - Regex: '^".*'
+ Priority: 1
+ - Regex: '^<(winapi)/'
+ Priority: 2
+ - Regex: '^<boost\/'
+ Priority: 3
+ - Regex: '^<.*\.h>$'
+ Priority: 4
+ - Regex: '.*'
+ Priority: 5
+...
diff --git a/include/winapi/handle.hpp b/include/winapi/handle.hpp
index 9e9661b..9714db3 100644
--- a/include/winapi/handle.hpp
+++ b/include/winapi/handle.hpp
@@ -21,15 +21,11 @@ class Handle {
public:
Handle() = default;
- explicit Handle(HANDLE raw)
- : impl{raw}
- { }
+ explicit Handle(HANDLE raw) : impl{raw} {}
- Handle(Handle&& other) BOOST_NOEXCEPT_OR_NOTHROW {
- swap(other);
- }
+ Handle(Handle&& other) BOOST_NOEXCEPT_OR_NOTHROW { swap(other); }
- Handle& operator=(Handle other) BOOST_NOEXCEPT_OR_NOTHROW {
+ Handle& operator=(Handle other) BOOST_NOEXCEPT_OR_NOTHROW {
swap(other);
return *this;
}
@@ -61,7 +57,7 @@ inline void swap(Handle& a, Handle& b) BOOST_NOEXCEPT_OR_NOTHROW {
a.swap(b);
}
-}
+} // namespace winapi
namespace std {
diff --git a/test/handle.cpp b/test/handle.cpp
index 32b5bc1..13551f4 100644
--- a/test/handle.cpp
+++ b/test/handle.cpp
@@ -12,13 +12,9 @@
BOOST_AUTO_TEST_SUITE(handle_tests)
BOOST_AUTO_TEST_CASE(null) {
- {
- winapi::Handle h{NULL};
- }
+ { winapi::Handle h{NULL}; }
BOOST_TEST(true, "NULL handle closed successfully");
- {
- winapi::Handle h{INVALID_HANDLE_VALUE};
- }
+ { winapi::Handle h{INVALID_HANDLE_VALUE}; }
BOOST_TEST(true, "INVALID_HANDLE_VALUE handle closed successfully");
}