Arduino DLNA Server
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tiny_dlna::HttpHeader Class Referenceabstract

In a http request and reply we need to process header information. With this API we can define and query the header information. The individual header lines are stored in a list. This is the common functionality for the HttpRequest and HttpReplyHeader subclasses. More...

#include <HttpHeader.h>

Inheritance diagram for tiny_dlna::HttpHeader:
Inheritance graph
[legend]
Collaboration diagram for tiny_dlna::HttpHeader:
Collaboration graph
[legend]

Public Member Functions

 HttpHeader ()
 
 ~HttpHeader ()
 
HttpHeaderclear (bool activeFlag=true)
 clears the data - usually we do not delete but we just set the active flag More...
 
HttpHeaderput (const char *key, const char *value)
 
HttpHeaderput (const char *key, int value)
 adds a new line to the header - e.g. for content size More...
 
HttpHeaderput (const char *line)
 adds a received new line to the header More...
 
const char * get (const char *key)
 
void readLine (Client &in, char *str, int len)
 
void writeHeaderLine (Client &out, HttpHeaderLine *header)
 
const char * urlPath ()
 
const char * protocol ()
 
TinyMethodID method ()
 
const char * accept ()
 
int statusCode ()
 
const char * statusMessage ()
 
bool isChunked ()
 
void read (Client &in)
 
void write (Client &out)
 
void setAutoCreateLines (bool is_auto_line)
 
bool isValidStatus ()
 returns true if status code >=200 and < 300 More...
 
bool isRedirectStatus ()
 

Protected Member Functions

void crlf (Client &out)
 
HttpHeaderLineheaderLine (const char *key)
 
TinyMethodID getMethod (const char *line)
 
virtual void write1stLine (Client &out)=0
 
virtual void parse1stLine (const char *line)=0
 

Protected Attributes

int status_code = T_UNDEFINED
 
bool is_written = false
 
bool is_chunked = false
 
bool create_new_lines = true
 
TinyMethodID method_id
 
Str protocol_str = Str(10)
 
Str url_path = Str(70)
 
Str status_msg = Str(20)
 
List< HttpHeaderLine * > lines
 
HttpLineReader reader
 
const char * CRLF = "\r\n"
 

Detailed Description

In a http request and reply we need to process header information. With this API we can define and query the header information. The individual header lines are stored in a list. This is the common functionality for the HttpRequest and HttpReplyHeader subclasses.

Constructor & Destructor Documentation

◆ HttpHeader()

tiny_dlna::HttpHeader::HttpHeader ( )
inline

◆ ~HttpHeader()

tiny_dlna::HttpHeader::~HttpHeader ( )
inline

Member Function Documentation

◆ accept()

const char* tiny_dlna::HttpHeader::accept ( )
inline

◆ clear()

HttpHeader& tiny_dlna::HttpHeader::clear ( bool  activeFlag = true)
inline

clears the data - usually we do not delete but we just set the active flag

◆ crlf()

void tiny_dlna::HttpHeader::crlf ( Client &  out)
inlineprotected

◆ get()

const char* tiny_dlna::HttpHeader::get ( const char *  key)
inline

◆ getMethod()

TinyMethodID tiny_dlna::HttpHeader::getMethod ( const char *  line)
inlineprotected

◆ headerLine()

HttpHeaderLine* tiny_dlna::HttpHeader::headerLine ( const char *  key)
inlineprotected

◆ isChunked()

bool tiny_dlna::HttpHeader::isChunked ( )
inline

◆ isRedirectStatus()

bool tiny_dlna::HttpHeader::isRedirectStatus ( )
inline

◆ isValidStatus()

bool tiny_dlna::HttpHeader::isValidStatus ( )
inline

returns true if status code >=200 and < 300

◆ method()

TinyMethodID tiny_dlna::HttpHeader::method ( )
inline

◆ parse1stLine()

virtual void tiny_dlna::HttpHeader::parse1stLine ( const char *  line)
protectedpure virtual

◆ protocol()

const char* tiny_dlna::HttpHeader::protocol ( )
inline

◆ put() [1/3]

HttpHeader& tiny_dlna::HttpHeader::put ( const char *  key,
const char *  value 
)
inline

◆ put() [2/3]

HttpHeader& tiny_dlna::HttpHeader::put ( const char *  key,
int  value 
)
inline

adds a new line to the header - e.g. for content size

◆ put() [3/3]

HttpHeader& tiny_dlna::HttpHeader::put ( const char *  line)
inline

adds a received new line to the header

◆ read()

void tiny_dlna::HttpHeader::read ( Client &  in)
inline

◆ readLine()

void tiny_dlna::HttpHeader::readLine ( Client &  in,
char *  str,
int  len 
)
inline

◆ setAutoCreateLines()

void tiny_dlna::HttpHeader::setAutoCreateLines ( bool  is_auto_line)
inline

◆ statusCode()

int tiny_dlna::HttpHeader::statusCode ( )
inline

◆ statusMessage()

const char* tiny_dlna::HttpHeader::statusMessage ( )
inline

◆ urlPath()

const char* tiny_dlna::HttpHeader::urlPath ( )
inline

◆ write()

void tiny_dlna::HttpHeader::write ( Client &  out)
inline

◆ write1stLine()

virtual void tiny_dlna::HttpHeader::write1stLine ( Client &  out)
protectedpure virtual

◆ writeHeaderLine()

void tiny_dlna::HttpHeader::writeHeaderLine ( Client &  out,
HttpHeaderLine header 
)
inline

Member Data Documentation

◆ create_new_lines

bool tiny_dlna::HttpHeader::create_new_lines = true
protected

◆ CRLF

const char* tiny_dlna::HttpHeader::CRLF = "\r\n"
protected

◆ is_chunked

bool tiny_dlna::HttpHeader::is_chunked = false
protected

◆ is_written

bool tiny_dlna::HttpHeader::is_written = false
protected

◆ lines

List<HttpHeaderLine*> tiny_dlna::HttpHeader::lines
protected

◆ method_id

TinyMethodID tiny_dlna::HttpHeader::method_id
protected

◆ protocol_str

Str tiny_dlna::HttpHeader::protocol_str = Str(10)
protected

◆ reader

HttpLineReader tiny_dlna::HttpHeader::reader
protected

◆ status_code

int tiny_dlna::HttpHeader::status_code = T_UNDEFINED
protected

◆ status_msg

Str tiny_dlna::HttpHeader::status_msg = Str(20)
protected

◆ url_path

Str tiny_dlna::HttpHeader::url_path = Str(70)
protected

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