From 2469d730b1a0f944380166ad9049084054540c23 Mon Sep 17 00:00:00 2001 From: Gavin Smith Date: Thu, 3 Apr 2025 00:17:26 +0100 Subject: [PATCH] Made some member functions const where appropriate. --- client_http.hpp | 4 ++-- server_http.hpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client_http.hpp b/client_http.hpp index e12fcd2..87d8367 100644 --- a/client_http.hpp +++ b/client_http.hpp @@ -72,11 +72,11 @@ namespace SimpleWeb { friend class ClientBase; public: - std::size_t size() noexcept { + std::size_t size() const noexcept { return streambuf.size(); } /// Convenience function to return content as a string. - std::string string() noexcept { + std::string string() const noexcept { return std::string(asio::buffers_begin(streambuf.data()), asio::buffers_end(streambuf.data())); } diff --git a/server_http.hpp b/server_http.hpp index b7591c2..baace86 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -135,7 +135,7 @@ namespace SimpleWeb { } public: - std::size_t size() noexcept { + std::size_t size() const noexcept { return streambuf->size(); } @@ -209,11 +209,11 @@ namespace SimpleWeb { friend class ServerBase; public: - std::size_t size() noexcept { + std::size_t size() const noexcept { return streambuf.size(); } /// Convenience function to return content as std::string. - std::string string() noexcept { + std::string string() const noexcept { return std::string(asio::buffers_begin(streambuf.data()), asio::buffers_end(streambuf.data())); }