Kea: isc::http::HttpHeader Class Reference

| Kea 2.2.0

Public Member Functions | List of all members
isc::http::HttpHeader Class Reference

Represents HTTP header including a header name and value. More...

`#include <http_header.h>`

Inheritance diagram for isc::http::HttpHeader:
[legend]

## Public Member Functions
| HttpHeader (const std::string &header_name, const std::string &header_value="")
| Constructor. More...
std::string | getLowerCaseName () const
| Returns lower case header name. More...
std::string | getLowerCaseValue () const
| Returns lower case header value. More...
std::string | getName () const
| Returns header name. More...
uint64_t | getUint64Value () const
| Returns header value as unsigned integer. More...
std::string | getValue () const
| Returns header value. More...
bool | isValueEqual (const std::string &v) const
| Case insensitive comparison of header value. More...

## Detailed Description

Represents HTTP header including a header name and value.

It includes methods for retrieving header name and value in lower case and for case insensitive comparison of header values.

Definition at line 20 of file http_header.h.

## Constructor & Destructor Documentation

## ◆ HttpHeader()

isc::http::HttpHeader::HttpHeader | ( | const std::string & | header_name,
|  | const std::string & | header_value = `""`
| ) |  |
| explicit

Constructor.

Parameters

  header_name | Header name.
  header_value | Header value.

Definition at line 17 of file http_header.cc.

## Member Function Documentation

## ◆ getLowerCaseName()

std::string isc::http::HttpHeader::getLowerCaseName | ( |  | ) | const

Returns lower case header name.

Definition at line 34 of file http_header.cc.

References isc::util::str::lowercase().

Referenced by isc::http::HttpMessage::getHeader().

Here is the call graph for this function:

## ◆ getLowerCaseValue()

std::string isc::http::HttpHeader::getLowerCaseValue | ( |  | ) | const

Returns lower case header value.

Definition at line 41 of file http_header.cc.

References isc::util::str::lowercase().

Referenced by isValueEqual().

Here is the call graph for this function:

## ◆ getName()

std::string isc::http::HttpHeader::getName | ( |  | ) | const
| inline

Returns header name.

Definition at line 31 of file http_header.h.

Referenced by isc::http::HttpRequest::HttpRequest().

## ◆ getUint64Value()

uint64_t isc::http::HttpHeader::getUint64Value | ( |  | ) | const

Returns header value as unsigned integer.

Exceptions

  BadValue | if the header value is not a valid number.

Definition at line 23 of file http_header.cc.

References isc_throw.

## ◆ getValue()

std::string isc::http::HttpHeader::getValue | ( |  | ) | const
| inline

Returns header value.

Definition at line 36 of file http_header.h.

Referenced by isc::http::HttpRequest::HttpRequest().

## ◆ isValueEqual()

bool isc::http::HttpHeader::isValueEqual | ( | const std::string & | v | ) | const

Case insensitive comparison of header value.

Parameters

  v | Value to be compared.

Returns
  true if header value is equal, false otherwise.

Definition at line 48 of file http_header.cc.

References getLowerCaseValue(), and isc::util::str::lowercase().

Here is the call graph for this function:

The documentation for this class was generated from the following files:

- http_header.h
- http_header.cc