From 3eb74d80a75d8fe58148e34022595746b73d2771 Mon Sep 17 00:00:00 2001 From: "anchi.liu" Date: Wed, 16 Aug 2023 09:48:46 +0900 Subject: [PATCH] update doc --- Packet++/header/HttpLayer.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Packet++/header/HttpLayer.h b/Packet++/header/HttpLayer.h index b808a27e7c..110df2f586 100644 --- a/Packet++/header/HttpLayer.h +++ b/Packet++/header/HttpLayer.h @@ -210,11 +210,15 @@ namespace pcpp // -------- Class HttpResponseStatusCode ----------------- /** - * Class for the enum of HTTP response status codes + * @struct HttpResponseStatusCode + * @brief The enum wrapper class of HTTP response status codes */ class HttpResponseStatusCode { public: + /** + * @brief Define enum types and the corresponding int values + */ enum Value: int { /** 100 Continue*/ @@ -415,12 +419,19 @@ namespace pcpp constexpr operator Value() const { return m_value; } explicit operator bool() const = delete; + /** + * @struct HttpResponseStatusCodeHash + * @brief The helper structure for hash HttpResponseStatusCode while using std::unordered_map + */ struct HttpResponseStatusCodeHash { size_t operator()(const HttpResponseStatusCode& status) const { return std::hash()(static_cast(status)); } }; + /** + * @brief A pointer to the first line instance for this message + */ std::string toString() const { return std::to_string(m_value); } @@ -429,8 +440,12 @@ namespace pcpp return static_cast(m_value); } + /** + * @return If this HttpResponseStatusCode a valid code + * @note Any unknown or error code has an extreme large enum value + */ bool isUnsupportedCode() const { - return m_value > 599; // any unknown or error code has an extreme large enum value + return m_value > 599; } constexpr bool operator==(const HttpResponseStatusCode &other) const { return m_value == other.m_value; }