treewide: Remove unnecessary namespacing
Change-Id: I97387e043b389c3c0de5cbdf245646992846c821
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/include-fd/stdplus/fd/fmt.hpp b/include-fd/stdplus/fd/fmt.hpp
index 0f0537d..673a93a 100644
--- a/include-fd/stdplus/fd/fmt.hpp
+++ b/include-fd/stdplus/fd/fmt.hpp
@@ -14,7 +14,7 @@
class FormatBuffer
{
public:
- explicit FormatBuffer(stdplus::Fd& fd, size_t max = 4096);
+ explicit FormatBuffer(Fd& fd, size_t max = 4096);
~FormatBuffer() noexcept(false);
FormatBuffer(const FormatBuffer&) = delete;
FormatBuffer(FormatBuffer&&) = default;
@@ -32,7 +32,7 @@
void flush();
private:
- std::reference_wrapper<stdplus::Fd> fd;
+ std::reference_wrapper<Fd> fd;
fmt::memory_buffer buf;
size_t max;
@@ -64,7 +64,7 @@
private:
std::string tmpname;
- stdplus::ManagedFd fd;
+ ManagedFd fd;
FormatBuffer buf;
};
diff --git a/include-fd/stdplus/fd/line.hpp b/include-fd/stdplus/fd/line.hpp
index 6a82c7a..e8f4b99 100644
--- a/include-fd/stdplus/fd/line.hpp
+++ b/include-fd/stdplus/fd/line.hpp
@@ -15,7 +15,7 @@
public:
static constexpr size_t buf_size = 4096;
- LineReader(stdplus::Fd& fd);
+ LineReader(Fd& fd);
LineReader(const LineReader&) = delete;
LineReader(LineReader&&) = default;
LineReader& operator=(const LineReader&) = delete;
@@ -24,7 +24,7 @@
const std::string* readLine();
private:
- std::reference_wrapper<stdplus::Fd> fd;
+ std::reference_wrapper<Fd> fd;
std::array<char, buf_size> buf;
std::span<char> buf_data;
std::string line;
diff --git a/include-fd/stdplus/fd/ops.hpp b/include-fd/stdplus/fd/ops.hpp
index 8f3735b..c51b2ef 100644
--- a/include-fd/stdplus/fd/ops.hpp
+++ b/include-fd/stdplus/fd/ops.hpp
@@ -113,7 +113,7 @@
}
template <typename SockAddr>
-inline std::optional<stdplus::DupableFd> accept(Fd& fd, SockAddr&& sockaddr)
+inline std::optional<DupableFd> accept(Fd& fd, SockAddr&& sockaddr)
{
auto ret = fd.accept(raw::asSpan<std::byte>(sockaddr));
if (!std::get<0>(ret))
@@ -124,17 +124,17 @@
{
throw std::runtime_error("Invalid sockaddr type for accept");
}
- return stdplus::DupableFd(std::move(*std::get<0>(ret)));
+ return DupableFd(std::move(*std::get<0>(ret)));
}
-inline std::optional<stdplus::DupableFd> accept(Fd& fd)
+inline std::optional<DupableFd> accept(Fd& fd)
{
auto ret = std::get<0>(fd.accept(std::span<std::byte>{}));
if (!ret)
{
return std::nullopt;
}
- return stdplus::DupableFd(std::move(*ret));
+ return DupableFd(std::move(*ret));
}
template <typename Opt>
diff --git a/include-uring/stdplus/io_uring.hpp b/include-uring/stdplus/io_uring.hpp
index 6572e04..260b595 100644
--- a/include-uring/stdplus/io_uring.hpp
+++ b/include-uring/stdplus/io_uring.hpp
@@ -118,7 +118,7 @@
* @throws std::system_error if constructing the event fd fails
* @return A reference to the descriptor
*/
- stdplus::ManagedFd& getEventFd();
+ ManagedFd& getEventFd();
/** @brief Non-blocking process all outstanding eventFd events
* Should be used instead of process() to clear eventFd events.
@@ -127,7 +127,7 @@
private:
io_uring ring;
- std::optional<stdplus::ManagedFd> event_fd;
+ std::optional<ManagedFd> event_fd;
std::vector<CQEHandler*> handlers;
std::vector<int> files;
size_t filesAllocated = 0;
diff --git a/include/stdplus/cancel.hpp b/include/stdplus/cancel.hpp
index cb40c87..b8bc82d 100644
--- a/include/stdplus/cancel.hpp
+++ b/include/stdplus/cancel.hpp
@@ -24,7 +24,7 @@
}
};
-using CancelHandle = stdplus::Managed<Cancelable*>::HandleF<CancelableF>;
+using CancelHandle = Managed<Cancelable*>::HandleF<CancelableF>;
} // namespace detail
diff --git a/src/fd/fmt.cpp b/src/fd/fmt.cpp
index 51fdcb1..0eeb6ae 100644
--- a/src/fd/fmt.cpp
+++ b/src/fd/fmt.cpp
@@ -9,7 +9,7 @@
namespace fd
{
-FormatBuffer::FormatBuffer(stdplus::Fd& fd, size_t max) : fd(fd), max(max)
+FormatBuffer::FormatBuffer(Fd& fd, size_t max) : fd(fd), max(max)
{
}
@@ -22,7 +22,7 @@
{
if (buf.size() > 0)
{
- stdplus::fd::writeExact(fd, buf);
+ writeExact(fd, buf);
buf.clear();
}
}
diff --git a/src/io_uring.cpp b/src/io_uring.cpp
index c824597..0dec400 100644
--- a/src/io_uring.cpp
+++ b/src/io_uring.cpp
@@ -143,13 +143,13 @@
"io_uring_wait_cqe_timeout");
}
-stdplus::ManagedFd& IoUring::getEventFd()
+ManagedFd& IoUring::getEventFd()
{
if (event_fd)
{
return *event_fd;
}
- stdplus::ManagedFd efd(CHECK_RET(eventfd(0, EFD_NONBLOCK), "eventfd"));
+ ManagedFd efd(CHECK_RET(eventfd(0, EFD_NONBLOCK), "eventfd"));
CHECK_RET(io_uring_register_eventfd(&ring, efd.get()),
"io_uring_register_eventfd");
return *(event_fd = std::move(efd));
@@ -159,7 +159,7 @@
{
auto& efd = getEventFd();
std::byte b[8];
- while (!stdplus::fd::read(efd, b).empty())
+ while (!fd::read(efd, b).empty())
{
process();
}