Kea 2.7.0
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:

Public Member Functions

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

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_nameHeader name.
header_valueHeader 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().

+ 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.

◆ getUint64Value()

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

Returns header value as unsigned integer.

Exceptions
BadValueif 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.

◆ isValueEqual()

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

Case insensitive comparison of header value.

Parameters
vValue 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: