summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-05 00:03:59 +0200
committerEgor Tensin <egor@tensin.name>2026-06-05 00:03:59 +0200
commit3a967fed3cbbb706fd723b7752d28094fea7fcb1 (patch)
tree034eb7069bfad5065544efda07bf4653ccb08627
parentfix .clang-tidy (diff)
downloadwinapi-common-3a967fed3cbbb706fd723b7752d28094fea7fcb1.tar.gz
winapi-common-3a967fed3cbbb706fd723b7752d28094fea7fcb1.zip
upgrade to nested namespaces
-rw-r--r--include/winapi/error.hpp6
-rw-r--r--include/winapi/process_io.hpp6
-rw-r--r--src/error.cpp6
-rw-r--r--src/process_io.cpp6
-rw-r--r--test/unit_tests/shared/test_data.hpp6
5 files changed, 10 insertions, 20 deletions
diff --git a/include/winapi/error.hpp b/include/winapi/error.hpp
index 30237e3..259c18b 100644
--- a/include/winapi/error.hpp
+++ b/include/winapi/error.hpp
@@ -18,8 +18,7 @@
#include <string>
#include <system_error>
-namespace winapi {
-namespace error {
+namespace winapi::error {
class CategoryWindows : public std::error_category {
public:
@@ -47,5 +46,4 @@ std::runtime_error custom(Ret ret, const char* function) {
return std::runtime_error{std::format("Function {} failed with error code {}", function, ret)};
}
-} // namespace error
-} // namespace winapi
+} // namespace winapi::error
diff --git a/include/winapi/process_io.hpp b/include/winapi/process_io.hpp
index 9da442f..ac678e6 100644
--- a/include/winapi/process_io.hpp
+++ b/include/winapi/process_io.hpp
@@ -12,8 +12,7 @@
#include <string_view>
#include <utility>
-namespace winapi {
-namespace process {
+namespace winapi::process {
struct Stream {
Stream(Handle&& handle) : handle{std::move(handle)} {}
@@ -68,5 +67,4 @@ struct IO {
Stderr std_err;
};
-} // namespace process
-} // namespace winapi
+} // namespace winapi::process
diff --git a/src/error.cpp b/src/error.cpp
index afc33f3..7266e63 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -14,8 +14,7 @@
#include <string_view>
#include <system_error>
-namespace winapi {
-namespace error {
+namespace winapi::error {
namespace {
std::wstring trim_trailing_newline(std::wstring_view s) {
@@ -64,5 +63,4 @@ std::system_error windows(DWORD code, const char* function) {
static_cast<int32_t>(code), category_windows(), build_what(code, function)};
}
-} // namespace error
-} // namespace winapi
+} // namespace winapi::error
diff --git a/src/process_io.cpp b/src/process_io.cpp
index 1162049..dd227b3 100644
--- a/src/process_io.cpp
+++ b/src/process_io.cpp
@@ -11,8 +11,7 @@
#include <string_view>
#include <utility>
-namespace winapi {
-namespace process {
+namespace winapi::process {
Stdin::Stdin() : Stream{Handle::std_in()} {}
@@ -50,5 +49,4 @@ void IO::close() {
std_err.handle.close();
}
-} // namespace process
-} // namespace winapi
+} // namespace winapi::process
diff --git a/test/unit_tests/shared/test_data.hpp b/test/unit_tests/shared/test_data.hpp
index 1c8316a..7b8caf6 100644
--- a/test/unit_tests/shared/test_data.hpp
+++ b/test/unit_tests/shared/test_data.hpp
@@ -7,8 +7,7 @@
#include <string>
-namespace worker {
-namespace test_data {
+namespace worker::test_data {
static constexpr auto str = "Test output.";
@@ -20,5 +19,4 @@ inline std::string err() {
return "stderr: " + std::string{str};
}
-} // namespace test_data
-} // namespace worker
+} // namespace worker::test_data