Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

HttpHeaders Class Reference

Inheritance diagram for HttpHeaders:

HttpTokens HttpMutableHeaders List of all members.

Public Types

typedef HttpTokens parse parse

Public Member Functions

 this ()
 this (HttpHeaders source)
HttpHeaders clone ()
void parse (IBuffer input)
char[] get (HttpHeaderName name)
int getInt (HttpHeaderName name)
long getDate (HttpHeaderName name)
int opApply (int(*dg)(inout HeaderElement))
FilteredHeaders createFilter (HttpHeaderName header)

Static Public Member Functions

 this ()

Private Member Functions

 this (char seperator, bool inclusive=false)
 this (HttpTokens source)
void parse (char[] content)
void reset ()
bool isParsed ()
void setParsed (bool parsed)
char[] get (char[] name)
int getInt (char[] name)
long getDate (char[] name)
int opApply (int(*dg)(inout HttpToken))
void write (IWriter writer)
private bool split (Token t, inout HttpToken element)
FilteredTokens createFilter (char[] match)
void setOutputBuffer (IBuffer output)
IBuffer getOutputBuffer ()
char[] toOutputString ()
void add (char[] name, void(*dg)(IBuffer))
void add (char[] name, char[] value)
void addInt (char[] name, int value)
void addDate (char[] name, long value)

Private Attributes

TokenStack stack

Static Private Attributes

BoundToken line

Detailed Description

Maintains a set of input headers. These are placed into an input buffer and indexed via a TokenStack.

Definition at line 150 of file HttpHeaders.d.


Member Typedef Documentation

typedef HttpTokens parse parse
 

Definition at line 155 of file HttpHeaders.d.

Referenced by HttpClient::open(), HttpRequest::readHeaders(), and testHttpClient2().


Member Function Documentation

this  )  [inline, static]
 

Setup a line tokenizer for later use

Reimplemented from HttpTokens.

Definition at line 163 of file HttpHeaders.d.

References line.

this  )  [inline]
 

Construct this set of headers, using a TokenStack based upon a ':' delimeter

Reimplemented from HttpTokens.

Definition at line 178 of file HttpHeaders.d.

this HttpHeaders  source  )  [inline]
 

Clone a source set of HttpHeaders

Definition at line 191 of file HttpHeaders.d.

HttpHeaders clone  )  [inline]
 

Clone this set of HttpHeaders

Reimplemented in HttpMutableHeaders.

Definition at line 202 of file HttpHeaders.d.

References HttpHeaders.

void parse IBuffer  input  )  [inline]
 

Read all header lines. Everything is mapped rather than being allocated & copied

Reimplemented from HttpTokens.

Definition at line 214 of file HttpHeaders.d.

References Token::getLength(), line, BoundToken::next(), TokenStack::push(), and HttpTokens::setParsed().

char [] get HttpHeaderName  name  )  [inline]
 

Return the value of the provided header, or null if the header does not exist

Definition at line 228 of file HttpHeaders.d.

References HttpHeaderName::value.

Referenced by HttpResponse::commit(), and HttpMessage::getContentType().

int getInt HttpHeaderName  name  )  [inline]
 

Return the integer value of the provided header, or -1 if the header does not exist

Definition at line 240 of file HttpHeaders.d.

References HttpHeaderName::value.

Referenced by HttpRequest::getInputParameters(), and testHttpClient3().

long getDate HttpHeaderName  name  )  [inline]
 

Return the date value of the provided header, or -1 if the header does not exist

Definition at line 252 of file HttpHeaders.d.

References HttpHeaderName::value.

Referenced by MethodServlet::get().

int opApply int(*  dg)(inout HeaderElement)  )  [inline]
 

Iterate over the set of headers. This is a shell around the superclass, where we can convert the HttpToken into a HeaderElement instead.

Definition at line 265 of file HttpHeaders.d.

References HeaderElement::name, HeaderElement::value, and HttpHeaderName::value.

FilteredHeaders createFilter HttpHeaderName  header  )  [inline]
 

Create a filter for iterating of a set of named headers. We have to create a filter since we can't pass additional arguments directly to an opApply() method.

Definition at line 289 of file HttpHeaders.d.

this char  seperator,
bool  inclusive = false
[inline, inherited]
 

Construct a set of tokens based upon the given delimeter, and an indication of whether said delimeter should be considered part of the left side (effectively the name).

The latter is useful with headers, since the seperating ':' character should really be considered part of the name for purposes of subsequent token matching.

Definition at line 113 of file HttpTokens.d.

References HttpTokens::inclusive, HttpTokens::seperator, HttpTokens::sepString, and TokenStack.

this HttpTokens  source  )  [inline, inherited]
 

Clone a source set of HttpTokens

Definition at line 133 of file HttpTokens.d.

References TokenStack::clone(), HttpTokens::inclusive, HttpTokens::seperator, and HttpTokens::sepString.

void parse char[]  content  )  [inline, inherited]
 

Parse an input string.

Definition at line 159 of file HttpTokens.d.

References HttpTokens::parse(), and IBuffer::setValidContent().

void reset  )  [inline, inherited]
 

Reset this set of tokens.

Definition at line 171 of file HttpTokens.d.

References IBuffer::clear(), and TokenStack::reset().

Referenced by HttpRequest::reset(), and HttpClient::reset().

bool isParsed  )  [inline, inherited]
 

Have tokens been parsed yet?

Definition at line 187 of file HttpTokens.d.

Referenced by HttpRequest::getInputParameters().

void setParsed bool  parsed  )  [inline, inherited]
 

Indicate whether tokens have been parsed or not.

Definition at line 198 of file HttpTokens.d.

Referenced by HttpParams::parse(), and parse().

char [] get char[]  name  )  [inline, inherited]
 

Return the value of the provided header, or null if the header does not exist

Definition at line 210 of file HttpTokens.d.

References TokenStack::findToken(), HttpTokens::split(), and HttpToken::value.

Referenced by AdminServlet::addLogger(), HttpTokens::getDate(), HttpTokens::getInt(), AdminServlet::service(), and AdminServlet::setLoggerLevel().

int getInt char[]  name  )  [inline, inherited]
 

Return the integer value of the provided header, or -1 if the header does not exist

Definition at line 230 of file HttpTokens.d.

References HttpTokens::get().

Referenced by AdminServlet::addLogger().

long getDate char[]  name  )  [inline, inherited]
 

Return the date value of the provided header, or -1 if the header does not exist

Definition at line 246 of file HttpTokens.d.

References HttpTokens::get().

int opApply int(*  dg)(inout HttpToken)  )  [inline, inherited]
 

Iterate over the set of tokens

Definition at line 261 of file HttpTokens.d.

References HttpTokens::split().

void write IWriter  writer  )  [inline, inherited]
 

Output the token list to the provided writer

Reimplemented from IWritable.

Definition at line 282 of file HttpTokens.d.

References IWriter::cr(), and IWriter::put().

private bool split Token  t,
inout HttpToken  element
[inline, inherited]
 

split basic token into an HttpToken

Definition at line 298 of file HttpTokens.d.

References HttpTokens::emptyString, HttpTokens::inclusive, HttpTokens::seperator, and Token::toString().

Referenced by HttpTokens::get(), HttpTokens::FilteredTokens::opApply(), and HttpTokens::opApply().

FilteredTokens createFilter char[]  match  )  [inline, inherited]
 

Create a filter for iterating over the tokens matching a particular name.

Definition at line 329 of file HttpTokens.d.

void setOutputBuffer IBuffer  output  )  [inline, protected, inherited]
 

Set the output buffer for adding tokens to. This is used by the various MutableXXXX classes.

Definition at line 398 of file HttpTokens.d.

IBuffer getOutputBuffer  )  [inline, protected, inherited]
 

Return the buffer used for output.

Reimplemented in HttpMutableHeaders.

Definition at line 409 of file HttpTokens.d.

char [] toOutputString  )  [inline, inherited]
 

Return a char[] representing the output. An empty array is returned if output was not configured.

Definition at line 421 of file HttpTokens.d.

References IBuffer::toString().

void add char[]  name,
void(*  dg)(IBuffer)
[inline, protected, inherited]
 

Add a token with the given name. The content is provided via the specified delegate. We stuff this name & content into the output buffer, and map a new Token onto the appropriate buffer slice.

Definition at line 439 of file HttpTokens.d.

References IBuffer::append(), IBuffer::getLimit(), HttpTokens::inclusive, TokenStack::push(), HttpTokens::sepString, and IBuffer::toString().

Referenced by HttpTokens::add(), HttpTokens::addDate(), and HttpTokens::addInt().

void add char[]  name,
char[]  value
[inline, protected, inherited]
 

Add a simple name/value pair to the output

Reimplemented in HttpMutableParams.

Definition at line 465 of file HttpTokens.d.

References HttpTokens::add(), and IBuffer::append().

void addInt char[]  name,
int  value
[inline, protected, inherited]
 

Add a name/integer pair to the output

Reimplemented in HttpMutableParams.

Definition at line 481 of file HttpTokens.d.

References HttpTokens::add().

void addDate char[]  name,
long  value
[inline, protected, inherited]
 

Add a name/date(long) pair to the output

Reimplemented in HttpMutableParams.

Definition at line 495 of file HttpTokens.d.

References HttpTokens::add(), and date.


Member Data Documentation

BoundToken line [static, private]
 

Definition at line 152 of file HttpHeaders.d.

Referenced by parse(), and this().

TokenStack stack [protected, inherited]
 

Definition at line 80 of file HttpTokens.d.

Referenced by HttpTokens::FilteredTokens::opApply().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:03 2004 for Mango by doxygen 1.3.6