RESTinio
Public Member Functions | Private Attributes | List of all members
restinio::http_header_field_t Class Reference

A single header field. More...

#include <http_headers.hpp>

Public Member Functions

 http_header_field_t ()
 
 http_header_field_t (std::string name, std::string value)
 
 http_header_field_t (string_view_t name, string_view_t value)
 
 http_header_field_t (http_field_t field_id, std::string value)
 
 http_header_field_t (http_field_t field_id, string_view_t value)
 
const std::string & name () const noexcept
 
const std::string & value () const noexcept
 
http_field_t field_id () const noexcept
 
void name (std::string n)
 
void value (std::string v)
 
void append_value (string_view_t v)
 
void field_id (http_field_t field_id)
 

Private Attributes

std::string m_name
 
std::string m_value
 
http_field_t m_field_id
 

Detailed Description

A single header field.

Fields m_name and m_field_id are kind of having the same meaning, and m_name field seems like can be omitted, but for the cases of custom header fields it is important to rely on the name only. And as the names of almoust all speified fields fits in SSO it doesn't involve much overhead on standard fields.

Definition at line 644 of file http_headers.hpp.

Constructor & Destructor Documentation

◆ http_header_field_t() [1/5]

restinio::http_header_field_t::http_header_field_t ( )
inline

Definition at line 647 of file http_headers.hpp.

◆ http_header_field_t() [2/5]

restinio::http_header_field_t::http_header_field_t ( std::string  name,
std::string  value 
)
inline

Definition at line 651 of file http_headers.hpp.

◆ http_header_field_t() [3/5]

restinio::http_header_field_t::http_header_field_t ( string_view_t  name,
string_view_t  value 
)
inline

Definition at line 659 of file http_headers.hpp.

◆ http_header_field_t() [4/5]

restinio::http_header_field_t::http_header_field_t ( http_field_t  field_id,
std::string  value 
)
inline

Definition at line 667 of file http_headers.hpp.

◆ http_header_field_t() [5/5]

restinio::http_header_field_t::http_header_field_t ( http_field_t  field_id,
string_view_t  value 
)
inline

Definition at line 675 of file http_headers.hpp.

Member Function Documentation

◆ append_value()

void restinio::http_header_field_t::append_value ( string_view_t  v)
inline

Definition at line 701 of file http_headers.hpp.

◆ field_id() [1/2]

http_field_t restinio::http_header_field_t::field_id ( ) const
inlinenoexcept

Definition at line 685 of file http_headers.hpp.

◆ field_id() [2/2]

void restinio::http_header_field_t::field_id ( http_field_t  field_id)
inline

Definition at line 707 of file http_headers.hpp.

◆ name() [1/2]

const std::string& restinio::http_header_field_t::name ( ) const
inlinenoexcept

Definition at line 683 of file http_headers.hpp.

◆ name() [2/2]

void restinio::http_header_field_t::name ( std::string  n)
inline

Definition at line 688 of file http_headers.hpp.

◆ value() [1/2]

const std::string& restinio::http_header_field_t::value ( ) const
inlinenoexcept

Definition at line 684 of file http_headers.hpp.

◆ value() [2/2]

void restinio::http_header_field_t::value ( std::string  v)
inline

Definition at line 695 of file http_headers.hpp.

Member Data Documentation

◆ m_field_id

http_field_t restinio::http_header_field_t::m_field_id
private

Definition at line 716 of file http_headers.hpp.

◆ m_name

std::string restinio::http_header_field_t::m_name
private

Definition at line 714 of file http_headers.hpp.

◆ m_value

std::string restinio::http_header_field_t::m_value
private

Definition at line 715 of file http_headers.hpp.


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