Skip to content

Commit 4b1fd17

Browse files
committed
Rewrote constants.
1 parent 8847a53 commit 4b1fd17

File tree

8 files changed

+148
-648
lines changed

8 files changed

+148
-648
lines changed

http/src/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,6 @@ endif()
102102
# )
103103
#endif()
104104

105-
set(CPP-NETLIB_HTTP_V2_CONSTANTS_SRCS
106-
${CMAKE_CURRENT_SOURCE_DIR}/http/v2/constants.cpp
107-
)
108-
add_library(network-http-v2-constants ${CPP-NETLIB_HTTP_V2_CONSTANTS_SRCS})
109-
add_dependencies(network-http-v2-constants
110-
cppnetlib-uri
111-
)
112-
target_link_libraries(network-http-v2-constants
113-
${Boost_LIBRARIES}
114-
cppnetlib-uri
115-
)
116105

117106
set(CPP-NETLIB_HTTP_V2_CLIENT_SRCS
118107
${CMAKE_CURRENT_SOURCE_DIR}/http/v2/client/client.cpp

http/src/http/v2/constants.cpp

Lines changed: 0 additions & 58 deletions
This file was deleted.

http/src/network/http/v2/client/response.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ namespace network {
6363
response(const response &other)
6464
: status_(other.status_)
6565
, version_(other.version_)
66-
, status_message_(other.status_message_)
6766
, headers_(other.headers_) {
6867

6968
}
@@ -75,7 +74,6 @@ namespace network {
7574
response(response &&other) noexcept
7675
: status_(std::move(other.status_))
7776
, version_(std::move(other.version_))
78-
, status_message_(std::move(other.status_message_))
7977
, headers_(std::move(other.headers_)) {
8078

8179
}
@@ -96,15 +94,14 @@ namespace network {
9694
void swap(response &other) noexcept {
9795
std::swap(status_, other.status_);
9896
std::swap(version_, other.version_);
99-
std::swap(status_message_, other.status_message_);
10097
std::swap(headers_, other.headers_);
10198
}
10299

103100
/**
104101
* \brief Returns the HTTP response status.
105102
* \returns The status code.
106103
*/
107-
std::uint16_t status() const {
104+
constants::status::code status() const {
108105
return status_;
109106
}
110107

@@ -113,7 +110,7 @@ namespace network {
113110
* \returns The status message.
114111
*/
115112
string_type status_message() const {
116-
return status_message_;
113+
return constants::status::message(status_);
117114
}
118115

119116
/**
@@ -143,7 +140,7 @@ namespace network {
143140

144141
private:
145142

146-
std::uint16_t status_;
143+
constants::status::code status_;
147144
string_type version_, status_message_;
148145
headers_type headers_;
149146

0 commit comments

Comments
 (0)