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

HttpMutableHeaders Class Reference

Inheritance diagram for HttpMutableHeaders:

HttpHeaders List of all members.

Public Member Functions

 this (IBuffer output)
 this (HttpMutableHeaders source)
HttpMutableHeaders clone ()
void add (HttpHeaderName name, void(*dg)(IBuffer))
void add (HttpHeaderName name, char[] value)
void addInt (HttpHeaderName name, int value)
void addDate (HttpHeaderName name, long value)
IBuffer getOutputBuffer ()

Private Types

typedef HttpTokens parse parse

Private Member Functions

void parse (IBuffer input)
 this (HttpHeaders source)
 this (char separator, bool inclusive=false)
 this (HttpTokens source)
char[] get (HttpHeaderName name)
int getInt (HttpHeaderName name)
long getDate (HttpHeaderName name)
int opApply (int(*dg)(inout HeaderElement))
FilteredHeaders createFilter (HttpHeaderName header)
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)

Static Private Member Functions

static this ()

Detailed Description

Maintains a set of output headers. These are held in an output buffer, and indexed via a TokenStack. Deleting a header could be supported by setting the TokenStack entry to null, and ignoring such values when it's time to write the headers.

Definition at line 354 of file HttpHeaders.d.


Member Typedef Documentation

typedef HttpTokens parse parse [inherited]
 

Definition at line 158 of file HttpHeaders.d.


Member Function Documentation

this IBuffer  output  )  [inline]
 

Construct output headers, using the provided buffer as a place to stash the header content.

Definition at line 363 of file HttpHeaders.d.

this HttpMutableHeaders  source  )  [inline]
 

Clone a source set of HttpMutableHeaders

Definition at line 375 of file HttpHeaders.d.

HttpMutableHeaders clone  )  [inline]
 

Clone this set of HttpMutableHeaders

Reimplemented from HttpHeaders.

Definition at line 386 of file HttpHeaders.d.

void add HttpHeaderName  name,
void(*)(IBuffer dg
[inline]
 

Add the specified header, and use a callback to provide the content.

Definition at line 398 of file HttpHeaders.d.

References HttpHeaderName::value.

Referenced by add(), HttpMutableCookies::add(), HttpResponse::commit(), HttpResponse::sendRedirect(), HttpMessage::setContentType(), and testHttpClient3().

void add HttpHeaderName  name,
char[]  value
[inline]
 

Add the specified header and text

Definition at line 409 of file HttpHeaders.d.

References add(), and HttpHeaderName::value.

void addInt HttpHeaderName  name,
int  value
[inline]
 

Add the specified header and integer value

Definition at line 420 of file HttpHeaders.d.

References HttpHeaderName::value.

Referenced by ServletResponse::setContentLength().

void addDate HttpHeaderName  name,
long  value
[inline]
 

Add the specified header and long/date value

Definition at line 431 of file HttpHeaders.d.

References HttpHeaderName::value.

Referenced by MethodServlet::get().

IBuffer getOutputBuffer  )  [inline]
 

Return the output buffer provided during construction.

Reimplemented from HttpTokens.

Definition at line 442 of file HttpHeaders.d.

Referenced by HttpMutableCookies::this().

void parse IBuffer  input  )  [inline, inherited]
 

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

Reimplemented from HttpTokens.

Definition at line 217 of file HttpHeaders.d.

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

static this  )  [inline, static, inherited]
 

Setup a line tokenizer for later use

Reimplemented from HttpTokens.

Definition at line 166 of file HttpHeaders.d.

References HttpHeaders::line.

this HttpHeaders  source  )  [inline, inherited]
 

Clone a source set of HttpHeaders

Definition at line 194 of file HttpHeaders.d.

this char  separator,
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 120 of file HttpTokens.d.

References HttpTokens::inclusive, HttpTokens::input, HttpTokens::separator, HttpTokens::sepString, HttpTokens::stack, and TokenStack.

this HttpTokens  source  )  [inline, inherited]
 

Clone a source set of HttpTokens

Definition at line 140 of file HttpTokens.d.

References TokenStack::clone(), HttpTokens::inclusive, HttpTokens::input, HttpTokens::output, HttpTokens::parsed, HttpTokens::separator, HttpTokens::sepString, and HttpTokens::stack.

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

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

Definition at line 231 of file HttpHeaders.d.

References HttpHeaderName::value.

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

int getInt HttpHeaderName  name  )  [inline, inherited]
 

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

Definition at line 243 of file HttpHeaders.d.

References HttpHeaderName::value.

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

long getDate HttpHeaderName  name  )  [inline, inherited]
 

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

Definition at line 255 of file HttpHeaders.d.

References HttpHeaderName::value.

Referenced by MethodServlet::get().

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

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 268 of file HttpHeaders.d.

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

FilteredHeaders createFilter HttpHeaderName  header  )  [inline, inherited]
 

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 292 of file HttpHeaders.d.

void add char[]  name,
void(*)(IBuffer dg
[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 460 of file HttpTokens.d.

References IBuffer::append(), IBuffer::getLimit(), HttpTokens::inclusive, HttpTokens::output, TokenStack::push(), HttpTokens::sepString, HttpTokens::stack, 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 486 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 502 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 516 of file HttpTokens.d.

References HttpTokens::add().


The documentation for this class was generated from the following file:
Generated on Fri Nov 11 18:44:36 2005 for Mango by  doxygen 1.4.0