Kea: http_header.h Source File

| Kea 3.2.0-git

http_header.h
Go to the documentation of this file.
1// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef HTTP_HEADER_H
8#define HTTP_HEADER_H
9
10#include <boost/shared_ptr.hpp>
11#include <string>
12
13namespace isc {
14namespace http {
15
20 class HttpHeader {
21public:
22
27 explicit HttpHeader(const std::string& header_name,
28 const std::string& header_value = "");
29
31 std::string getName() const {
32 return (header_name_);
33 }
34
36 std::string getValue() const {
37 return (header_value_);
38 }
39
43 uint64_t getUint64Value() const;
44
46 std::string getLowerCaseName() const;
47
49 std::string getLowerCaseValue() const;
50
56 bool isValueEqual(const std::string& v) const;
57
58private:
59
60 std::string header_name_;
61 std::string header_value_;
62};
63
65 typedef boost::shared_ptr<HttpHeader> HttpHeaderPtr;
66
68 class HostHttpHeader : public HttpHeader {
69public:
70
75 explicit HostHttpHeader(const std::string& header_value = "")
76 : HttpHeader("Host", header_value) {
77 }
78};
79
81 typedef boost::shared_ptr<HostHttpHeader> HostHttpHeaderPtr;
82
83} // end of namespace isc::http
84} // end of namespace isc
85
86#endif // HTTP_HEADER_H
isc::http::HostHttpHeader::HostHttpHeader
HostHttpHeader(const std::string &header_value="")
Constructor.
Definition http_header.h:75
isc::http::HttpHeader::getName
std::string getName() const
Returns header name.
Definition http_header.h:31
isc::http::HttpHeader::HttpHeader
HttpHeader(const std::string &header_name, const std::string &header_value="")
Constructor.
Definition http_header.cc:17
isc::http::HttpHeader::getValue
std::string getValue() const
Returns header value.
Definition http_header.h:36
isc::http::HttpHeader::getUint64Value
uint64_t getUint64Value() const
Returns header value as unsigned integer.
Definition http_header.cc:23
isc::http::HttpHeader::getLowerCaseName
std::string getLowerCaseName() const
Returns lower case header name.
Definition http_header.cc:34
isc::http::HttpHeader::getLowerCaseValue
std::string getLowerCaseValue() const
Returns lower case header value.
Definition http_header.cc:41
isc::http::HttpHeader::isValueEqual
bool isValueEqual(const std::string &v) const
Case insensitive comparison of header value.
Definition http_header.cc:48
isc::http
Definition auth_config.h:19
isc::http::HostHttpHeaderPtr
boost::shared_ptr< HostHttpHeader > HostHttpHeaderPtr
Pointer to the HTTP host header.
Definition http_header.h:81
isc::http::HttpHeaderPtr
boost::shared_ptr< HttpHeader > HttpHeaderPtr
Pointer to the HttpHeader class.
Definition http_header.h:65
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18